Click here to Skip to main content
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 Pinmemberheemanshubhalla10-Feb-14 7:54 
GeneralUnable to extract PinmemberAnil K P4-Dec-07 23:39 
Generalrestart Pinmemberjeevirajan3-Feb-07 3:26 
GeneralRe: restart PinmemberBehzad Bahjat Manesh4-Jun-07 6:56 
GeneralSource Code Is not Available PinmemberMohammadAmiry3-Jun-05 4:58 
GeneralRe: Source Code Is not Available PinmemberBehzad Bahjat Manesh4-Jun-05 0:07 
GeneralRe: Source Code Is not Available PinmemberMohammadAmiry13-Jun-05 0:28 
GeneralRe: Source Code Is not Available PinmemberDouglas R. Keesler24-Jun-05 17:37 
GeneralSome comments PinmemberGeert van Horrik2-Jun-05 22:57 
GeneralRe: Some comments Pinmember.rich.w2-Jun-05 23:56 

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