This code example will minimize all your open windows simulating the "Show Desktop" quick launch button shortcut next to the Start windows menu button.

VB Code:
  1. Option Explicit
  2. 'Copyright © 2005 by RobDog888 (VB/Office Guru™). All Rights reserved.
  3. '
  4. 'Distribution: You can freely use this code in your own
  5. '              applications provided that this copyright
  6. '              is left unchanged, but you may not reproduce
  7. '              or publish this code on any web site, online
  8. '              service, or distribute as source on any
  9. '              media without express permission.
  10. '
  11. 'Add a command button to your form and copy/paste this code
  12. Private Declare Sub keybd_event Lib "user32.dll" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, _
  13. ByVal dwExtraInfo As Long)
  14.  
  15. Const VK_STARTKEY = &H5B
  16. Const VK_M = 77
  17. Const KEYEVENTF_KEYUP = &H2
  18.  
  19. Private Sub Command1_Click()
  20.     'WinKey down
  21.     keybd_event VK_STARTKEY, 0, 0, 0
  22.     'M key down
  23.     keybd_event VK_M, 0, 0, 0
  24.     'M key up
  25.     keybd_event VK_M, 0, KEYEVENTF_KEYUP, 0
  26.     'WinKey up
  27.     keybd_event VK_STARTKEY, 0, KEYEVENTF_KEYUP, 0
  28. End Sub