VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Minmize and Restore all running windows

by Matthew Gates (16 Submissions)
Category: Windows System Services
Compatability: Visual Basic 4.0 (32-bit)
Difficulty: Unknown Difficulty
Originally Published: Fri 25th February 2000
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Minmize and Restore all running windows

API Declarations


Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long

Rate Minmize and Restore all running windows



'Minimize all windows
On Error Resume Next
    Dim lngHwnd As Long
       lngHwnd = findwindow("Shell_TrayWnd", vbNullString)
    Call PostMessage(lngHwnd, WM_COMMAND, MIN_ALL, 0&)
  
End Sub

Public Sub RestoreAll()
'Restore All Windows to their original position
    Dim lngHwnd As Long
    lngHwnd = findwindow("Shell_TrayWnd", vbNullString)
    Call PostMessage(lngHwnd, WM_COMMAND, MIN_ALL_UNDO, 0&)
End Sub


Download this snippet    Add to My Saved Code

Minmize and Restore all running windows Comments

No comments have been posted about Minmize and Restore all running windows. Why not be the first to post a comment about Minmize and Restore all running windows.

Post your comment

Subject:
Message:
0/1000 characters