Exit Windows problem

This is a discussion on Exit Windows problem within the Windows Programming forums, part of the Platform Specific Boards category; I have used ExitWindows(EWX_LOGOFF|EWX_REBOOT,0); but it logs of and waits for logon I also tried EWX_REBOOT only and also with ...

  1. #1
    Registered User cfrost's Avatar
    Join Date
    Apr 2004
    Posts
    119

    Cool Exit Windows problem

    I have used
    ExitWindows(EWX_LOGOFF|EWX_REBOOT,0);
    but it logs of and waits for logon
    I also tried
    EWX_REBOOT only and also with EWX_FORCE nothing happens same result what to do?

  2. #2
    Software Developer jverkoey's Avatar
    Join Date
    Feb 2003
    Location
    University of Waterloo
    Posts
    1,903
    http://msdn.microsoft.com/library/de...xitwindows.asp

    msdn'ness!! ^^^

    anyways, here's what i saw there:


    ExitWindows

    The ExitWindows function logs off the current user. It sends the WM_QUERYENDSESSION message to determine if they can be terminated.

    To shut down the system, or shut down and restart the system, use the ExitWindowsEx function.



    note the italicized/bolded sentence...

  3. #3
    Registered User cfrost's Avatar
    Join Date
    Apr 2004
    Posts
    119
    I used ExitWindowsEx but i give me error for reasons macro it says it is not defined
    Please provide me the definations of macros(all)

  4. #4
    Sweet
    Join Date
    Aug 2002
    Location
    Tucson, Arizona
    Posts
    1,801
    are you linking the user32 lib? cause it just needs windows.h
    try something like this
    Code:
    ExitWindowsEx(
      EWX_REBOOT,
      SHTDN_REASON_MAJOR_APPLICATION
    );
    Woop?

  5. #5
    Registered User cfrost's Avatar
    Join Date
    Apr 2004
    Posts
    119
    I want Defination of SHTDN_REASON_MAJOR_APPLICATION macro
    i.e
    #define SHTDN_REASON_MAJOR_APPLICATION ????

  6. #6
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,417
    Like I said in one of your other threads, you can't just go round grabbing random declarations from other peoples header files (and/or libraries to match), and expect it all to work.

    If your OS/Compiler is too old, then either upgrade or find another way to achieve what you want.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  7. #7
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,789
    Youve stated that you have VC++6.

    In that case download the Platform SDK from here...http://www.microsoft.com/msdownload/...sdk/sdkupdate/

    That will give you current headers and libs for all of the general APIS

  8. #8
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,630
    The calling thread has to have the SE_SHUTDOWN_NAME privilege in order to shutdown or reboot.

    How to Shut Down the System

    gg

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Windows explorer problem.
    By stevesmithx in forum Tech Board
    Replies: 7
    Last Post: 05-14-2008, 06:10 AM
  2. Possible Windows MDAC problem
    By BobS0327 in forum Tech Board
    Replies: 3
    Last Post: 06-28-2006, 04:57 AM
  3. Odd memory leaks
    By VirtualAce in forum C++ Programming
    Replies: 11
    Last Post: 05-25-2006, 12:56 AM
  4. C++ Gurus, UNIX vs. Windows ascii problem perhaps?
    By puck in forum C++ Programming
    Replies: 6
    Last Post: 03-28-2003, 09:33 PM
  5. Windows 98 problem
    By Hannwaas in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 12-30-2001, 11:01 AM

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