CurrentWindow

(Engine-Level Function)

Description: Returns the application window over which the mouse cursor rests.
Returns: Object Value
Usage: Steady State only.
Function Groups: Locator,  Window
Related to: ActiveWindow | WinLocSwitch | WinXLoc | WinYLoc | Window
Format: CurrentWindow( )
Parameters: None 
Comments: The return value is the object value of the module instance running in the window that the mouse cursor is over. This is not necessarily the active window. If more than one module instance is running in that window, the return value will be the highest scope module instance running in that window, which should either call or be the parent or ancestor of all other module instances in that window.
Unlike the ActiveWindow function, CurrentWindow will recognize and return the object value of the root module instance in child windows when the mouse passes over them.
This function is useful for things like status lines, or help windows. It works only on windows that belong to VTScada.

Example:

  Obj = CurrentWindow();
  WinX = WinXLoc(obj);
  WinY = WinYLoc(obj);
  WinB = WinLocSwitch(obj);

This shows how to get information about the mouse in another window. This window is determined to be the window the mouse is passing over. WinX and WinY have the mouse location (which works like XLoc and YLoc), and WinB has the current mouse button combination (like LocSwitch).