Topics

Minimize all windows through keybd_event in VB Net

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
  • Share/Bookmark

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>