Script function
world.WindowInfo
Read about scripting
Type
Method
Summary
Returns information about a miniwindow
Prototype
VARIANT WindowInfo(BSTR WindowName, long InfoType);
View list of data type meanings
Description
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:
http://www.gammon.com.au/mushclient/mw_creation.htm
Available in MUSHclient version 4.34 onwards.
Lua example
WindowInfo (win, 4) --> get height
Lua notes
Lua returns nil instead of a NULL or EMPTY variant.
Return value
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.
See Also ...
Topic
MiniWindows
Functions
(GetDeviceCaps) Gets screen device capabilities
(SetCursor) Changes the shape of the mouse cursor
(TextRectangle) Specifies the size of the rectangle in which text is displayed in the output window.
(WindowAddHotspot) Adds a hotspot to a miniwindow
(WindowArc) Draws an arc in a miniwindow
(WindowBezier) Draws a Bézier curve in a miniwindow
(WindowBlendImage) Blends an image into a miniwindow, using a specified blending mode
(WindowCircleOp) Draws ellipses, filled rectangles, round rectangles, chords, pies in a miniwindow
(WindowCreate) Creates a miniwindow
(WindowCreateImage) Creates an image in a miniwindow
(WindowDelete) Deletes a miniwindow
(WindowDeleteAllHotspots) Deletes all hotspots from a miniwindow
(WindowDeleteHotspot) Deletes a hotspot from a miniwindow
(WindowDragHandler) Adds a drag handler to a miniwindow hotspot
(WindowDrawImage) Draws an image into a miniwindow
(WindowDrawImageAlpha) Draws an image into a miniwindow respecting the alpha channel
(WindowFilter) Performs a filtering operation over part of the miniwindow.
(WindowFont) Loads a font into a miniwindow
(WindowFontInfo) Returns information about a font
(WindowFontList) Lists all fonts loaded into a miniwindow
(WindowGetImageAlpha) Draws the alpha channel of an image into a miniwindow
(WindowGetPixel) Gets the colour of a single pixel in a miniwindow
(WindowGradient) Draws a gradient in a rectangle
(WindowHotspotInfo) Returns information about a hotspot
(WindowHotspotList) Lists all hotspots installed into a miniwindow
(WindowHotspotTooltip) Changes the tooltip text for a hotspot in a miniwindow
(WindowImageFromWindow) Creates an image from another miniwindow
(WindowImageInfo) Returns information about an image
(WindowImageList) Lists all images installed into a miniwindow
(WindowImageOp) Draws an ellipse, rectangle or round rectangle, filled with an image
(WindowLine) Draws a line in a miniwindow
(WindowList) Lists all miniwindows
(WindowLoadImage) Loads an image into a miniwindow from a disk file
(WindowMenu) Creates a pop-up menu inside a miniwindow
(WindowMergeImageAlpha) Merges an image into a miniwindow based on an alpha mask
(WindowMoveHotspot) Moves a hotspot in a miniwindow
(WindowPolygon) Draws a polygon in a miniwindow
(WindowPosition) Moves a miniwindow
(WindowRectOp) Draws a rectangle in a miniwindow
(WindowResize) Resizes a miniwindow
(WindowScrollwheelHandler) Adds a scroll-wheel handler to a miniwindow hotspot
(WindowSetPixel) Sets a single pixel in a miniwindow to the specified colour
(WindowSetZOrder) Sets the Z-Order for a miniwindow
(WindowShow) Shows or hides a miniwindow
(WindowText) Draws text into a miniwindow
(WindowTextWidth) Calculates the width of text in a miniwindow
(WindowTransformImage) Draws an image into a miniwindow with optional rotation, scaling, reflection and shearing
(WindowWrite) Writes the contents of a miniwindow to disk as a graphics file
(Help topic: function=WindowInfo)