Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
HWND Property
Message
De
21/05/2003 03:53:25
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Divers
Thread ID:
00790675
Message ID:
00790944
Vues:
16
>From the VFP8 Help File:
>
>The Microsoft Windows operating environment identifies each form in an application by assigning it a handle, or hWnd. The hWnd property is used with Windows API calls. Many Windows operating environment functions require the hWnd of the active window as an argument.
>
>Because the value of this property can change while a program is running, you cannot rely on its value (e.g., when stored in a variable).
>
>hWnd is available in user-defined Forms and Toolbar objects and is read-only at both run and design-time.

>
>Can not rely on its value? What the hell does this mean? The value of a form's HWND property can change during the life of the form? I ask this because I am trying to use the new collection object for tracking open forms in an app and hoped to use this property as the key. If EVERY one of my forms could only have one instance at any one time, this would not be an issue. But some forms can be open multiple times so the form name will not be unique. However, HWND for each form should be unique.
>
>Any enlightenment would be appreciated. TIA!

Mark,
Like Brian and George I didn't encounter it change at runtime. I have modules that hide the window, invoke other toplevel forms + track nonVFP apps, attaching to their thread input, detaching etc. I was scared from exactly the same phrase '... you cannot rely on its value ...' and used API to be sure. It wasn't changing. But I trust to doc writers until I can solidly tell the reverse:)
For your case, while a form name is not unique you could make it unique at run time changing the form name :)
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform