?
Solved

Shutdown my computer and make autologin

Posted on 1999-12-19
8
Medium Priority
?
121 Views
Last Modified: 2011-09-20
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
0
Comment
Question by:karen021897
  • 4
  • 4
8 Comments
 
LVL 20

Expert Comment

by:Madshi
ID: 2293506
Use this function:

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, true);

What do you mean with autologon? Are we talking about win9x or winNT?

Regards, Madshi.
0
 

Author Comment

by:karen021897
ID: 2294470
WinNT
0
 

Author Comment

by:karen021897
ID: 2294493
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
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 20

Expert Comment

by:Madshi
ID: 2294563
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).
0
 

Author Comment

by:karen021897
ID: 2297497
It won't work under NT
0
 
LVL 20

Expert Comment

by:Madshi
ID: 2297550
:-(
0
 
LVL 20

Accepted Solution

by:
Madshi earned 300 total points
ID: 2297553
Then try the API

"InitiateSystemShutdown".

Sorry, have no sources for that.
0
 

Author Comment

by:karen021897
ID: 2303073
Thanks
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
How can you see what you are working on when you want to see it while you to save a copy? Add a "Save As" icon to the Quick Access Toolbar, or QAT. That way, when you save a copy of a query, form, report, or other object you are modifying, you…
Planning to migrate your EDB file(s) to a new or an existing Outlook PST file? This video will guide you how to convert EDB file(s) to PST. Besides this, it also describes, how one can easily search any item(s) from multiple folders or mailboxes…
Suggested Courses

589 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question