shut down

This is a discussion on shut down within the C Programming forums, part of the General Programming Boards category; how can i shut down i computer with c code?...

  1. #1
    Unregistered
    Guest

    shut down

    how can i shut down i computer with c code?

  2. #2
    Registered User Dave Jay's Avatar
    Join Date
    Mar 2002
    Posts
    33
    Gracefully or ungracefully?

  3. #3
    Registered User
    Join Date
    Feb 2002
    Posts
    30

    shutdown

    Hi,

    have a look here:

    http://www.computer-mentors.co.uk/ww...sages/592.html

    and here:

    http://www.computer-mentors.co.uk/wwwboard/c/

    i have pasted the code below:

    you can use
    BOOL ExitWindowEx(UINT uOptions, DWORD dwRes)
    uOptions are
    EWX_FORCE
    EWX_LOGOFF
    EWX_POWEROFF
    EWX_REBOOT
    EWX_SHUTDOWN
    for more info refer to MSDN etc.
    or
    BOOL ExitWindows()
    e.g
    BOOL bok = ExitWindows(0,0)

    to abort shutdown process use
    BOOL AbortSystemShutdown(LPCTSTR pMachine)
    e.g
    BOOL bok = AbortSystemShutdown(0)


    If this doesnt work try out freecode.com
    Kendals

  4. #4
    Registered User Nutshell's Avatar
    Join Date
    Jan 2002
    Posts
    1,020
    Can you paste a sample code pls? I don't know which header files to include and stuff.....

    thnx

  5. #5
    Registered User
    Join Date
    Mar 2002
    Posts
    9
    Set all i,o registers to 0 and call dosx86() with those IO values.

    where i,o are unions. (union REGS i,o)

    --vaspro

  6. #6
    Registered User Nutshell's Avatar
    Join Date
    Jan 2002
    Posts
    1,020
    Hi,

    You're making me even more confused...WHy need to use unions and stuff like dosx86()? I don't know how to use them.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. hardware interrupt to shut down
    By GanglyLamb in forum Tech Board
    Replies: 13
    Last Post: 06-11-2003, 02:23 PM
  2. Shut off DOS screen automatically to Windows
    By Unregistered in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 11-08-2001, 07:14 PM
  3. how often do you shut down?
    By WayTooHigh in forum A Brief History of Cprogramming.com
    Replies: 24
    Last Post: 10-12-2001, 03:18 PM
  4. Displaying the Shut Down Windows dialog
    By SMurf in forum Windows Programming
    Replies: 2
    Last Post: 09-14-2001, 06:52 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21