Results 1 to 8 of 8

Thread: Desktop Button for standby or hibernate?

  1. #1
    FLA gospeed.racer's Avatar
    Join Date
    Dec 2003
    Location
    Portland, OR
    Posts
    1,303

    Desktop Button for standby or hibernate?

    Anybody able to do me a huge favor and make me a desktop button I can click to put my computer into standby or hibernate? I had a hibernate button once, but that...was a long long time ago. I cant find it anymore

    Thanks! -Jeff

    DOH....Found it.....http://www.newfreeware.com/desktop/249/

    The only problem is I kind of need a button, and this is just a tray icon.

    IWhen I searched a different set of keywords i found that I had posted this last year. Ever have a Monday? I need a beer.
    2005 Ford Focus ST

  2. #2
    Raw Wave god_of_cpu's Avatar
    Join Date
    Jan 2004
    Location
    SilverSpring Maryland
    Posts
    2,960
    Wrote this cause I'm such a nice guy.

    It runs completly off the command line, just pass it a shutdown command. Run without a command to get a list of the commands it supports. Just link a shortcut to this and put it on your desktop to get a desktop button.

    Souce is included below. Attached is the binary, it will run on anything microsoft windows.

    #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers

    #include <windows.h>

    int APIENTRY WinMain(HINSTANCE hInstance,
    HINSTANCE hPrevInstance,
    LPSTR lpCmdLine,
    int nCmdShow)
    {
    if (lstrcmpi(lpCmdLine,"hibernate")==0)
    SetSystemPowerState( FALSE, FALSE );
    else if (lstrcmpi(lpCmdLine, "standby") == 0)
    SetSystemPowerState( TRUE, FALSE );
    else if (lstrcmpi(lpCmdLine,"restart")==0)
    {
    ExitWindowsEx(EWX_REBOOT, 0);
    } else if (lstrcmpi(lpCmdLine,"shutdown")==0)
    {
    ExitWindowsEx(EWX_SHUTDOWN, 0);
    } else if (lstrcmpi(lpCmdLine,"blankscreen")==0)
    {
    SendMessage(GetDesktopWindow(), WM_SYSCOMMAND, SC_MONITORPOWER, 2);
    } else if (lstrcmpi(lpCmdLine,"logoff")==0)
    {
    ExitWindowsEx(EWX_LOGOFF, 0);
    }
    else
    MessageBox(NULL, "Usage: shutdown <parameter>\n\nValid Parameters:\n\tblankscreen\n\tlogoff\n\thibernate\ n\treboot\n\tstandby\n\tshutdown\n\nBrought to you by http://www.digitalwheelz.com", "Invalid Command Parameter", MB_ICONSTOP | MB_OK);

    return 0;
    }
    Attached Files Attached Files
    StreetDeck.com Developer (I am Chuck)
    Get StreetDeck at http://www.streetdeck.com
    The Official StreetDeck Forums have moved, please visit us at http://www.streetdeck.com/forum for official support for Streetdeck.

  3. #3
    Raw Wave wizardPC's Avatar
    Join Date
    Jun 2000
    Location
    Nashville
    Posts
    2,635
    Debt as of 1/1/05: $34,354.48
    Debt as of July 4, 2007: $0.00 explanation
    I'M DEBT FREE!!
    I'm now a reasonably successful gunblogger.

  4. #4
    FLA gospeed.racer's Avatar
    Join Date
    Dec 2003
    Location
    Portland, OR
    Posts
    1,303
    Thanks guys, yer awesome!
    2005 Ford Focus ST

  5. #5
    Raw Wave Confused's Avatar
    Join Date
    Aug 2003
    Location
    Essex, England
    Posts
    2,224
    Co-Developer of A.I.M.E.E
    www.aimee.cc

  6. #6
    MySQL Error MatrixPC's Avatar
    Join Date
    Sep 2003
    Location
    Beach City, Socal
    Posts
    4,053
    isn't it Windows has an ultility called "shutdown.exe"?
    With some switch, you can have it either shutdown, reboot, or hibernate.
    After figure out which switch, you can create a bat file for it.
    2004 Matrix XR A7N8X-VM/400 AMD XP-M 2500+, DS-ATX
    89 Supra Turbo P3 600E@750/Abit BE6 II, Alpine M-BUS Car2PC.
    Y2K Accord Dell GX150
    RoadRunner is the best FE PERIOD
    EmoRebellion is a SCAMMER

  7. #7
    Raw Wave Defiler's Avatar
    Join Date
    Jan 2002
    Location
    Temple Terrace, Fl.
    Posts
    2,647
    Here's how you can set up a restart button on your desktop:

    1. Create a shortcut (Right-click on desktop, select New > Shortcut).

    2. For location, type the following:

    shutdown -r -t 0

    3. Click Next, enter a name for the shortcut ("Restart" is appropriate), and click Finish.

    When you click your Restart shortcut, Windows XP will reboot *automagically*!

    The "-r" switch tells XP to reboot. If you'd like the shortcut to shut off your PC instead, change it to "-s"; to simply log off, change it to "-l". The "-t 0" sets the timeout (in seconds), so up this value if you find the need for it. To force running applications to close, add "-f" -- be careful with this one!

    For more information on Shutdown, type "shutdown" in a command prompt window (Start > All Programs > Accessories > Command Prompt), or search for Shutdown in Windows XP's Help and Support Center.
    Aura MR62 (F and R)
    My Current MP3s
    IamDefiler.com

  8. #8
    Newbie
    Join Date
    Aug 2003
    Posts
    50
    Yes, but thats not hibernate or standby :P

Similar Threads

  1. linking into laptop power button
    By corsamel in forum General Hardware Discussion
    Replies: 22
    Last Post: 04-23-2010, 05:53 AM
  2. Relocating computer power button
    By King_Xerxes in forum General Hardware Discussion
    Replies: 8
    Last Post: 02-21-2007, 10:15 PM
  3. My computer won't hibernate
    By Mtlca401 in forum General Hardware Discussion
    Replies: 0
    Last Post: 02-13-2004, 10:39 AM
  4. Exit button
    By liquid_smoke in forum Media Engine
    Replies: 1
    Last Post: 02-04-2004, 10:29 PM
  5. PC power button problem
    By BMp3W in forum Power Supplies
    Replies: 4
    Last Post: 10-12-2002, 03:36 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •