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)

 
Leave Comment:
Name:
Email: (not shown)
Message: (Required)
Math Question: 59 + 6 = ? followed by the letter: N 



About Me
More Blogs
Main Site
Posts: (All)
2024 ( 3 )
2023 ( 9 )
2022 ( 4 )
2021 ( 2 )
2020 ( 4 )
2019 ( 5 )
2018 ( 6 )
2017 ( 6 )
2016 ( 22 )
2015 ( 15 )
2014 ( 25 )
2013 ( 4 )
2012 ( 10 )
2011 (7)
     C# Process Injection
     CAPTCHA Bots
     C# PE Offset Calculator
     VB6 Async Download
     Show Desktop
     coding philosophy
     Code release
2010 ( 11 )
2009 ( 3 )