Come back to home page

Minimize all Windows (System, VB.NET)

This code shows how can we minimize all open windows. We have used keybd_event API for this...

... The Code ...

Public Declare Sub keybd_event Lib "user32.dll" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Int32, ByVal dwExtraInfo As Int32)

Public Sub MinimizeAll()
    keybd_event(&H5B, 0, 0, 0)
    keybd_event(&H4D, 0, 0, 0)
    keybd_event(&H5B, 0, &H2, 0)
End Sub

The first line declares the API. Next piece of code is a method which we can call anywhere to minimize all windows...

Pretty simple!!