Sure thing.
Code:
Private Type POINTAPI
x As Long
y As Long
End Type
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Type WINDOWPLACEMENT
Length As Long
flags As Long
showCmd As Long
ptMinPosition As POINTAPI
ptMaxPosition As POINTAPI
rcNormalPosition As RECT
End Type
Private Declare Function GetWindowPlacement Lib "user32" (ByVal hwnd As Long, lpwndpl As WINDOWPLACEMENT) As Long
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Const SW_SHOWMAXIMIZED = 3
Private Const SW_SHOWMINIMIZED = 2
Private Const SW_SHOWNORMAL = 1
Private Sub Command1_Click()
Dim lHwnd As Long
Dim WinPlace As WINDOWPLACEMENT
lHwnd = FindWindowEx(0, 0, vbNullString, "CaptionNameGoesHere")
Call GetWindowPlacement(lHwnd, WinPlace)
Select Case WinPlace.showCmd
Case SW_SHOWNORMAL
MsgBox "Form is shown NORMAL"
Case SW_SHOWMAXIMIZED
MsgBox "Form is MAXIMIZED"
Case SW_SHOWMINIMIZED
MsgBox "Form is MINIMIZED"
End Select
End Sub
------------------
Serge
Senior Programmer Analyst
[email protected]
[email protected]
ICQ#: 51055819