Re: Resize application window - more information
- From: Ltexeira <Ltexeira@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 24 Mar 2008 13:09:04 -0700
Thank you for the quick response.
I have incorporated that code and have the following problem :
For the instance ID of the 'Shell'ed AcroRd32 there are several 'handles'.
For each of these handles, the function GetTopLevel returns the same number as
it is given.
Snippet follows :
Function GetWinHandle(hInstance As Long) As Long
Dim tempHwnd, tophnd As Long
tempHwnd = FindWindow(vbNullString, vbNullString)
Do Until tempHwnd = 0
If GetParent(tempHwnd) = 0 Then
If hInstance = ProcIDFromWnd(tempHwnd) Then
GetWinHandle = tempHwnd
tophnd = GetTopLevel(tempHwnd)
MsgBox "Found " & hInstance & " Handle " & tempHwnd & " Top : "
& tophnd
'Exit Do would normally exit, but want to see all found
End If
End If
tempHwnd = GetWindow(tempHwnd, GW_HWNDNEXT)
Loop
End Function
this produces several handles for the single instance number, with the top
level
always being the same number as the handle the function is given, example
of a single run produces :
Instance Handle TopHandle
3008 394434 394434
3008 394426 394426
. . .
. . .
3008 1377336 1377336
for a total of 11 different handles (in this case).
Please advise, and thanks again for your attention to this problem.
As a side note, can you direct me to a good reference for the Windows APIs as
they pertain to VBA? I don't mind buying books!
.
- Follow-Ups:
- Re: Resize application window - more information
- From: Karl E. Peterson
- Re: Resize application window - more information
- References:
- Re: Resize application window - more information
- From: Karl E. Peterson
- Re: Resize application window - more information
- Prev by Date: Re: Resize application window - more information
- Next by Date: Re: VBA and switching focus between applications
- Previous by thread: Re: Resize application window - more information
- Next by thread: Re: Resize application window - more information
- Index(es):