Plugin windows.spf

File: windows.spf
Author: Nicholas Nemtsev, Valery Kondakoff
Description: Additional words, providing a capability to monitor hidden windows (e.g. those hidden by command WIN-HIDE:), minimized windows and topmost windows. Control of windows' transparency (Win2000/XP).

New words:


<window_handle> MINIMIZED?

Returns TRUE only if the specified window is currently minimized.

Example:

\ restore minimized window
WIN-EXIST: "*Internet Explorer"
    IF 
        WIN-HWND MINIMIZED?
        IF
            WIN-RESTORE: "*Internet Explorer"
        THEN
    THEN

<window_handle> TOPMOST?

Returns TRUE if the specified window is currently topmost (displayed over all other windows).

Example:

#( test_topmost
\ toggle specified window topmost/notopmost status using hotkey
WatchHotKey: "$q"
Action:
    WIN-EXIST: "*Notepad*"
    IF
        WIN-HWND TOPMOST? 
        IF
            WIN-NOTOPMOST: "*Notepad*"
        ELSE
            WIN-TOPMOST: "*Notepad*"
        THEN
    THEN
)#

<window_handle> VISIBLE?

Returns FALSE if the window was processed by WIN-HIDE command or minimized to the system tray. Otherwise, returns TRUE.

Example:

\ show window if it was hidden
WIN-EXIST: "*Internet Explorer"
    IF 
        WIN-HWND VISIBLE? 0=
        IF
            WIN-SHOW: "*Internet Explorer"
        THEN
    THEN

WIN-TRANSPARENCY: "win_pattern" <transparency_level>

This word is used to control "transparency" of windows matching a specified mask (except for console windows). The transparency level is specified in numbers ranging from 0 (window is not transparent, flag LAYERED is off) to 255 (window is completely transparent).
Restarting a window will cancel the effect of WIN-TRANSPARENCY:.

Word WIN-TRANSPARENCY: will only work in operating systems which support window transparency, i.e. Windows 2000/XP.

Example:

\ making a window of Notepad half-transparent:
WIN-TRANSPARENCY: "*Notepad" 50
\ making a window of Notepad completely transparent:
\ it still exists on the screen, but it is invisible:
WIN-TRANSPARENCY: "*Notepad" 255
\ canceling the effect of  WIN-TRANSPARENCY:
WIN-TRANSPARENCY: "*Notepad" 0