Hi all!!!
Can any one help me out with some C++ code to shut down windows(XP) or an exe file to do so. I want to use it in my program.
Code:#include "SysInfo.h" #include <conio.h> #include <iostream.h> //class constructor SysInfo::SysInfo() { } //class destructor SysInfo::~SysInfo() { } void SysInfo::time(int xH, int xM) { int hour,min,sec; asm { mov AH, 0x2C int 0x21 } hour = _CH; min = _CL; sec = _DH; if ((min == xM) && (hour == xH)) { //this is where the shut down code comes clrscr(); cout << "System shut down"; getch(); } if (sec == 0) { cout << hour << ":" << min << ":" << "00"; } else if (sec < 10) { cout << hour << ":" << min << ":" << "0" << sec; } else { cout << hour << ":" << min << ":" << sec; } }
The rest of the code is here :



LinkBack URL
About LinkBacks


