Click here to Skip to main content
11,410,118 members (61,518 online)
Click here to Skip to main content

Simulate Alt+Control+delete

, 20 Jan 2003
Rate this:
Please Sign up or sign in to vote.
How to Simulate Alt+Control+delete
<!-- Download Links --> <!-- Add the rest of your HTML here -->

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

Share

About the Author

Sukanta Kumar Dash
Web Developer
United States United States
No Biography provided

Comments and Discussions

 
QuestionDoes not work on Windows 7 Pinmemberbabzog13-Aug-14 5:17 
GeneralIt does not work on Vista PinmemberRonakkumar Patel18-Dec-07 14:27 
GeneralRe: It does not work on Vista Pinmemberppckiller10-Jan-08 4:50 
AnswerRe: It does not work on Vista PinmemberDecipator29-Jun-09 4:15 
GeneralRe: It does not work on Vista Pinmemberjapp2715-Sep-10 3:43 
QuestionIt is not working on WinXP SP2 Pinmemberkoldovsky21-Feb-07 9:24 
AnswerRe: It is not working on WinXP SP2 Pinmembermd.ikra29-Jul-07 1:54 
QuestionExcellent for Admin with 300 computers to ctrl alt del at the same time ! Pinmembermd.ikra28-Jan-07 20:51 
AnswerRe: Excellent for Admin with 300 computers to ctrl alt del at the same time ! PinmemberMDKing8311-Jul-08 5:56 
QuestionSend Mouse Clicks & Other KeyStrokes PinmemberDeepak Sakpal25-Aug-06 8:30 
AnswerRe: Send Mouse Clicks & Other KeyStrokes PinmemberMDKing8311-Jul-08 5:57 
Generalit can not work ! Pinmembercharlie790822-Aug-06 3:01 
Generalit wasn't work Pinmemberbrs_jom19-Jan-06 8:51 
GeneralRe: it wasn't work Pinmemberantifumo2-Feb-06 9:34 
GeneralRe: it wasn't work Pinmembermidea097819-Aug-06 6:02 
GeneralI got Access Denied when call OpenDesktop PinmemberYulaw21-Aug-05 21:32 
GeneralJust DOESN'T work Pinmembersk196515-Feb-05 1:53 
GeneralNext step to unlock screen Pinmemberanthonyx2618-Nov-04 5:22 
GeneralSimulate Alt+Control+delete in Activex Pinmembersankul99911-Oct-04 22:05 
Questionaltctrldel.exe can't use in winxp??? Pinmembernetsh25-Jul-04 15:59 
QuestionCan't run in win200, why? Pinmemberyinju14-Apr-04 8:29 
AnswerRe: Can't run in win200, why? PinmemberDavidR_r2-Jul-04 10:23 
GeneralSetThreadDesktop Pinmemberpaulashford26-Feb-04 0:56 
GeneralRe: SetThreadDesktop Pinmemberplanets23-Mar-04 7:17 
Questionwhat about to deactivate these keys? PinsussDr.Lutfi16-Aug-03 4:21 

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

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

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.150414.5 | Last Updated 21 Jan 2003
Article Copyright 2003 by Sukanta Kumar Dash
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid