snoopy_Spy
asked on
Reboot, Detect, Run Service
Hi
I have 3 questions :
How can i reboot (Win9X, 2K, NT4)
How can i detect that the system was rebooted
Can i (and how) start a exe as service before i log on on a windows system !
For each question you get 25 points !
I have 3 questions :
How can i reboot (Win9X, 2K, NT4)
How can i detect that the system was rebooted
Can i (and how) start a exe as service before i log on on a windows system !
For each question you get 25 points !
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
For checking if windows was rebooted, i have heared that there is a possibility to copy a file and the file is copied when windows is booting !
Do you know how i can copy the file with this parameter ?
Do you know how i can copy the file with this parameter ?
try using copyfile here:
if ok_to_close then
begin
copyfile(fromfile,tofile);
Msg.Result := CAN_SHUTDOWN
end
else
..
if ok_to_close then
begin
copyfile(fromfile,tofile);
Msg.Result := CAN_SHUTDOWN
end
else
..
ASKER
The problem is, when i close the application and than shut down windows i doesn't know that !
hehe
of course not there is no way to now this if your app is not running ..
you caould make another small app that is hidden completely and runing in background to check is windows shutdown.
when it gets message you can know then ..
of course not there is no way to now this if your app is not running ..
you caould make another small app that is hidden completely and runing in background to check is windows shutdown.
when it gets message you can know then ..
ASKER
hi
I have found it !
It's the MoveFileEx function ! The third parameter is the MOVEFILE_DELAY_UNTIL_REBOO T the file is moved when windows is rebooted !
I have found it !
It's the MoveFileEx function ! The third parameter is the MOVEFILE_DELAY_UNTIL_REBOO
ah very good ,i must remember that one ;-)
ASKER