Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Top level form does not get the focus
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00627628
Message ID:
00628328
Vues:
14
>>>Paste this into the init method of your form and it will receive focus :-
>>>
>>>declare integer FindWindow in USER32.dll integer, string
>>>declare integer SetForegroundWindow in User32.dll Integer
>>>WindowTitle=chr(34)+alltrim(thisform.caption)+chr(34)
>>>winHandle = FindWindow(0,&WindowTitle)
>>>if winHandle > 0
>>> SetForegroundWindow(winHandle)
>>>endif
>>>
>>>Regards
>>
>>Steve,
>>
>>I don't have this problem. Besides, in VFP 7.0, I could just use the hWnd property, instead of FindWindow.
>
>VFP 7 has hWnd? I have a copy but have not installed it.
>Is their an hWnd for each all controls? Labels, ActiveX, etc?

Terry,

Native VFP forms in 7.0 have an hWnd property that represents the Window handle. Note that in reality, a form with its ShowWindow property set to 0 is a different class than one with the property set to 2 (As top-level form). The former has a single window handle. The latter has two, the frame and client area. The latter of which is not exposed as a property.

ActiveX controls have a window handle. Whether or not it's exposed as a property is another matter. The TreeView for example, does expose this property, but it wasn't documented until recently.

The native VFP controls, however, are not windows (as before) and thus have no window handle associated with them. Labels, BTW, don't have window handles period, not even in C++. These are created with the API call DrawText().
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