![Avatar of karen021897](https://cdn.experts-exchange.com/images/experts-exchange/avatar-01-large.gif)
karen021897
asked on
Shutdown my computer and make autologin
How can i shutdown my computer fast - don't let the application close it self or save , i want to "FORCE" and add to the registry autologon?
much points for correct answer ( 200 ) i will raise
much points for correct answer ( 200 ) i will raise
![Avatar of karen021897](https://cdn.experts-exchange.com/images/experts-exchange/avatar-01-large.gif)
ASKER
WinNT
![Avatar of karen021897](https://cdn.experts-exchange.com/images/experts-exchange/avatar-01-large.gif)
ASKER
When i have Delphi opens and push this button i have to save the project before computer shuts it down, i want to push this button and the computer shutdown in 1. second, let application not save it self
![Avatar of Madshi](https://cdn.experts-exchange.com/images/experts-exchange/avatar-01-large.gif)
Have you really given in a "true" as the force parameter? Have you run your program inside the Delphi IDE? Run it outside of Delphi (e.g. double clicking the exe file). Then it should work perfectly (at least it does on my machine).
![Avatar of karen021897](https://cdn.experts-exchange.com/images/experts-exchange/avatar-01-large.gif)
ASKER
It won't work under NT
![Avatar of Madshi](https://cdn.experts-exchange.com/images/experts-exchange/avatar-01-large.gif)
:-(
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
![Avatar of karen021897](https://cdn.experts-exchange.com/images/experts-exchange/avatar-01-large.gif)
ASKER
Thanks
procedure Down(powerOff, force: boolean);
var dw1 : dword;
begin
if powerOff then dw1 := EWX_POWEROFF
else dw1 := EWX_SHUTDOWN;
if force then dw1 := dw1 or EWX_FORCE;
ExitWindowsEx(dw1, 0);
end;
With this parameters:
Down(falseOrTrueAsYouLike,
What do you mean with autologon? Are we talking about win9x or winNT?
Regards, Madshi.