Re: Resize application window - more information
- From: Ltexeira <Ltexeira@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 24 Mar 2008 14:01:01 -0700
The code you refer to is the same code as the code I posted.
The differences are minor.
Please compare
Function GetWinHandle(hInstance As Long) As Long
Dim tempHwnd, tophnd As Long
Dim retval As Long
tempHwnd = FindWindow(vbNullString, vbNullString)
Do Until tempHwnd = 0
If GetParent(tempHwnd) = 0 Then
If hInstance = ProcIDFromWnd(tempHwnd) Then
GetWinHandle = tempHwnd
'Exit Do
End If
End If
tempHwnd = GetWindow(tempHwnd, GW_HWNDNEXT)
Loop
End Function
with
hWndJob = FindWindow(vbNullString, vbNullString)
Do While hWndJob <> 0
If GetParent(hWndJob) = 0 Then
Call GetWindowThreadProcessId(hWndJob, PID)
If PID = ProcessID Then
hWndShell = hWndJob
Exit Do
End If
End If
hWndJob = GetWindow(hWndJob, GW_HWNDNEXT)
Loop
and you'll see what I mean.
It's possible I got my code from an example posted by someone using yours
as a template.
..:., problem persists.
However, I can just go ahead and 'resize' the window (whether it exists
or not) of every handle I can associate with the instance ID.
That seems to work okay, it's just not as elegant as I'd like!
.
- 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
- From: Ltexeira
- 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):