Avatar of Barry Lysy
Barry Lysy
Flag 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
Visual Basic Classic

Avatar of undefined
Last Comment
Martin Liss

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Micheal Autry

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Martin Liss

This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23