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
:) :) :( :( :p :p
Printable View
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
:) :) :( :( :p :p
Try this:
VB Code:
Private Declare Function FindWindow Lib "user32" _ Alias "FindWindowA" (ByVal lpClassName As String, ByVal _ lpWindowName As String) As Long Private Declare Function PostMessage Lib "user32" _ Alias "PostMessageA" (ByVal hwnd As Long, ByVal wMsg As _ Long, ByVal wParam As Long, ByVal lParam As Long) As Long Private Const WM_COMMAND As Long = &H111 Private Const MIN_ALL As Long = 419 Private Const MIN_ALL_UNDO As Long = 416 Private Sub MinimizeAll() Dim lngHwnd As Long lngHwnd = FindWindow("Shell_TrayWnd", vbNullString) Call PostMessage(lngHwnd, WM_COMMAND, MIN_ALL, 0&) End Sub Private Sub RestoreAll() Dim lngHwnd As Long lngHwnd = FindWindow("Shell_TrayWnd", vbNullString) Call PostMessage(lngHwnd, WM_COMMAND, MIN_ALL_UNDO, 0&) End Sub
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 ;)