Click here to Skip to main content
13,142,065 members (62,218 online)
Click here to Skip to main content
Add your own
alternative version


27 bookmarked
Posted 20 Jan 2003

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 -->


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        |
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_ENUMERATE    |
                    DESKTOP_HOOKCONTROL  |
                    DESKTOP_JOURNALPLAYBACK |
                    DESKTOP_JOURNALRECORD |
                    DESKTOP_READOBJECTS |
                    DESKTOP_SWITCHDESKTOP |
if (hdesk == NULL)
   return FALSE;

// Set the desktop to be "default"
if (!SetThreadDesktop(hdesk))
   return FALSE;


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


About the Author

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

You may also be interested in...

Comments and Discussions

QuestionDoes not work on Windows 7 Pin
babzog13-Aug-14 4:17
memberbabzog13-Aug-14 4:17 
GeneralIt does not work on Vista Pin
Ronakkumar Patel18-Dec-07 13:27
memberRonakkumar Patel18-Dec-07 13:27 
GeneralRe: It does not work on Vista Pin
ppckiller10-Jan-08 3:50
memberppckiller10-Jan-08 3:50 
AnswerRe: It does not work on Vista Pin
Decipator29-Jun-09 3:15
memberDecipator29-Jun-09 3:15 
GeneralRe: It does not work on Vista Pin
japp2715-Sep-10 2:43
memberjapp2715-Sep-10 2:43 
QuestionIt is not working on WinXP SP2 Pin
koldovsky21-Feb-07 8:24
memberkoldovsky21-Feb-07 8:24 
AnswerRe: It is not working on WinXP SP2 Pin
md.ikra29-Jul-07 0:54
membermd.ikra29-Jul-07 0:54 
QuestionExcellent for Admin with 300 computers to ctrl alt del at the same time ! Pin
md.ikra28-Jan-07 19:51
membermd.ikra28-Jan-07 19:51 
AnswerRe: Excellent for Admin with 300 computers to ctrl alt del at the same time ! Pin
MDKing8311-Jul-08 4:56
memberMDKing8311-Jul-08 4:56 
QuestionSend Mouse Clicks & Other KeyStrokes Pin
Deepak Sakpal25-Aug-06 7:30
memberDeepak Sakpal25-Aug-06 7:30 
AnswerRe: Send Mouse Clicks & Other KeyStrokes Pin
MDKing8311-Jul-08 4:57
memberMDKing8311-Jul-08 4:57 
Generalit can not work ! Pin
charlie790822-Aug-06 2:01
membercharlie790822-Aug-06 2:01 
Generalit wasn't work Pin
brs_jom19-Jan-06 7:51
memberbrs_jom19-Jan-06 7:51 
GeneralRe: it wasn't work Pin
antifumo2-Feb-06 8:34
memberantifumo2-Feb-06 8:34 
GeneralRe: it wasn't work Pin
midea097819-Aug-06 5:02
membermidea097819-Aug-06 5:02 
GeneralI got Access Denied when call OpenDesktop Pin
Yulaw21-Aug-05 20:32
memberYulaw21-Aug-05 20:32 
GeneralJust DOESN'T work Pin
sk196515-Feb-05 0:53
membersk196515-Feb-05 0:53 
GeneralNext step to unlock screen Pin
anthonyx2618-Nov-04 4:22
memberanthonyx2618-Nov-04 4:22 
GeneralSimulate Alt+Control+delete in Activex Pin
sankul99911-Oct-04 21:05
membersankul99911-Oct-04 21:05 
Questionaltctrldel.exe can't use in winxp??? Pin
netsh25-Jul-04 14:59
membernetsh25-Jul-04 14:59 
QuestionCan't run in win200, why? Pin
yinju14-Apr-04 7:29
memberyinju14-Apr-04 7:29 
AnswerRe: Can't run in win200, why? Pin
DavidR_r2-Jul-04 9:23
memberDavidR_r2-Jul-04 9:23 
GeneralSetThreadDesktop Pin
paulashford25-Feb-04 23:56
memberpaulashford25-Feb-04 23:56 
GeneralRe: SetThreadDesktop Pin
planets23-Mar-04 6:17
memberplanets23-Mar-04 6:17 
Questionwhat about to deactivate these keys? Pin
Dr.Lutfi16-Aug-03 3:21
sussDr.Lutfi16-Aug-03 3:21 
QuestionAnd what about simulating ALT + TAB ? Pin
JL00218-Jul-03 7:05
memberJL00218-Jul-03 7:05 
AnswerRe: And what about simulating ALT + TAB ? Pin
Sukanta Kumar Dash18-Jul-03 19:23
memberSukanta Kumar Dash18-Jul-03 19:23 
QuestionWhy not use ExitWindowsEx()? Pin
dwccgc23-Jan-03 3:27
memberdwccgc23-Jan-03 3:27 
AnswerRe: Why not use ExitWindowsEx()? Pin
Igor A16-May-05 23:30
memberIgor A16-May-05 23:30 
GeneralNo simulation occurred Pin
Golden Lee22-Jan-03 22:50
memberGolden Lee22-Jan-03 22:50 
GeneralRe: No simulation occurred Pin
Sukanta Kumar Dash26-Jan-03 22:51
memberSukanta Kumar Dash26-Jan-03 22:51 
GeneralRe: No simulation occurred Pin
M A V29-Jan-03 12:04
memberM A V29-Jan-03 12:04 
GeneralGood job!!! Pin
jedyking22-Jan-03 6:40
memberjedyking22-Jan-03 6:40 
GeneralOpenDesktop("Winlogon"... failed Pin
Jon22-Jan-03 3:11
memberJon22-Jan-03 3:11 
GeneralNon-code way could be done in a shortcut etc.. Pin
RobJones21-Jan-03 7:29
memberRobJones21-Jan-03 7:29 
GeneralRe: Non-code way could be done in a shortcut etc.. Pin
Sukanta Kumar Dash21-Jan-03 18:01
memberSukanta Kumar Dash21-Jan-03 18:01 
GeneralRe: Non-code way could be done in a shortcut etc.. Pin
bfadi4-Sep-03 6:44
memberbfadi4-Sep-03 6:44 
GeneralRe: Non-code way could be done in a shortcut etc.. Pin
RobJones4-Sep-03 14:29
memberRobJones4-Sep-03 14:29 
GeneralRe: Non-code way could be done in a shortcut etc.. Pin
bfadi5-Sep-03 0:55
memberbfadi5-Sep-03 0:55 
GeneralGreat!! Pin
_Magnus_21-Jan-03 5:16
member_Magnus_21-Jan-03 5:16 
GeneralComplete information Pin
Gabriel 221-Jan-03 2:08
memberGabriel 221-Jan-03 2:08 
GeneralVery useful! Pin
Daniel Turini21-Jan-03 0:27
memberDaniel Turini21-Jan-03 0:27 
GeneralRe: Very useful! Pin
Anonymous21-Jan-03 0:41
sussAnonymous21-Jan-03 0:41 
GeneralRe: Very useful! Pin
Daniel Turini21-Jan-03 0:58
memberDaniel Turini21-Jan-03 0:58 
GeneralRe: Very useful! Pin
Garth J Lancaster21-Jan-03 10:14
memberGarth J Lancaster21-Jan-03 10:14 
GeneralRe: Very useful! Pin
Igor A17-May-05 0:00
memberIgor A17-May-05 0:00 
GeneralSmashing.... Pin
Chopper20-Jan-03 23:40
memberChopper20-Jan-03 23:40 
GeneralRe: Smashing.... Pin
Todd Smith21-Jan-03 3:30
memberTodd Smith21-Jan-03 3:30 
GeneralRe: Smashing.... Pin
Chopper21-Jan-03 5:59
memberChopper21-Jan-03 5:59 
GeneralRe: Smashing.... Pin
Ellery21-Jan-03 16:06
memberEllery21-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.

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