Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Starting Windows and shutting down windows

Status
Not open for further replies.

AnthonyKenny

Programmer
Apr 1, 2004
3
IE
I am writing an application that authicates users on a Novell network. When a match is succesful I want to load Windows. Does anyone know how? Also does anyone know how to shut down Windows from my application. I am using WindowsXP.
 
There is the procedure Exitwindows; here is the help


:
function ExitWindows(Reserved: LongInt; ReturnCode: Word): Bool;

The ExitWindows function can restart Windows, terminate Windows and return control to MS-DOS, or terminate Windows and restart the system. Windows sends the WM_QUERYENDSESSION message to notify all applications that a request has been made to restart or terminate Windows. If all applications "agree" to terminate, Windows sends the WM_ENDSESSION message to all applications before terminating.

Parameter Description

ReturnCode Specifies whether Windows should restart, terminate and return control to MS-DOS, or terminate and restart the system. The high-order word of this parameter should be zero. The low-order word specifies the return value to be passed to MS-DOS when Windows terminates. The low-order word can be one of the following values:

Value Meaning

EW_REBOOTSYSTEM Causes Windows to terminate and the system to restart.
EW_RESTARTWINDOWS Causes Windows to restart.

Reserved Reserved; must be zero.

Returns

Returns zero if one or more applications refuse to terminate. The function does not return a value if all applications agree to be terminated.


Also for loading : write in a procedure
: regsavekey . then while holding the control button press left click.You should be in the windows unit.There are some functions here but i cannot make them work.For example logonuser.

ps. if you know how to use them or you find out then by all means please let me know.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top