Article ID: 121242
Article Last Modified on 7/1/2004
110117 How to Pause Program Execution During a RUN Command
? IsWindEx("Microsoft Word")
To produce a list of all visible windows currently in existence, call the
function with a null value, as follows:
=IsWindEx("")
FUNCTION IsWindEx
PARAMETERS WindowName
IsWindEx = .F.
SET LIBRARY TO foxtools.fll
* Register the Windows API functions that will be called
mGetWinTxt = RegFn("GetWindowText", "I@CI", "I")
mGetWindow = RegFn("GetWindow", "II", "I")
mIsWinVis = RegFn("IsWindowVisible", "I", "I")
* Get the HWND (handle) to the main FoxPro window
foxhwnd = MAINHWND()
* Produce a list of all windows
hwndNext = CallFn(mGetWindow,foxhwnd,0)
DO WHILE hwndNext <> 0
IF (hwndnext <> foxhwnd) .AND. ;
CallFn(mGetWindow,hwndnext,4) = 0 .AND. ;
CallFn(mIsWinVis,hwndnext) <> 0
Stuffer = SPACE(64)
x = CallFn(mGetWinTxt,hwndnext,@Stuffer,64)
* If a window name was specified, check to
* see if this is the specified window. If a
* window name was not specified, display the
* name of the window.
IF LEN(TRIM(WindowName)) = 0
? Stuffer
ELSE
IF WindowName $ Stuffer
IsWindEx = .T.
EXIT
ENDIF
ENDIF
ENDIF
hwndNext = CallFn(mGetWindow,hwndnext,2)
ENDDO
SET LIBRARY TO
IF LEN(TRIM(WindowName)) = 0
IsWindEx = .T.
ENDIF
RETURN IsWindEx
For more information about the functions called in this code sample, please
refer to the documentation for the Windows 3.1 Software Development Kit or
the Microsoft Developer's Network (MSDN) Development Library CD-ROM.
80124 Retrieving the Names of Simultaneous Tasks Under Windows
Additional query words: VFoxWin FoxWin 2.50 2.50a 2.50b task open list manager emulate taskmanager
Keywords: kbhowto kbcode KB121242