Advertisement
kshadow22

Minimize All Windows Visual Basic

Jun 30th, 2015
361
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Minimize All Windows
  2.  
  3. 'Add a module to your project (In the menu choose Project -> Add Module, Then click Open)
  4. 'Add 1 Command Button to your form.
  5. 'Insert this code to the module :
  6.  
  7. Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, _
  8. ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
  9. Public Const VK_LWIN = &H5B
  10. Public Const KEYEVENTF_KEYUP = &H2
  11.  
  12. 'Insert this code to your form:
  13.  
  14. Private Sub Command1_Click()
  15. Call keybd_event(VK_LWIN, 0, 0, 0)
  16. Call keybd_event(&H4D, 0, 0, 0)
  17. Call keybd_event(VK_LWIN, 0, KEYEVENTF_KEYUP, 0)
  18. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement