force shutting down, power off win98

This is a discussion on force shutting down, power off win98 within the Windows Programming forums, part of the Platform Specific Boards category; referring to http://msdn.microsoft.com/library/de...emshutdown.asp it says Windows Me/98/95: Because of the design of the shell, calling ExitWindowsEx with EWX_FORCE fails to ...

  1. #1
    Registered User
    Join Date
    Mar 2004
    Posts
    114

    force shutting down, power off win98

    referring to

    http://msdn.microsoft.com/library/de...emshutdown.asp

    it says

    Windows Me/98/95: Because of the design of the shell, calling ExitWindowsEx with EWX_FORCE fails to completely log off the user (the system terminates the applications and displays the Enter Windows Password dialog box, however, the user's desktop remains.) To log off the user forcibly, terminate the Explorer process before calling ExitWindowsEx with EWX_LOGOFF and EWX_FORCE.
    i encountered the "Enter Windows Password dialog box" problem. So according to MSDN i should "terminate the Explorer process before calling ExitWindowsEx with EWX_LOGOFF and EWX_FORCE."

    question : how exactly do i "terminate the Explorer process before calling ExitWindowsEx with EWX_LOGOFF and EWX_FORCE." ??

  2. #2
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    http://www.google.com/search?q=termi...rminateprocess

    Second result:
    The best way to close the explorer is this:

    Code:
    PostMessage(FindWindow('Progman', 'Program Manager'), WM_QUIT, 0, 0);
    This is an undocumented solution to ask the explorer politely to close down and the explorer obeys. Windows itself uses this approach to close the explorer down. Using TerminateProcess can make things unstable, especially in win9x. Please note, that this approach only works this way for the explorer. Normally you shouldn't be using WM_QUIT.

  3. #3
    Code Monkey Davros's Avatar
    Join Date
    Jun 2002
    Posts
    812
    I think :

    ExitWindows(0, 0);

    will do it.
    OS: Windows XP
    Compilers: MinGW (Code::Blocks), BCB 5

    BigAngryDog.com

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problem With My Box
    By HaVoX in forum Tech Board
    Replies: 9
    Last Post: 10-15-2005, 07:38 AM
  2. The destructive power of a nuclear bomb
    By InvariantLoop in forum A Brief History of Cprogramming.com
    Replies: 30
    Last Post: 03-24-2005, 01:46 AM
  3. Problems shutting off computer
    By frenchfry164 in forum Tech Board
    Replies: 9
    Last Post: 04-22-2003, 06:19 PM
  4. force modem disconnect or power down
    By iain in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 09-17-2001, 06:17 PM

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