>>
>>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
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