Results 1 to 3 of 3

Thread: Minimised application on Desktop

  1. #1
    kais
    Guest

    Minimised application on Desktop

    hi,
    I am creating an EXE, when the user click on the exe i want all the application on the desktop to minimised. I want to do this at shot using single API.

    If any one have an idea pls let me know.

    Thanks
    Kais


  2. #2
    Matthew Gates
    Guest
    Try this:


    VB Code:
    1. Private Declare Function FindWindow Lib "user32" _
    2. Alias "FindWindowA" (ByVal lpClassName As String, ByVal _
    3. lpWindowName As String) As Long
    4.  
    5. Private Declare Function PostMessage Lib "user32" _
    6. Alias "PostMessageA" (ByVal hwnd As Long, ByVal wMsg As _
    7. Long, ByVal wParam As Long, ByVal lParam As Long) As Long
    8.  
    9. Private Const WM_COMMAND As Long = &H111
    10. Private Const MIN_ALL As Long = 419
    11. Private Const MIN_ALL_UNDO As Long = 416
    12.  
    13.  
    14. Private Sub MinimizeAll()
    15.  
    16.     Dim lngHwnd As Long
    17.     lngHwnd = FindWindow("Shell_TrayWnd", vbNullString)
    18.     Call PostMessage(lngHwnd, WM_COMMAND, MIN_ALL, 0&)
    19.  
    20. End Sub
    21.  
    22. Private Sub RestoreAll()
    23.  
    24.     Dim lngHwnd As Long
    25.     lngHwnd = FindWindow("Shell_TrayWnd", vbNullString)
    26.     Call PostMessage(lngHwnd, WM_COMMAND, MIN_ALL_UNDO, 0&)
    27.  
    28. End Sub

  3. #3
    kais
    Guest

    it really worked out

    Thanks buddy it really worked out. I just wanted the minimised code and u have give restore code also which is really great. Once again thanks.

    Kais

    Knowledge increasing with sharing with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width