Which running apps are minimized

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

[Webinar] Streamline your web hosting managementRegister Today

x
 
Erick37Connect With a Mentor Commented:
This program attempts to isolate taskbar applications:

http://www.thescarms.com/VBasic/AltTab.htm
0
 
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
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
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
 
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
 
aulrichAuthor Commented:
Right on!!! Thanks a ton Eric37.
0
All Courses

From novice to tech pro — start learning today.