Click here to Skip to main content
15,558,870 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionReset to computer Pin
RomTibi6-Apr-10 10:57
RomTibi6-Apr-10 10:57 
QuestionRe: Reset to computer Pin
David Crow6-Apr-10 11:04
David Crow6-Apr-10 11:04 
AnswerRe: Reset to computer Pin
RomTibi6-Apr-10 11:24
RomTibi6-Apr-10 11:24 
AnswerRe: Reset to computer Pin
David Crow6-Apr-10 11:26
David Crow6-Apr-10 11:26 
GeneralRe: Reset to computer Pin
RomTibi7-Apr-10 6:29
RomTibi7-Apr-10 6:29 
AnswerRe: Reset to computer Pin
Eugen Podsypalnikov6-Apr-10 11:07
Eugen Podsypalnikov6-Apr-10 11:07 
GeneralRe: Reset to computer Pin
RomTibi7-Apr-10 6:29
RomTibi7-Apr-10 6:29 
AnswerShutdown -r Pin
gamefreak22916-Apr-10 12:07
gamefreak22916-Apr-10 12:07 
As someone else already suggested, you can use the command "shutdown -r" which will run just as though you used it through command prompt. An example:
void main()
{
	system("shutdown -r");
}


This will default to a 30 second timer before the computer begins to shutdown. With some effort, you should be able to find a way to decrease the timer, although I'm not positive.

EDIT: system("shutdown -r -t 10"); that will set the shutdown timer to 10 seconds, instead of the default 30. The command shutdown tells the computer what to do, "-r" is for resetting the computer, "-t xx" (-t 10) sets the time to the amount of seconds you indicate, so if your code were "system("shutdown -r -t 1");" The computer would start resetting one second after your program executes that line of code. Theoretically you can set it to 0 seconds, but I don't feel like testing that one Poke tongue | ;-P
GeneralRe: Shutdown -r Pin
RomTibi7-Apr-10 6:30
RomTibi7-Apr-10 6:30 
QuestionVisual C++ Solution in GCC Pin
darc koder6-Apr-10 8:12
darc koder6-Apr-10 8:12 
AnswerRe: Visual C++ Solution in GCC Pin
Maximilien6-Apr-10 9:57
Maximilien6-Apr-10 9:57 
AnswerRe: Visual C++ Solution in GCC Pin
CPallini6-Apr-10 10:44
mveCPallini6-Apr-10 10:44 
AnswerRe: Visual C++ Solution in GCC Pin
David Crow6-Apr-10 11:07
David Crow6-Apr-10 11:07 
QuestionVertical/Horizontal scroll bar not coming in CListCtrl Pin
_T("No name")6-Apr-10 4:45
_T("No name")6-Apr-10 4:45 
AnswerRe: Vertical/Horizontal scroll bar not coming in CListCtrl Pin
_T("No name")6-Apr-10 4:50
_T("No name")6-Apr-10 4:50 
Questionbm_setstate redraw not working Pin
Jach Mullan6-Apr-10 0:57
Jach Mullan6-Apr-10 0:57 
AnswerRe: bm_setstate redraw not working Pin
Eugen Podsypalnikov6-Apr-10 2:58
Eugen Podsypalnikov6-Apr-10 2:58 
Questionsyntax error [modified] Pin
rupeshkp7285-Apr-10 23:30
rupeshkp7285-Apr-10 23:30 
QuestionRe: syntax error Pin
CPallini5-Apr-10 23:33
mveCPallini5-Apr-10 23:33 
AnswerRe: syntax error Pin
rupeshkp7285-Apr-10 23:40
rupeshkp7285-Apr-10 23:40 
QuestionRe: syntax error Pin
CPallini5-Apr-10 23:47
mveCPallini5-Apr-10 23:47 
AnswerRe: syntax error Pin
rupeshkp7286-Apr-10 0:07
rupeshkp7286-Apr-10 0:07 
GeneralRe: syntax error Pin
CPallini6-Apr-10 0:20
mveCPallini6-Apr-10 0:20 
GeneralRe: syntax error Pin
rupeshkp7286-Apr-10 1:42
rupeshkp7286-Apr-10 1:42 
GeneralRe: syntax error Pin
CPallini6-Apr-10 1:50
mveCPallini6-Apr-10 1:50 

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.