Show Desktop Author: Dave Date: 02.07.11 - 9:38am
This is an easy to programatically run the ShowDesktop (ie ToggleDesktop) command without having to use the Shell32 ActiveX control.
I had to do it this way because i needed to ultimately code it in asm for a shellcode demo.
Private Const KEYEVENTF_EXTENDEDKEY As Long = &H1
Private Const KEYEVENTF_KEYUP As Long = &H2
Private Const VK_LWIN As Byte = &H5B
Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, _
ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Sub form_load()
Simulate key press
Call keybd_event(VK_LWIN, 0, KEYEVENTF_EXTENDEDKEY, 0)
Call keybd_event(Asc("D"), 0, 0, 0)
Simulate key release
Call keybd_event(VK_LWIN, 0, KEYEVENTF_EXTENDEDKEY Or KEYEVENTF_KEYUP, 0)
Call keybd_event(Asc("D"), 0, KEYEVENTF_KEYUP, 0)
End Sub
Comments: (0)
|