473,467 Members | 1,410 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

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 4175
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?...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.