There may be other ways, but this should work:

VB Code:
  1. Private Type POINTAPI
  2.     x As Long
  3.     y As Long
  4. End Type
  5.  
  6. Private Type RECT
  7.     Left As Long
  8.     Top As Long
  9.     Right As Long
  10.     Bottom As Long
  11. End Type
  12.  
  13. Private Type WINDOWPLACEMENT
  14.     Length As Long
  15.     flags As Long
  16.     showCmd As Long
  17.     ptMinPosition As POINTAPI
  18.     ptMaxPosition As POINTAPI
  19.     rcNormalPosition As RECT
  20. End Type
  21.  
  22. Private Declare Function GetWindowPlacement Lib "user32" ( _
  23.                 ByVal hWnd As Long, _
  24.                 lpwndpl As WINDOWPLACEMENT) As Long
  25.  
  26. Private Const SW_NORMAL As Long = 1
  27. Private Const SW_MINIMIZE As Long = 6
  28. Private Const SW_MAXIMIZE As Long = 3
  29.  
  30. Private Function GetWindowState(ByVal lhWnd As Long) As FormWindowStateConstants
  31.     Dim winPLACE As WINDOWPLACEMENT
  32.     winPLACE.Length = Len(winPLACE)
  33.     GetWindowPlacement lhWnd, winPLACE
  34.    
  35.     Select Case winPLACE.showCmd
  36.         Case SW_MINIMIZE
  37.             GetWindowState = vbMinimized
  38.         Case SW_MAXIMIZE
  39.             GetWindowState = vbMaximized
  40.     End Select
  41. End Function