Re: Resize application window - more information
- From: "Karl E. Peterson" <karl@xxxxxxxx>
- Date: Mon, 24 Mar 2008 11:36:24 -0700
Ltexeira wrote:
So the question now becomes : how can I identify the one out of several
handles
associated with the instance is the window itself so I can resize it?
This routine will find the "top-level" window associated with any given hWnd:
Private Declare Function GetParent Lib "user32" (ByVal hWnd As Long) As Long
Private Declare Function IsWindowVisible Lib "user32" (ByVal hWnd As Long) As
Long
Public Function GetTopLevel(ByVal hChild As Long) As Long
Dim hWnd As Long
' Read parent chain up to highest visible.
hWnd = hChild
Do While IsWindowVisible(GetParent(hWnd))
hWnd = GetParent(hChild)
hChild = hWnd
Loop
GetTopLevel = hWnd
End Function
--
..NET: It's About Trust!
http://vfred.mvps.org
.
- Follow-Ups:
- Re: Resize application window - more information
- From: Ltexeira
- Re: Resize application window - more information
- Prev by Date: User forms
- Next by Date: Re: Resize application window - more information
- Previous by thread: User forms
- Next by thread: Re: Resize application window - more information
- Index(es):
Relevant Pages
|
|