Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Vfp6.0 findwindow example
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00151319
Message ID:
00151448
Vues:
21
>would somebody have a findwindow example
>so I could get the handle for showwindow call
>
>Thanks
Hi Ken,

Here's an example. I do, however, have some comments which will follow.
DECLARE INTEGER FindWindow IN Win32API;
  STRING @lpClassName, STRING @lpWindowName
* Find by the title bar text
* lctitle is the title bar text
lnhWnd = FindWindow(0, @lctitle)
* Find by the class name
* lcclass is the classname
lnhWnd = FindWindow(@lcclass, 0)
In the above examples, a null string is represented by passing a zero. In the case where the class is null, all windows classes match. However, the title bar must match exactly in terms of case and context. In the second example, all window title bar text match, but the class name must match exactly.

Trying to retrieve a window handle based on the class name, is not only tricky (many applications have a number of windows associated with them), and class names are subject to change between versions.

Using the title bar text can be a problem since most applications have dynamic title bars. I've posted a file in the download section (Is_Run and Is_Run32) that finds a window handle bassed on the known portion of the title bar. You might want to take a look.

hth,
George

Ubi caritas et amor, deus ibi est
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform