Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to set focus to exe
Message
De
18/03/2004 13:13:55
Charlie Hancock
California Dept of Public Health
Richmond, Californie, États-Unis
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00886769
Message ID:
00887613
Vues:
17
Hi Sergey,

Regarding the solution you pointed me to:

********************
lpdwProcessId = 0
lnThreadVFP = GetCurrentThreadID()
lnThread2 = GetWindowThreadProcessId(GetForegroundWindow(), @lpdwProcessId)
if ( lnThreadVFP # lnThread2 )
AttachThreadInput(lnThreadVFP, lnThread2, 1)
SetForegroundWindow(VFPwindowhandle)
AttachThreadInput(lnThreadVFP, lnThread2, 0)
else
SetForegroundWindow(VFPwindowhandle)
endif
********************

If it's not too much trouble, could you provide the DECLARE statements that make those Windows API functions visible? They aren't all working for me.

Also, is it really necessary to deal with threads? I'm trying to get a VFP form, which is already a top-level form on top of all other application forms, to give itself the focus. Shouldn't I just need the window handle for my form (ThisForm.HWnd) to pass to the appropriate API function (SetActiveWindow() and/or SetForegroundWindow())?

By the way, I get the desired behavior when I RUN the VFP exe from a FP 2.6 command window, but not when I RUN it from the compiled FP 2.6 app.

Thanks again,

Charlie
Charlie Hancock
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform