Which running apps are minimized

I need to detect the windows state for each running app. eg. Normal, minimized, maximized.
aulrichAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Erick37Commented:
This link contains source code to enumerate all top-level windows in the system:

http://www.thescarms.com/vbasic/EnumWindows.htm

Use the GetWindowPlacement API to retrieve the current position and state of any window identified by its hWnd:

Dim wp As WINDOWPLACEMENT
Dim rVal As Long
wp.Length = LenB(wp)
rVal = GetWindowPlacement(hWnd, wp)
Debug.Print wp.showCmd
Select Case wp.showCmd
    Case 1 'Normal
        Debug.Print "Normal"
    Case 2 'Minimized
        Debug.Print "Minimized"
    Case 3 'Maximized
        Debug.Print "Maximized"
End Select
0
aulrichAuthor Commented:
What reference does WINDOWPLACEMENT require.
0
Erick37Commented:
'Local types and declares for GetWindowPlacement
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

'Get the state of this form
'Pass the hWnd of any other window to get its info
Private Sub Form_Resize()
    Dim wp As WINDOWPLACEMENT
    Dim rVal As Long
    wp.Length = LenB(wp)
    rVal = GetWindowPlacement(hwnd, wp)
    Debug.Print wp.showCmd
    Select Case wp.showCmd
        Case 1 'Normal
            Debug.Print "Normal"
        Case 2 'Minimized
            Debug.Print "Minimized"
        Case 3 'Maximized
            Debug.Print "Maximized"
    End Select
End Sub
0
The Ultimate Tool Kit for Technolgy Solution Provi

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy for valuable how-to assets including sample agreements, checklists, flowcharts, and more!

aulrichAuthor Commented:
Is there any way to isoloate the apps shown on the task bar from ALL the running windows; I just need to know which running apps I have loaded.

I've increased the value by 50pts.

Thanks
aulrich
0
aulrichAuthor Commented:
Erick37 I suppose your answer was a little helpful; even though I am still puzzling over how to isoloate the apps within the toolbar.

If you propose another answer I'll award you with the original 100pts.

Thanks
aulrich
0
Erick37Commented:
This program attempts to isolate taskbar applications:

http://www.thescarms.com/VBasic/AltTab.htm
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
aulrichAuthor Commented:
Right on!!! Thanks a ton Eric37.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.