This code shows how can we minimize all open windows using keybd_event API.
The following statement declares the API:
Public Declare Sub keybd_event Lib "user32.dll" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Int32, ByVal dwExtraInfo As Int32)
After declaring the API as show in the above code, you may go ahead and use the API as in the following example. I have created a method to Minimize All windows.
Public Sub MinimizeAll()
keybd_event(&H5B, 0, 0, 0)
keybd_event(&H4D, 0, 0, 0)
keybd_event(&H5B, 0, &H2, 0)
End Sub


Comments