I'm trying to get the name of the frontmost window of the frontmost
application in Windows and Mac OS X. So far, I am fighting with the
Windows side. Can anyone tell me why the following doesn't work?
Declare function GetForegroundWindow Lib "user32.dll" As Integer
Soft Declare Function GetWindowTextA Lib "User32" ( hwnd As
Integer, lpString As PString, nMaxCount as integer ) as Integer
Soft Declare Function GetWindowTextW Lib "User32" ( hwnd As
Integer, lpString As PString, nMaxCount as integer ) as Integer
Try
maxlen = GetWindowTextW(GetForegroundWindow(),str,255)
Catch
maxlen = GetWindowTextA(GetForegroundWindow(),str,255)
End
I get the correct maxlen, but the name is not returned in the str
variable.
Greg
P.S. - If anyone has an idea about how to get it on Mac OS X that
would be cool too!
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>