[Home] [Downloads] [Search] [Help/forum]

MUSHclient scripting

Description of MUSHclient world function: world.WindowInfo

Name WindowInfo
Type Method
Summary Returns information about a miniwindow
Prototype VARIANT WindowInfo(BSTR WindowName, long InfoType);

View list of data type meanings


This returns information about a particular miniwindow. You might use this to find where the window is on the screen, what its size is, whether it is visible, and so on.

WindowName - the name of an existing miniwindow.

InfoType - the information you want:

1: Left (from WindowCreate)

2: Top (from WindowCreate)

3: Width

4: Height

5: Show flag

6: Is it hidden right now?

7: Layout position code

8: Flags

9: Background colour

10: Where it is right now: left

11: Where it is right now: top

12: Where it is right now: right

13: Where it is right now: bottom

14: Where mouse last was (mouse down, mouse up or move) - X position - relative to miniwindow

15: Where mouse last was (mouse down, mouse up or move) - Y position - relative to miniwindow

16: Incremented each time items 14/15 are updated.

17: Where mouse was (during drag operation) - X position - relative to output window

18: Where mouse was (during drag operation) - y position - relative to output window

19: Hotspot ID of the hotspot currently being moused-over (empty string if none)

20: Hotspot ID of the hotspot currently being moused-down in (empty string if none)

21: Date/time the miniwindow was installed.

22: The Z-Order of the miniwindow.

23: The Plugin ID of the plugin that created this miniwindow (empty string if no plugin)

InfoType 10 to 13 are where the auto positioning last placed the window (the last time the main screen was refreshed).

The "show" flag is whether you want the window shown. Infotype 6 is whether it had to be temporarily hidden. This only applies to position codes 5, 7, 9, 11. The window will thus be visible if:

* The Show flag is true (Infotype 5)

* The "Is it hidden right now" flag is false (Infotype 6)

* It is actually positioned somewhere it can be seen

* Another window is not on top of it

The mouse position (info items 14 and 15) are updated each time a mouse-down, mouse-up, or mouse-move event is processed by a miniwindow. When this happens, item 16 is incremented. This will eventually "wrap around" and become negative once it is incremented 2,147,483,648 times.

The intention here is that if item 16 changes (whether up or down) then you know a new mouse coordinate has been recorded for this miniwindow.

The mouse position (for info items 14 and 15) is relative to the start of the miniwindow, whatever that is. You could use this to create a pop-up menu at the point at which the mouse was clicked.

If item 20 is not the empty string, then the mouse is currently "captured" by the nominated hotspot.

For more information, see:


Note: Available in version 4.34 onwards.

Lua example
WindowInfo (win, 4) --> get height
Lua notes
Lua returns nil instead of a NULL or EMPTY variant.
Returns The specified information about the window, as described above.
An EMPTY variant, if the window does not exist.
A NULL variant if the InfoType is not a valid type.
Introduced in version 4.34

See also ...

Function Description
WindowCreate Creates a miniwindow
WindowList Lists all miniwindows
WindowShow Shows or hides a miniwindow

Search for script function

Enter a word or phrase in the box below to narrow the list down to those that match.

The function name, prototype, summary, and description are searched.

Search for:   

Leave blank to show all functions.

Return codes

Many functions return a "code" which indicates the success or otherwise of the function.

You can view a list of the return codes

Function prototypes

The "prototype" part of each function description lists exactly how the function is called (what arguments, if any, to pass to it).

You can view a list of the data types used in function prototypes

View all functions


Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]