Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
_SCREEN.hWnd, FindWindow() and MAINHWND()
Message
 
À
31/07/2001 14:38:23
Gerry Schmitz
GHS Automation Inc.
Calgary, Alberta, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00537608
Message ID:
00537942
Vues:
80
>>Have you looked at my code in SpyFoxFox? While it retrieves all the existing windows from the Windows Desktop down, it wouldn't take too much to modify to fit your needs.
>
>OK, thanks. Here's what I came up with:

Looks fine. Tell me, however, are you just trying to get the window handle of the _SCREEN? If so, there may be a better (less code) way.

>
>   THISFORM.Get_Next( GetWindow( MAINHWND(), GW_CHILD ) )
>
>*---------------------------------------------------------
>PROCEDURE Get_Next
>*---------------------------------------------------------
>   LPARAMETER TN_Next
>
>   LOCAL LN_Next
>
>   m.LN_Next = m.TN_Next
>
>   DO WHILE m.LN_Next <> 0
>      m.LN_Next = GetWindow( m.LN_Next, GW_HWNDNEXT )
>
>      THISFORM.Get_Next( GetWindow( m.LN_Next, GW_CHILD ) )
>   ENDDO
>
>
>>Using AddProperty() for the _SCREEN or _VFP might break existing code. In playing around with the beta, I noted that forms designed in 6.0 with a custom hwnd property didn't cause any problems when opened in 7.0. The only problem that I ran into was code that assigned the property (via _WhTohWnd() and _WFindTitl() in Foxtools) generated an error since the property in 7.0 is read-only. Fairly simple to workaroud with a compiler directive, however.
>
>Directives would work. However, I try to avoid stepping on VFP's naming standards to start with; I had a custom "hwnd" property and called it "H_Window". All my custom properties employ an underscore somewhere in order to avoid collisions with VFP.

Not a bad idea. I must admit that I haven't used a window handle property that much in my 6.0 stuff.
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