Click here to Skip to main content
11,479,486 members (46,975 online)
Click here to Skip to main content

Shutdown - an alternative to Windows Shutdown dialog

, 25 Oct 2006 96.7K 1.8K 31
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.

T.O.C.

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

Description

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.

[ ^ ]

Introduction

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.

[ ^ ]

Features

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)

[ ^ ]

Programming

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.

Shutdown:

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 http://www.codeproject.com/threads/classprobe.asp

[ ^ ]

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.

[ ^ ]

Disclaimer

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: http://thunder.sourceforge.net for details

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

sanjit_rath
Web Developer
United States United States
No Biography provided

Comments and Discussions

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

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