Link to home
Create AccountLog in
Avatar of Barry Lysy
Barry LysyFlag for Canada

asked on

How to maximize a window that is in IsIconic state

Using V6, I am trying to maximize a window that is in Isiconic state.  The following code is what I'm trying to use. Any suggestions would be very appreciative.

thanks
barrywl

Public Declare Function ShowWindow& Lib "user32" (hwnd As Long, ByVal nCmdShow As Long)

Public Function SetWindowState(hwnd As Long) As Integer
Dim x As Integer

SW_HIDE = 0
SW_MAXIMIZE = 3
SW_MINIMIZE = 6
SW_RESTORE = 9
SW_SHOW = 5
SW_SHOWMAXIMIZED = 3
SW_SHOWMINIMIZED = 2
SW_SHOWMINNOACTIVE = 7
SW_SHOWNA = 8
SW_SHOWNOACTIVATE = 4
SW_SHOWNORMAL = 1

    If IsIconic(hwnd) Then
       
       x = ShowWindow(hwnd, SW_RESTORE)
       x = ShowWindow(hwnd, SW_SHOWNORMAL)
       x = SetForegroundWindow(hwnd)
       rem Debug.Print x
       
    End If

   
End Function
ASKER CERTIFIED SOLUTION
Avatar of Micheal Autry
Micheal Autry

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of Martin Liss
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.