Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Bring forward another application that's minimized
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00156909
Message ID:
00156927
Vues:
27
>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform