Help - Search - Members - Calendar
Full Version: Programming help
Invision Power Services > Community Forums > Community Web Design and Coding
Sebastian Mares
Hello!

I am working on a small program which should turn off the PC or do other tasks when events arrive, such as time is 8:30 AM, 90 minutes passed, process "defrag.exe" terminated or screen region X1-X2/Y1-Y2 changed.
So far, I know how to launch programs, play sounds, turn off the PC, reboot, log off, lock workstation, suspend PC, place PC in Hibernate mode or turn off display. The only thing I would like to add now is a function for turning off the HDD, but I cannot find any documentations on that. I am not even sure if it is possible to do so for a third-party application.
Anyways, if any of you know how to acomplish this task (API call, whatsoever), please let me know. The language isn't that important to me, as long as it isn't hard-core assembly. original.gif

Regards,
Sebastian
Brendon Koz
What do you mean by turning off the HDD as opposed to turning off the PC?

Also, which operating system are you creating this for?
Sebastian Mares
QUOTE(malikyte @ Apr 5 2005, 08:39 PM)
What do you mean by turning off the HDD as opposed to turning off the PC?
*


Well, the Windows APM service can turn off the HDD, while leaving the processor, sound card, video card... turned on.

QUOTE(malikyte @ Apr 5 2005, 08:39 PM)
Also, which operating system are you creating this for?
*


It should work on Windows ME, 2000, XP and 2003. Not sure if NT and 98 support power management that well (all the extra features, like suspending, hibernating, etc.).

I asked on Experts-Exchange, but the only thing I received was a link to MSDN with some APIs for changing the power scheme. I am not sure if I want to mess around with that - that is, creating and deleting new power schemes. I thought there might be a direct API for turning off the HDD like there is (sort of) for turning off the display.
Chad
Keep in mind that turning off the PC is not just an OS requesite.
Something to do with the hardware as well. I read it somewhere.
Although, I can't see most computers today not supporting this.

Chad
Sebastian Mares
QUOTE(Chad @ Apr 5 2005, 10:59 PM)
Keep in mind that turning off the PC is not just an OS requesite.
Something to do with the hardware as well.  I read it somewhere.
Although, I can't see most computers today not supporting this.

Chad
*


Well, I only set the privileges (for NT based systems) and then tell the OS to perform the shut down. From that point, the OS is responsible for shutting down. It sends a shut down message to all programs, terminates processes...
Brendon Koz
I don't currently have time to research this now that I know what you are looking for. You might want to ask over at neowin.net's forums in the skinning area or programming or something. I know someone over there could answer your question in a heartbeat.

I'm already over the time of my break so I have to get going...but if I get a chance I'll look this up.

You might not have to use an API, you might be able to use a shell command to something like rundll32.exe.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.