Click here to Skip to main content
12,240,300 members (62,459 online)
Click here to Skip to main content
Add your own
alternative version


22 bookmarked

How we can Shutdown a system OR Restart or Log Off or Hibernate or ....

, 2 Jun 2005 CPOL
Rate this:
Please Sign up or sign in to vote.
This program is a good example for shutdown or restart or stand by or Log off and Hibernate

Sample Image - Turn_Off_Computer.gif


How we can Shutdown a system OR Restart or Log Off or Hibernate or ....

This program is a good example for this Task.

I define Fuction as a Library , and then voice it into my program(Name  my program is :TurnOffWindows ).

according to :

Merge Library TurnOffComputer to program.

// TurnOffWindowsDlg.h : header file

#if !defined(AFX_TURNOFFWINDOWSDLG_H__1AA55971_5022_4C8B_9700_D0A6791694F2__INCLUDED_)
#define AFX_TURNOFFWINDOWSDLG_H__1AA55971_5022_4C8B_9700_D0A6791694F2__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000


#include "TurnOffComputer.h"


 use from this Library into my program.

void CTurnOffWindowsDlg::OnButtonRun() 
// TODO: Add your control notification handler code here

CTurnOffComputer MyTurnoff;




Notice :

m_radio is a integer value .

if  value m_radio is 0 ,So your computer will Shutdown .
Too :
<PRE>    1-->Restrat
    2-->Log Off
    3-->Stand by

For give more information you can download files it in this first section.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Behzad Bahjat Manesh
Iran (Islamic Republic of) Iran (Islamic Republic of)
I am from Iran, and Live in Ardakan City.
I am Computer engineering (HardWare).
I programming in VC++ & C++ & Assembly & Basic

You may also be interested in...

Comments and Discussions

QuestionMessage Automatically Removed Pin
10-Feb-14 7:54
memberheemanshubhalla10-Feb-14 7:54 
GeneralUnable to extract Pin
Anil K P4-Dec-07 23:39
memberAnil K P4-Dec-07 23:39 
Generalrestart Pin
jeevirajan3-Feb-07 3:26
memberjeevirajan3-Feb-07 3:26 
GeneralRe: restart Pin
Behzad Bahjat Manesh4-Jun-07 6:56
memberBehzad Bahjat Manesh4-Jun-07 6:56 
GeneralSource Code Is not Available Pin
MohammadAmiry3-Jun-05 4:58
memberMohammadAmiry3-Jun-05 4:58 
GeneralRe: Source Code Is not Available Pin
Behzad Bahjat Manesh4-Jun-05 0:07
memberBehzad Bahjat Manesh4-Jun-05 0:07 
GeneralRe: Source Code Is not Available Pin
MohammadAmiry13-Jun-05 0:28
memberMohammadAmiry13-Jun-05 0:28 
GeneralRe: Source Code Is not Available Pin
Douglas R. Keesler24-Jun-05 17:37
memberDouglas R. Keesler24-Jun-05 17:37 
GeneralSome comments Pin
Geert van Horrik2-Jun-05 22:57
memberGeert van Horrik2-Jun-05 22:57 
GeneralRe: Some comments Pin
.rich.w2-Jun-05 23:56 23:56 

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.

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.160426.1 | Last Updated 3 Jun 2005
Article Copyright 2005 by Behzad Bahjat Manesh
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid