Click here to Skip to main content
Click here to Skip to main content
Go to top

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.

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 PinmemberJohannes Weidenauer6-Mar-13 2:10 
QuestionGreat work..bt need help.. PinmemberManni Singh28-Feb-07 19:43 
AnswerRe: Great work..bt need help.. Pinmembersanjit_rath25-Sep-07 8:08 
Generalgaaaaaaah Pinmemberjswoofer20-Oct-06 14:59 
GeneralRe: gaaaaaaah Pinmembersanjit_rath20-Oct-06 15:02 
GeneralRe: gaaaaaaah Pinmembersanjit_rath20-Oct-06 15:06 
GeneralRe: gaaaaaaah Pinmemberjswoofer20-Oct-06 15:32 
GeneralRe: gaaaaaaah Pinmembersanjit_rath20-Oct-06 17:22 
GeneralRe: gaaaaaaah Pinmembersanjit_rath25-Oct-06 10:51 
Generalcompiling problems Pinmemberthomas montague26-Jan-05 7:10 
GeneralRe: compiling problems Pinmember^^o000o^^26-Jan-05 22:05 
Generalnew Devils ^^oo00oo^^ Pinsuss17-Nov-04 14:55 
Generalhello Pinmemberyaoyu21-Oct-04 19:50 
GeneralRe: hello PinmemberSanjit Rath27-Oct-04 7:51 
GeneralRe: hello Pinmemberyaoyu31-Oct-04 6:27 
GeneralRe: hello PinmemberThatsAlok26-Oct-06 18:33 
GeneralRe: hello Pinmembersanjit_rath26-Oct-06 19: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 | Mobile
Web02 | 2.8.140916.1 | Last Updated 25 Oct 2006
Article Copyright 2004 by sanjit_rath
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid