Click to See Complete Forum and Search --> : Restart a computer
Panther
March 29th, 1999, 09:08 PM
I have a problem : You see my ISP gives me an IP addressfor three hours and then it changes it. But sometimes I amdoing stuff on my computer or I am just leaving it on standby and it blocks the IP changing request so what I wanted to do was to just make a nice little timer that will tell me to restart my computer or do it itself if I am not there. But I need to know if there is a code that makes a programm reboot the computer....
Raphael Phan
March 29th, 1999, 09:14 PM
Hi,
you can use the function
ExitWindowsEx (EWX_REBOOT ,0)
Raphael
ric
April 5th, 1999, 06:56 AM
Just call int 19h in some way
asm int 0x19
or get a far pointer to its function and then call it
See the Assembler Help for the exact memory areas
November 7th, 1999, 06:38 PM
There is an Api that make this and is called ExitWindowsEx the sintax is
BOOL ExitWindowsEx(UINT uFlags, DWORD dwReserved);
the argumen uFlags can take this constants:
For exit windows EWX_SHUT_DOWN
For Reboot the system EWX_REBOOT
the second param is reserved for future used and is ignored
Exampled
void CShutWindow::OnBottonShutDown()
{ if(!ExitWindowsEx(EWX_SHUTDOWN, 0))
AfxMessageBox("Canīt shut the system");
}
If you have any problem please contact with me.
I have another problem and if you can help me I agree you.
This is that I want to capture the entire screen using Visual C++
and change the resolution of the bitmap for save this in the minium
space in the disk. If know how to do it or where can I find Help please
write me. Thenk you
Arsalan
April 30th, 2000, 12:55 PM
The following line will restart the computer ::-->
ExitWindowsEx(EWX_REBOOT,NULL)
julien
September 4th, 2001, 10:09 AM
If you want to restart a computer, I think you must be administrator on your machine. Pay attention to this.
julien
September 4th, 2001, 10:12 AM
Can you tell me how to get a far pointer to the function "asm int 0x19"? Because I don't get how to include this line into my VC++ program.
Regards
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.