Click here to Skip to main content
15,887,746 members
Articles / Programming Languages / C++
Article

Simulate Alt+Control+delete

Rate me:
Please Sign up or sign in to vote.
2.43/5 (14 votes)
20 Jan 2003 191K   3.8K   28   51
How to Simulate Alt+Control+delete

Introduction

Simulate alt control delete command in windows nt, 2k, xp.
hwinsta = OpenWindowStation("winsta0", FALSE,
                          WINSTA_ACCESSCLIPBOARD   |
                          WINSTA_ACCESSGLOBALATOMS |
                          WINSTA_CREATEDESKTOP     |
                          WINSTA_ENUMDESKTOPS      |
                          WINSTA_ENUMERATE         |
                          WINSTA_EXITWINDOWS       |
                          WINSTA_READATTRIBUTES    |
                          WINSTA_READSCREEN        |
                          WINSTA_WRITEATTRIBUTES);
if (hwinsta == NULL)
    return FALSE;
//
// Set the windowstation to be winsta0
//
if (!SetProcessWindowStation(hwinsta))
 return FALSE;

//
// Get the default desktop on winsta0
//
hdesk = OpenDesktop("Winlogon", 0, FALSE,
                    DESKTOP_CREATEMENU |
          DESKTOP_CREATEWINDOW |
                    DESKTOP_ENUMERATE    |
                    DESKTOP_HOOKCONTROL  |
                    DESKTOP_JOURNALPLAYBACK |
                    DESKTOP_JOURNALRECORD |
                    DESKTOP_READOBJECTS |
                    DESKTOP_SWITCHDESKTOP |
                    DESKTOP_WRITEOBJECTS);
if (hdesk == NULL)
   return FALSE;

//
// Set the desktop to be "default"
//
if (!SetThreadDesktop(hdesk))
   return FALSE;
PostMessage(HWND_BROADCAST,WM_HOTKEY,0,
    MAKELPARAM(MOD_ALT|MOD_CONTROL,VK_DELETE));

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralRe: Smashing.... Pin
Ellery_Familia21-Jan-03 16:06
Ellery_Familia21-Jan-03 16:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.