Code Snippets

  

VB.NET Source Code


Welcome to Dream.In.Code
Getting VB.NET Help is Easy!

Join 118,859 VB.NET Programmers for FREE! Ask your question and get quick answers from experts. There are 1,671 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!




Show the desktop (minimize all windows)

Shows the computers desktop

Submitted By: jacobjordan
Actions:
Rating:
Views: 255

Language: VB.NET

Last Modified: July 5, 2008
Instructions: Use the ShowDesktop() method

Snippet


  1.     ''' <summary>
  2.     ''' Shows the desktop by minimizing all windows
  3.     ''' </summary>
  4.     Public Sub ShowDesktop()
  5.         keybd_event(VK_LWIN, 0, 0, 0)
  6.         keybd_event(77, 0, 0, 0)
  7.         keybd_event(VK_LWIN, 0, KEYEVENTF_KEYUP, 0)
  8.     End Sub
  9.  
  10.     Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, _
  11.     ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
  12.     Private Const KEYEVENTF_KEYUP = &H2
  13.     Private Const VK_LWIN = &H5B

Copy & Paste


Comments


There are currently no comments for this snippet. Be the first to comment!

Add comment


You must be registered and logged on to </dream.in.code> to leave comments.





Live VB.NET Help!

VB.NET Tutorials

Reference Sheets

VB.NET Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month