Description of MUSHclient world function: world.WindowInfo
||Returns information about a miniwindow
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)
5: Show flag
6: Is it hidden right now?
7: Layout position code
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.
WindowInfo (win, 4) --> get height
Lua returns nil instead of a NULL or EMPTY variant.
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
See also ...
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.
Leave blank to show all functions.
Many functions return a "code" which indicates the success or otherwise
of the function.
view a list of the return codes
The "prototype" part of each function description lists exactly how the function is called (what arguments, if any, to pass to it).
view a list of the data types used in function prototypes
View all functions
Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.
Gammon Software support
Forum RSS feed ( https://gammon.com.au/rss/forum.xml )