|
-
Sep 20th, 2002, 11:26 AM
#1
Thread Starter
Hyperactive Member
show desktop or minimize all....
anyone know how to show the destop.. or minimize all windows? thru code? this on an XP machine....
-
Sep 20th, 2002, 11:29 AM
#2
-= B u g S l a y e r =-
Isn't there a key combo for minimizing all windows? Just find that combo, and use sendkeys... might work.
-
Sep 20th, 2002, 11:30 AM
#3
Thread Starter
Hyperactive Member
that is a great idea!.... thanks....
-
Sep 20th, 2002, 11:30 AM
#4
-= B u g S l a y e r =-
errhmmm... forget what I said... the combination is Windows function key (the flag key) and M
don't think you can sendkey that special win key...
Last edited by peet; Sep 20th, 2002 at 11:39 AM.
-
Sep 20th, 2002, 11:32 AM
#5
Need-a-life Member
API way....
VB Code:
Option Explicit
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
Public Sub MinimizeAll()
Dim lngHwnd As Long
lngHwnd = FindWindow("Shell_TrayWnd", vbNullString)
Call PostMessage(lngHwnd, WM_COMMAND, MIN_ALL, 0&)
End Sub
Public Sub RestoreAll()
Dim lngHwnd As Long
lngHwnd = FindWindow("Shell_TrayWnd", vbNullString)
Call PostMessage(lngHwnd, WM_COMMAND, MIN_ALL_UNDO, 0&)
End Sub
Private Sub cmdMinimize_Click()
MinimizeAll
End Sub
Private Sub cmdRestore_Click()
RestoreAll
End Sub
Emiliano F. Martín
If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
Encourage the person who helped you to keep doing it, and give him the points he deserves.
MP3 Organizer: Freeware to logically organize all your MP3s.
-
Sep 20th, 2002, 11:36 AM
#6
Thread Starter
Hyperactive Member
thanks for the api Mc Brain works great!
-
Sep 20th, 2002, 11:43 AM
#7
Need-a-life Member
Originally posted by Filter300
thanks for the api Mc Brain works great!
welcome.
Emiliano F. Martín
If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
Encourage the person who helped you to keep doing it, and give him the points he deserves.
MP3 Organizer: Freeware to logically organize all your MP3s.
-
Sep 20th, 2002, 12:12 PM
#8
-= B u g S l a y e r =-
McBrain has already given you a good solution, but I feel bad about
my stupid suggestion , so here goes... almost what I
suggested 
VB Code:
Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Const KEYEVENTF_KEYUP = &H2
Const VK_LWIN = &H5B
Private Sub Command1_Click()
Call keybd_event(VK_LWIN, 0, 0, 0)
Call keybd_event(77, 0, 0, 0)
Call keybd_event(VK_LWIN, 0, KEYEVENTF_KEYUP, 0)
End Sub
-
Sep 20th, 2002, 12:22 PM
#9
Need-a-life Member
Originally posted by peet
McBrain has already given you a good solution, but I feel bad about
my stupid suggestion , so here goes... almost what I
suggested 
VB Code:
Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Const KEYEVENTF_KEYUP = &H2
Const VK_LWIN = &H5B
Private Sub Command1_Click()
Call keybd_event(VK_LWIN, 0, 0, 0)
Call keybd_event(77, 0, 0, 0)
Call keybd_event(VK_LWIN, 0, KEYEVENTF_KEYUP, 0)
End Sub
Don't feel bad... we still like you
Emiliano F. Martín
If a post has helped you then please Rate it! (and give the user points he/she deserves by clicking on the image).
Encourage the person who helped you to keep doing it, and give him the points he deserves.
MP3 Organizer: Freeware to logically organize all your MP3s.
-
Sep 20th, 2002, 12:29 PM
#10
-= B u g S l a y e r =-
good
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|