Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Setting Focus to Top Level Form
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00546077
Message ID:
00546102
Vues:
20
Guess I could do with VFP7! I just can't get it to detect the window! Here is the code - I wondered if you could see any problems with it?

DECLARE INTEGER FindWindow IN Win32API;
STRING @lpClassName, ;
STRING @lpWindowName

lcApplicationTitle = (oApp.AppTitle + oApp.FormCaption)
*!* wait window "Caption " + (lcApplicationTitle)
lnHWnd = FindWindow(0, @lcApplicationTitle)

*!* wait window "Handle " + str(lnHWnd)

DECLARE SHORT SetForegroundWindow IN USER32.DLL INTEGER lnHWnd
* I assume you've got the hWnd you want stored in the variable nhWnd
IF SetForegroundWindow(lnHWnd) # 0
* the desired window and thread are now in the foreground
wait window "Success"
ELSE
wait window "Failed"
* the hWnd was not assigned to the foreground and the thread
* remains at its default priority
ENDIF
Chris Maiden
Email
Web
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform