Click here to Skip to main content
12,953,652 members (51,114 online)
Click here to Skip to main content
Add your own
alternative version


31 bookmarked
Posted 19 Oct 2004

Shutdown - an alternative to Windows Shutdown dialog

, 25 Oct 2006
Rate this:
Please Sign up or sign in to vote.
It is an alternative to windows XP shutdown dialog
Shutdown Dialog.

Shutdown dialog with extra options.


  1. Description. [#]
  2. Introduction. [#]
  3. Features. [#]
  4. Programming. [#]
  5. Usage/Help. [#]
  6. Disclaimer. [#]
[ ^ ]


It is an alternative to windows XP shutdown dialog. It has more features than the traditional shutdown dialog, like process enumeration, auto-run, and registered services. It also makes use of regions to make custom shapes. It can be used in Windows 95, 98, NT4, 2000, ME for a XP style shutdown dialog.

[ ^ ]


The shutdown program is a small program that I coded a few years back while learning C++. I had coded it using Dev C++ using pure C++ and win32 apis. It is a small program which mimics the windows shutdown dialog. It uses GDI to make custom shapes and custom buttons.

[ ^ ]


The main features of shutdown are

  1. It can shutdown any PC running Windows operating system.
  2. It suitably uses the required permission to shutdown a pc running on windows NT, actually I have copied the code from a MSDN example.
  3. Option to power off and manual shutdown.
  4. Custom shape using GDI.
  5. Running process enumeration.
  6. Auto run list.
  7. Registered services list.
  8. Class Probe (non-functional)
  9. Window animations (for winver > win2000)

[ ^ ]


The programming for the shutdown is quite straight forward. It is programmed using pure C++. Some of the details if any one wants to know about,

The Shape:

It is done by applying regions to the dialog. The program mainly uses 3 regions. First the normal state, Second region for the expanded state, and the third region for catching the mouse click. I have carefully created the regions using various combinations of round rectangles by trial and error method. Once the region is applied the shape of the dialog outside the region becomes transparent. The portion of dialog out side the region also becomes transparent to the mouse events.

For the drop down button, I have tracked the hit–test for the third region.


For machines running on NT, shutdown API ExitWindowsEx () requires privileges. The required privilege is accessed before the shutdown function call. After the call to the ExitWindowsEx () API it returns immediately thus providing time for the program to exit. But before exiting the program resets the privilege.

Process Enumeration:

It uses EnumProcessModules() and other info please look into the code.

The Class Probe:

Please refer to my working class probe article at

[ ^ ]

Usage / Help

Launch the program. Check the power off if you want to power off the machine. Note it doesn’t have any effect while logging off or restarting the Computer. Click the shutdown to shutdown Windows and if your computer supports automatic power off it will power-off the computer.

[ ^ ]


This code and the executable don’t claim to be perfect and error free. It also doesn’t come with any warranties and even any implied warranty of being fit for any proposes what so ever which includes "merchantability".

If there was any mistake in the writing, it is regretted.

I am currently looking for some persons to join in my open source project. If any one wants to contribute he/she is most welcome. My project is not personal and every one is invited... I am developing a multiplatform IDE for C/C++ with its own class lib, APIs and classes using pure C/C++.

Please visit: for details


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

Web Developer
United States United States
No Biography provided

You may also be interested in...

Comments and Discussions

QuestionC:\Programs\Dev-Cpp\projects\Shutdown\HOOKDLL\dll.h not found Pin
Johannes Weidenauer6-Mar-13 2:10
memberJohannes Weidenauer6-Mar-13 2:10 
QuestionGreat need help.. Pin
Manni Singh28-Feb-07 19:43
memberManni Singh28-Feb-07 19:43 
AnswerRe: Great need help.. Pin
sanjit_rath25-Sep-07 8:08
membersanjit_rath25-Sep-07 8:08 
Generalgaaaaaaah Pin
jswoofer20-Oct-06 14:59
memberjswoofer20-Oct-06 14:59 
GeneralRe: gaaaaaaah Pin
sanjit_rath20-Oct-06 15:02
membersanjit_rath20-Oct-06 15:02 
GeneralRe: gaaaaaaah Pin
sanjit_rath20-Oct-06 15:06
membersanjit_rath20-Oct-06 15:06 
GeneralRe: gaaaaaaah Pin
jswoofer20-Oct-06 15:32
memberjswoofer20-Oct-06 15:32 
GeneralRe: gaaaaaaah Pin
sanjit_rath20-Oct-06 17:22
membersanjit_rath20-Oct-06 17:22 
GeneralRe: gaaaaaaah Pin
sanjit_rath25-Oct-06 10:51
membersanjit_rath25-Oct-06 10:51 
Generalcompiling problems Pin
thomas montague26-Jan-05 7:10
memberthomas montague26-Jan-05 7:10 
GeneralRe: compiling problems Pin
^^o000o^^26-Jan-05 22:05
member^^o000o^^26-Jan-05 22:05 
Generalnew Devils ^^oo00oo^^ Pin
<font color=17-Nov-04 14:55
suss17-Nov-04 14:55 
Generalhello Pin
yaoyu21-Oct-04 19:50
memberyaoyu21-Oct-04 19:50 
GeneralRe: hello Pin
Sanjit Rath27-Oct-04 7:51
memberSanjit Rath27-Oct-04 7:51 
GeneralRe: hello Pin
yaoyu31-Oct-04 6:27
memberyaoyu31-Oct-04 6:27 
GeneralRe: hello Pin
ThatsAlok26-Oct-06 18:33
memberThatsAlok26-Oct-06 18:33 
GeneralRe: hello Pin
sanjit_rath26-Oct-06 19:07
membersanjit_rath26-Oct-06 19:07 

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
Web01 | 2.8.170525.1 | Last Updated 25 Oct 2006
Article Copyright 2004 by sanjit_rath
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid