Click here to Skip to main content
11,438,226 members (71,317 online)
Click here to Skip to main content

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

Introduction

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
UpdateData(TRUE);

CTurnOffComputer MyTurnoff;

MyTurnoff.Active(m_radio);


}

 

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
    4-->Hibernate

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

License

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

Share

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

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
member.rich.w2-Jun-05 23:56 
GeneralRe: Some comments Pin
Geert van Horrik3-Jun-05 0:38
memberGeert van Horrik3-Jun-05 0:38 
GeneralRe: Some comments Pin
Behzad Bahjat Manesh4-Jun-05 0:32
memberBehzad Bahjat Manesh4-Jun-05 0:32 

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
Web04 | 2.8.150506.1 | Last Updated 3 Jun 2005
Article Copyright 2005 by Behzad Bahjat Manesh
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid