Click here to Skip to main content
Licence CPOL
First Posted 2 Jun 2005
Views 31,324
Bookmarked 20 times

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

By | 2 Jun 2005 | Article
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)

About the Author

Behzad Bahjat Manesh



Iran (Islamic Republic Of) Iran (Islamic Republic Of)

Member

I am from Iran, and Live in Ardakan City.
I am Computer engineering (HardWare).
I programming in VC++ & C++ & Assembly & Basic

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
GeneralUnable to extract PinmemberAnil K P22:39 4 Dec '07  
Generalrestart Pinmemberjeevirajan2:26 3 Feb '07  
GeneralRe: restart PinmemberBehzad Bahjat Manesh5:56 4 Jun '07  
GeneralSource Code Is not Available PinmemberMohammadAmiry3:58 3 Jun '05  
GeneralRe: Source Code Is not Available PinmemberBehzad Bahjat Manesh23:07 3 Jun '05  
GeneralRe: Source Code Is not Available PinmemberMohammadAmiry23:28 12 Jun '05  
GeneralRe: Source Code Is not Available PinmemberDouglas R. Keesler16:37 24 Jun '05  
GeneralSome comments PinmemberGeert van Horrik21:57 2 Jun '05  
GeneralRe: Some comments Pinmember.rich.w22:56 2 Jun '05  
GeneralRe: Some comments PinmemberGeert van Horrik23:38 2 Jun '05  
GeneralRe: Some comments PinmemberBehzad Bahjat Manesh23:32 3 Jun '05  

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.

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