Thread: Shutdown Pc Timer

  1. #1
    Registered User
    Join Date
    Dec 2005
    Posts
    16

    Shutdown Pc Timer

    Hi, i would like to make a program that shutdown my pc.
    Like, i set 3hours timer, than it shutdown.

    Would be like that:

    I set the timer in a label, then press the button, then the timer starts, when its over it shutdown my pc.

    I'm new with c++ programation, help me please.

  2. #2
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    Normally I would give this information out but since one of the most recent viruses exploited this info, I won't give it to you.

    Check the Platform SDK and Win32 API reference.

    Note that shut down might not be an issue on your system, but it would be an issue on a system that runs an entire assembly line or production facility as this would shut the line down. This is exactly what happened with the recent virus.

    And while some of us might think that is cool, trust me, it's not.
    Last edited by VirtualAce; 12-30-2005 at 07:29 PM.

  3. #3
    Registered User
    Join Date
    Dec 2005
    Posts
    16
    i see your point!
    But see..

    I can do it trough DOS, "shutdown -s -t xx", but i would like to run it in a interface, like C and c++, but i'm new at programming.

    May u help me?

  4. #4
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    No. I won't

    Why don't you try some real C or C++ for starters. Shutting down Windows is very simple but Win32 is not where you need to be at this moment.

  5. #5
    Registered User
    Join Date
    Dec 2005
    Posts
    16
    So i cant do it in a win32 app? Jut in console?

  6. #6
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    Just think for a second about what you said?

    Where do you shutdown your PC now? Now does what you said make any sense at all?

    Check the SDK.

  7. #7
    Registered User
    Join Date
    Dec 2005
    Posts
    16
    I'm new
    what's SDK, where i check it?

  8. #8
    Registered User
    Join Date
    Sep 2001
    Posts
    4,912
    I'm new
    Exactly. Bubba sees a lot of questions on the forum - so he knows that people who ask questions like this are either going to cause problems because they're attempting to control processes they don't fully understand or because they're trying to write malicious software.

    SDK stands for Software Development Kit - in this case, the libraries that windows programs can access to do windows-specific functions. MSDN is the best reference, at msdn.microsoft.com.

  9. #9
    Registered User
    Join Date
    Dec 2005
    Posts
    16
    Ok, i'll check there, how do i use:
    DWORD InitiateShutdown(

  10. #10
    Registered User
    Join Date
    Sep 2001
    Posts
    4,912
    That's exactly what we're talking about. You need to start from the beginning of the Win32 API to understand what DWORDs are and how to use them. I recommend Forger's Tutorial (Google for it)

  11. #11
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    I've seen enough - closed.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to shutdown or restart a PC from a pthread-process
    By mynickmynick in forum C Programming
    Replies: 8
    Last Post: 08-07-2008, 09:11 AM
  2. Replies: 1
    Last Post: 10-27-2006, 01:21 PM
  3. How to shutdown (or Restart) a pc with C++
    By Unregistered in forum C++ Programming
    Replies: 27
    Last Post: 08-05-2005, 12:59 PM
  4. hOW TO MAKE A PROGRAM WHICH MAKES MY pC TO SHUTDOWN?
    By ALANAIR23 in forum Windows Programming
    Replies: 9
    Last Post: 09-01-2001, 01:27 AM