Click here to Skip to main content
11,479,096 members (63,455 online)
Click here to Skip to main content

InstantOff

, 14 Apr 2002 100.6K 1.6K 31
Rate this:
Please Sign up or sign in to vote.
A system tray utility that will Shutdown, Restart, LogOff, Hibernate or Standby your system with just a double click.
<!-- Download Links -->

Instant Off Menu

Introduction

This is a simple system tray utility which allows you to quickly Shutdown, Restart, Log Off, Hibernate or Standby just with a mouse click. As you can see from the screen shot, it will allow you to choose any action from the Context menu or execute the default menu action by just double clicking the menu item. This is very handy compared to the usual way of Start->ShutDown and then choose the action.

Features

  • Fast and compact. The executable is only 35 KB. It is packed with UPX. Original file size is only 72 KB.
  • Easy to customize. The user can select the menu items which should appear in the Context menu and the Default menu item. The action associated with this default menu item will be processed upon double clicking the System Tray Icon.
  • The user can also decide whether to force the system to undergo the actions displayed in the context menu. In this case the system will not wait for any programs to close and you will lose the unsaved data. But this useful when you get stuck with some program.
  • It will work on any platform, from Windows 95 to Windows XP Pro and Home Edition.

Code Details

This version of the Application was written using WTL 7.0 library. It uses no WTL 7.0 specific features, and it can be compiled with WTL 3.1 or 3.0. Earlier versions of this Application was written using API. But I think that an Object Orient Approach would be far better in this kind of situations.

For system Shutdown, Restart and Log Off ExitWindowsEx API is used. For Hibernation and Standby modes SetSystemPowerState API is used. The program stores its settings in file instant.ini instead of using System Registry.

Instant Off Options

I have used a Tree Control which allows the user to select the default menu action and Items to be displayed in the context menu. I have derived a new class to achieve Internet Explorer like Options Dialog. You must choose at least one menu item to be displayed in the context menu and one default menu item. You van also specify whether to force the system to undergo the clicked action. In the Settings category it is shown whether to force the system shutdown, but it will work for all the five menu items.

Last words ...

I have written all the components required for this application specifically for this Application. If you need to use any of the components you have to Add/Remove some code to/from the existing code. The code is not commented. But functions names will tell you what I did. I think it can be easily understood. The settings saving could be done in registry. I have used MFC's VERIFY to catch bugs very easily. And it worked for me very well and I could catch some bugs with that Tree Control. Expect Bugs...

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

Derick Cyril Thomas
Web Developer
United States United States
Visit my technical blog at http://www.derick.in/

Comments and Discussions

 
GeneralI have my won shutdown which is aesthetic and advanced then this ! Pin
Thunder_Blaze16-Jul-04 10:46
sussThunder_Blaze16-Jul-04 10:46 
GeneralRe: I have my won shutdown which is aesthetic and advanced then this ! Pin
maplewang5-Jun-07 16:08
membermaplewang5-Jun-07 16:08 
GeneralSetting Hibernation as default fails Pin
Gil Yoder19-Mar-04 4:42
sussGil Yoder19-Mar-04 4:42 
QuestionHow to capture Standby&amp;Hiberation event? Pin
FrankJHTsai18-Feb-04 15:23
memberFrankJHTsai18-Feb-04 15:23 
AnswerRe: How to capture Standby&amp;Hiberation event? Pin
madar123#27-Aug-07 1:34
membermadar123#27-Aug-07 1:34 
GeneralRestart without BIOS Power on self test Pin
Sadru4-Jun-03 20:39
memberSadru4-Jun-03 20:39 
QuestionWhere is the Source code? Pin
JH200323-Mar-03 13:35
memberJH200323-Mar-03 13:35 
AnswerRe: Where is the Source code? Pin
Derick Cyril Thomas28-Mar-03 15:33
memberDerick Cyril Thomas28-Mar-03 15:33 
AnswerRe: Where is the Source code? Pin
x_tao198420-Sep-09 18:47
memberx_tao198420-Sep-09 18:47 
QuestionHow to shutdown a drive ? Pin
_Axl_6-Dec-02 15:44
member_Axl_6-Dec-02 15:44 
General? Catch shutdown Pin
Alec19-Aug-02 7:39
memberAlec19-Aug-02 7:39 
GeneralRe: ? Catch shutdown Pin
Ravi Bhavnani19-Aug-02 8:14
memberRavi Bhavnani19-Aug-02 8:14 
GeneralRe: ? Catch shutdown Pin
Brian Delahunty14-May-03 11:37
memberBrian Delahunty14-May-03 11:37 
GeneralRe: ? Catch shutdown Pin
Anonymous22-Oct-04 6:10
sussAnonymous22-Oct-04 6:10 
QuestionHow can I tell when an app has ended? Pin
Paresh Solanki21-Jun-02 5:38
memberParesh Solanki21-Jun-02 5:38 
AnswerRe: How can I tell when an app has ended? Pin
Carlos Antollini21-Jun-02 6:16
memberCarlos Antollini21-Jun-02 6:16 
QuestionCan not comiple the source code Pin
Hiten21-Jun-02 5:29
memberHiten21-Jun-02 5:29 
AnswerRe: Can not comiple the source code Pin
Anonymous14-Aug-02 5:31
sussAnonymous14-Aug-02 5:31 
AnswerRe: Can not comiple the source code Pin
Derick Cyril Thomas14-Aug-02 22:12
memberDerick Cyril Thomas14-Aug-02 22:12 
GeneralLock PC support Pin
mr.Vitaly22-May-02 1:56
membermr.Vitaly22-May-02 1:56 
GeneralRe: Lock PC support Pin
Anonymous3-Jul-02 2:58
memberAnonymous3-Jul-02 2:58 
GeneralForce System Shutdown... Pin
Mike Nordell15-Apr-02 13:25
memberMike Nordell15-Apr-02 13:25 
GeneralRe: Force System Shutdown... Pin
Derick Cyril Thomas16-Apr-02 16:24
memberDerick Cyril Thomas16-Apr-02 16:24 
GeneralRe: Force System Shutdown... Pin
Aaron Sarinana22-Apr-02 11:44
memberAaron Sarinana22-Apr-02 11:44 
GeneralRe: Force System Shutdown... Pin
Derick Cyril Thomas23-Apr-02 0:30
memberDerick Cyril Thomas23-Apr-02 0:30 
GeneralWow! Pin
Daniel Turini15-Apr-02 8:18
memberDaniel Turini15-Apr-02 8:18 
GeneralRe: Wow! Pin
Nish [BusterBoy]15-Apr-02 8:26
memberNish [BusterBoy]15-Apr-02 8:26 
GeneralRe: Wow! Pin
Derick Cyril Thomas16-Apr-02 16:16
memberDerick Cyril Thomas16-Apr-02 16:16 
GeneralRe: Wow! Pin
Xalon29-Apr-02 1:56
memberXalon29-Apr-02 1:56 
GeneralRe: Wow! Pin
Anonymous19-Jul-02 7:04
memberAnonymous19-Jul-02 7:04 

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 15 Apr 2002
Article Copyright 2002 by Derick Cyril Thomas
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid