|
-
Jul 14th, 2002, 11:00 AM
#1
GetWindowWord help please
I have the code to return a file name/path for a window:
''''''''''''
Dim ModuleName As String, FileName As String, hInst As Long, hWnd As Long
ModuleName = String$(128, Chr$(0))
hWnd = FindWindow("class name", vbNullString)
hInst = GetWindowWord(hWnd, GWW_HINSTANCE) ' -6
ModuleName = Left$(ModuleName, GetModuleFileName(hInst, ModuleName, Len(ModuleName)))
MsgBox ModuleName
'''''''''
However this always returns the path of my program, and NOT the window i want.
hWnd returns a number, no problem there.
But hInst always returns 0.
I think this is the problem, (maybe GWW_HINSTANCE is wrong?), any ideas would be great.
Thanks, David.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|