Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sendkeys
Message
 
À
31/07/2000 10:42:28
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Titre:
Divers
Thread ID:
00398761
Message ID:
00398809
Vues:
14
>>
>>Are you getting back a valid window handle? BTW, FindWindow() takes two strings passed by reference. The first parameter is the window's class name. If it's a null pointer (0) all classes match. The second is the window's title bar text, if that's a null pointer all window text matches. In both cases, the values passed are case sensitive and must match exactly.
>
>The window handle is definitely correct... I've tested it using the showwindow api. Have you used sendmessage? Also, is there an api to return the window's class name from the window handle?
>
Mace,

Yes, I've used SendMessage() but not in this context, so I have no idea if whether or not this will work. My instinct, however, would be to first try to use keybd_event() rather than this.

The following snippet demonstrates how to return the class name:
DECLARE INTEGER GetClassName IN Win32API;
  INTEGER hWnd, STRING @lpClassName, INTEGER nMaxCount
DECLARE INTEGER GetLastError IN Win32API
* lnhWnd is the window handle
lcclassname = SPACE(100)
lnsize = LEN(lcclassname)
lnsize = GetClassName(lnhWnd, @lcclassname, lnsize)
IF lnsize > 0
  ? LEFT(lcclassname, lnsize)
ELSE
  ? GetLastError()
ENDIF
I've never found this information terribly useful because class names can and do change between versions of applications.
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