How do you get a window's size when WindowState <> Normal?

  • Thread starter Thread starter Bob
  • Start date Start date
B

Bob

I had the answer to this but lost it. It's an API call but I can't find it
in the API giude. Could someone refresh my momory?

TIA,
Bob
 
Herfried K. Wagner said:

I was able to extract what I needed (below).

Thanks.

Bob

----------------

Private Declare Function GetWindowPlacement Lib "user32" _
(ByVal hwnd As IntPtr, _
ByRef lpwndpl As WINDOWPLACEMENT) As Integer

Public Structure WINDOWPLACEMENT
Public length As Integer
Public flags As Integer
Public showCmd As Integer
Public ptMinPosition As POINT
Public ptMaxPosition As POINT
Public rcNormalPosition As RECT
Public Structure RECT
Public Sub New( _
ByVal l As Integer, ByVal t As Integer, _
ByVal r As Integer, ByVal b As Integer)
Left = l
Top = t
Right = r
Bottom = b
End Sub
Public Left As Integer
Public Top As Integer
Public Right As Integer
Public Bottom As Integer
End Structure
Public Structure POINT
Public Sub New(ByVal iX As Integer, ByVal iY As Integer)
X = iX
Y = iY
End Sub
Public X, Y As Integer
End Structure
End Structure

Public Shared Function GetPlacement( _
ByVal hwnd As IntPtr) As WINDOWPLACEMENT
Dim wp As WINDOWPLACEMENT
GetWindowPlacement(hwnd, wp)
Return wp
End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top