?
Solved

Shutdown  NT Workstation 'Quick'

Posted on 1998-08-23
3
Medium Priority
?
161 Views
Last Modified: 2010-04-04
Hello!!
I need to shut down NT Workstation Quick with all programs
active. I want to push one button, after that see shut's down not restarts.

I you can help me with this question. I'll be glad.

Thanks!!!
0
Comment
Question by:vis
  • 2
3 Comments
 
LVL 10

Accepted Solution

by:
viktornet earned 150 total points
ID: 1337478
Try using

ExitWindowsEx()

Here is a snippet from the help file.....
--------------------------------
The ExitWindowsEx function either logs off, shuts down, or shuts down and restarts the system.

BOOL ExitWindowsEx(

    UINT  uFlags,      // shutdown operation
    DWORD  dwReserved       // reserved
   );      
Parameters

uFlags

Specifies the type of shutdown. This parameter must be some combination of the following values:

Value      Meaning
EWX_FORCE      Forces processes to terminate. Instead of bringing up the "application not responding" dialog box for the user, this value forces an application to terminate if it does not respond.
EWX_LOGOFF      Shuts down all processes running in the security context of the process that called the ExitWindowsEx function. Then it logs the user off.
EWX_POWEROFF      Shuts down the system and turns off the power. The application must have the SE_SHUTDOWN_NAME privilege (for more information, see the Remarks section) and the system must support the power-off feature.
EWX_REBOOT      Shuts down the system and then restarts the system. The application must have the SE_SHUTDOWN_NAME privilege (for more information, see the Remarks section).
EWX_SHUTDOWN      Shuts down the system to a point at which it is safe to turn off the power. All file buffers have been flushed to disk, and all running processes have stopped. The application must have the SE_SHUTDOWN_NAME privilege (for more information, see the Remarks section).
dwReserved

Reserved; this parameter is ignored.
-------------------

Regards,
Viktor Ivanov
0
 
LVL 10

Expert Comment

by:viktornet
ID: 1337479
I guess you need this ....

ExitWindowsEx(EWX_SHUTDOWN, 0);

Regards,
Viktor Ivanov
0
 

Author Comment

by:vis
ID: 1337480
It will not work like this. The computer logs off always not shutdowns

I need to shut down the computer
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses
Course of the Month16 days, 5 hours left to enroll

850 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