WindowInfo
Script function

world.WindowInfo

DOC_scripting Read about scripting

Type

Method

Summary

Returns information about a miniwindow

Prototype

VARIANT WindowInfo(BSTR Name, long InfoType);

DOC_data_types 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.

Name - 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.


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



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

DOC_miniwindows Mini Windows

Functions

FNC_GetDeviceCaps GetDeviceCaps (Gets screen device capabilities)
FNC_SetCursor SetCursor (Changes the shape of the mouse cursor)
FNC_TextRectangle TextRectangle (Specifies the size of the rectangle in which text is displayed in the output window.)
FNC_WindowAddHotspot WindowAddHotspot (Adds a hotspot to a miniwindow)
FNC_WindowArc WindowArc (Draws an arc in a miniwindow)
FNC_WindowBezier WindowBezier (Draws a Bézier curve in a miniwindow)
FNC_WindowBlendImage WindowBlendImage (Blends an image into a miniwindow, using a specified blending mode)
FNC_WindowCircleOp WindowCircleOp (Draws ellipses, filled rectangles, round rectangles, chords, pies in a miniwindow)
FNC_WindowCreate WindowCreate (Creates a miniwindow)
FNC_WindowCreateImage WindowCreateImage (Creates an image in a miniwindow)
FNC_WindowDelete WindowDelete (Deletes a miniwindow)
FNC_WindowDeleteAllHotspots WindowDeleteAllHotspots (Deletes all hotspots from a miniwindow)
FNC_WindowDeleteHotspot WindowDeleteHotspot (Deletes a hotspot from a miniwindow)
FNC_WindowDragHandler WindowDragHandler (Adds a drag handler to a miniwindow hotspot)
FNC_WindowDrawImage WindowDrawImage (Draws an image into a miniwindow)
FNC_WindowDrawImageAlpha WindowDrawImageAlpha (Draws an image into a miniwindow respecting the alpha channel)
FNC_WindowFilter WindowFilter (Performs a filtering operation over part of the miniwindow.)
FNC_WindowFont WindowFont (Loads a font into a miniwindow)
FNC_WindowFontInfo WindowFontInfo (Returns information about a font)
FNC_WindowFontList WindowFontList (Lists all fonts loaded into a miniwindow)
FNC_WindowGetPixel WindowGetPixel (Gets the colour of a single pixel in a miniwindow)
FNC_WindowGradient WindowGradient (Draws a gradient in a rectangle)
FNC_WindowHotspotInfo WindowHotspotInfo (Returns information about a hotspot)
FNC_WindowHotspotList WindowHotspotList (Lists all hotspots installed into a miniwindow)
FNC_WindowHotspotTooltip WindowHotspotTooltip (Changes the tooltip text for a hotspot in a miniwindow)
FNC_WindowImageFromWindow WindowImageFromWindow (Creates an image from another miniwindow)
FNC_WindowImageInfo WindowImageInfo (Returns information about an image)
FNC_WindowImageList WindowImageList (Lists all images installed into a miniwindow)
FNC_WindowImageOp WindowImageOp (Draws an ellipse, rectangle or round rectangle, filled with an image)
FNC_WindowLine WindowLine (Draws a line in a miniwindow)
FNC_WindowList WindowList (Lists all miniwindows)
FNC_WindowLoadImage WindowLoadImage (Loads an image into a miniwindow from a disk file)
FNC_WindowMenu WindowMenu (Creates a pop-up menu inside a miniwindow)
FNC_WindowMergeImageAlpha WindowMergeImageAlpha (Merges an image into a miniwindow based on an alpha mask)
FNC_WindowPolygon WindowPolygon (Draws a polygon in a miniwindow)
FNC_WindowPosition WindowPosition (Moves a miniwindow)
FNC_WindowRectOp WindowRectOp (Draws a rectangle in a miniwindow)
FNC_WindowSetPixel WindowSetPixel (Sets a single pixel in a miniwindow to the specified colour)
FNC_WindowShow WindowShow (Shows or hides a miniwindow)
FNC_WindowText WindowText (Draws text into a miniwindow)
FNC_WindowTextWidth WindowTextWidth (Calculates the width of text in a miniwindow)
FNC_WindowWrite WindowWrite (Writes the contents of a miniwindow to disk as a graphics file)

(Help topic: function=WindowInfo)

DOC_contents Documentation contents page