Re: Resize application window - more information



Ltexeira wrote:
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.

It's a little hard to follow your code there, but the standard advice has always
been to avoid GetWindow loops when possible, which has been the case since VB5
introduced the AddressOf operator. I'd recommend using an EnumWindows callback
instead. Take a look at http://vb.mvps.org/samples/Shell32 for some code I wrote to
do this (specifically, the hWndShell function in Shell32.bas).

As to why GetTopLevel returning the same value passed, that's because you've already
ascertained that outcome with this test:

If GetParent(tempHwnd) = 0 Then

Which is to say, you're only passing top-level windows to it.
--
..NET: It's About Trust!
http://vfred.mvps.org


.