473,395 Members | 1,670 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How to turn PC to stand-by mode?

Hello!

How can I turn the PC to Stand-by mode in a program?

Thanks in Advance!

Nov 15 '05 #1
3 4174
I don't know how to put system to standby, but for
shutting down the system, you can use PlatformInvoke to
call a windows API - ExitWindowsEx() defined in user32.dll
There must be some api's similar to this in the same
dll....

HTH
Sunil
-----Original Message-----
Hello!

How can I turn the PC to Stand-by mode in a program?

Thanks in Advance!

.

Nov 15 '05 #2
"Sunil TG" <an*******@discussions.microsoft.com> wrote in news:042501c39e1c
$5****************@phx.gbl:
I don't know how to put system to standby, but for
shutting down the system, you can use PlatformInvoke to
call a windows API - ExitWindowsEx() defined in user32.dll
There must be some api's similar to this in the same
dll....

HTH
Sunil
-----Original Message-----
Hello!

How can I turn the PC to Stand-by mode in a program?

Thanks in Advance!

.


WMI.

Take the Win32_OperatingSystem Class, check for the Primary Instance and
then invoke the Win32ShutDown Method with apropriate parameters.

--
------ooo---OOO---ooo------

Peter Koen - www.kema.at
MCAD CAI/RS CASE/RS IAT

------ooo---OOO---ooo------
Nov 15 '05 #3
How about try SetSuspendState() from powrprof.dll

[DllImport("powrprof.dll")]
private static extern bool SetSuspendState(bool Hibernate, bool
ForceCritical, bool DisableWakeEvent);

but u need to get the window's Privilege first before u can invoke this..
"Tomomichi Amano" <to*********@hotmail.com> wrote in message
news:#Z**************@tk2msftngp13.phx.gbl...
Hello!

How can I turn the PC to Stand-by mode in a program?

Thanks in Advance!

Nov 15 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: none | last post by:
Howdy all, I'm wondering if someone could give some direction on a problem I have or share their experiences. I'm wanting to create a little PHP application that will run on a local machine...
2
by: AstrA | last post by:
Hi All My forms are gonig to have a dark to green background and I want my labels to stand out. I'm gonig to use white for the colour of the actual labels, but you see a lot of the...
43
by: dan baker | last post by:
I have a page that gets loaded with a meta-refresh hardcoded so that a few things on the page get updated. its kind of a fake chat board. anyway, what I need to do is turn off the meta-refresh once...
121
by: David Pendrey | last post by:
I was wondering if it is at all posible to write a stand alone .EXE program in Visual Studio .NET. Hopefully in VB.NET but if not another language would be ok. Thanks for the assistance
3
by: Todd D. Levy | last post by:
What do I need to get (from Microsoft I assume) in order to distribute stand alone Access applications to people who do not (and will not) have Access installed on their systems? I have heard...
6
by: Robert Smith | last post by:
I am programming C in linux and i just need a quick and dirty way to make some text stand out. I would like to change the color maybe to red. I want to print out something like printf("Blah:...
4
by: Greg | last post by:
Regarding extensibility, e.g. EnvDTE what does "DTE" stand for? -- Greg McPherran www.McPherran.com
2
by: jim-on-linux | last post by:
py help, The file below will run as a stand alone file. It works fine as it is. But, when I call it from another module it locks my computer, The off switch is the only salvation. This...
10
by: discobay | last post by:
Is there a way to create a stand alone .exe from VB2005, that does not depend upon the .NET framework being installed on the target machine? I have followed previous threads on this subject and...
3
by: newsaboutgod | last post by:
I need a stand alone database for a VB.Net application on a laptop. It will have about 15,000 records in it. Frst off, if there any way to load XML in to a dataset and then run SQL against it?...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.