Cut-n-paste the code below into a prg file and run it from within VFP...
DECLARE INTEGER CloseWindow IN user32 INTEGER
DECLARE INTEGER GetActiveWindow IN user32
DECLARE INTEGER GetWindow IN user32 INTEGER, INTEGER
DECLARE INTEGER GetWindowTextLength IN user32 INTEGER
DECLARE INTEGER IsIconic IN user32 INTEGER
DECLARE INTEGER IsWindow IN user32 INTEGER
DECLARE INTEGER IsWindowVisible IN user32 INTEGER
LOCAL nActive, nCounter, nHwnd, nIndex
LOCAL cWindowCaption
nCounter = 0
nHwnd = -1
nActive = GetActiveWindow()
DO WHILE nHwnd != GetWindow(nActive, 1) &&1 = FIRST WINDOW
IF nHwnd != -1
nHwnd = GetWindow(nHwnd, 2) &&2 = NEXT WINDOW
ELSE
nHwnd = GetWindow(nActive, 0) &&0 = LAST WINDOW
ENDIF
IF GetWindowTextLength(nHwnd) > 0 AND IsWindow(nHwnd) != 0 AND IsWindowVisible(nHwnd) != 0
nCounter = nCounter + 1
DIMENSION aryWindows(nCounter)
aryWindows(nCounter) = nHwnd
ENDIF
ENDDO
*!* Now Minimize All Windows
FOR nIndex=1 TO nCounter
If IsIconic(aryWindows(nIndex)) = 0
IF CloseWindow(aryWindows(nIndex)) = 0 *!* Window doesn't exist or something wrong
ENDIF
ENDIF
ENDFOR
Slighthaze = NULL
[ul][li]FAQ184-2483 An excellent guide to getting a fast and accurate response to your questions in this forum.[/li][/ul]
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.