Re: Resize application window - more information



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!

.