Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Bring forward another application that's minimized
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00156909
Message ID:
00156927
Views:
33
>I need to bring a running copy of Word forward from VFP. If Word is not minimized, SetForegroundWindow() works great. If it is minimized, the window doesn't come forward. I guess what I really need to do is find out if it's minimized and if it is restore it.
>
>Any ideas?
>
Hi Josh,

First, you need the window handle. It'd probably be easiest to use my Is_Run function from the download section to retrieve that value, then:
DECLARE INTEGER ShowWindow IN Win32API;
  INTEGER hwnd, INTEGER nCmdShow
DECLARE SHORT IsIconic IN Win32API;
  INTEGER hwnd
DECLARE SHORT SetForegroundWindow IN Win32API;
  INTEGER hWnd
* lnhWnd is the window handle
IF (IsIconic(lnhWnd) # 0)
  * 9 = SW_RESTORE
  * Restore the window
  = ShowWindow(lnhWnd, 9)
ENDIF
= SetForegroundWindow(lnhWnd)
I think that I also saw a file in the download section that may do this automatically for you.

hth,
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform