🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.lang.basic.visual.misc
2 messages
2 total messages Started by Mirco Soderi Thu, 21 Nov 2002 18:15
Urgent: How can I turn off my PC using Visual Basic?
#323
Author: Mirco Soderi
Date: Thu, 21 Nov 2002 18:15
12 lines
1724 bytes
Hello everyone!

How can I turn off my PC using Visual Basic programming code?

If you need to know it, I can turn off my PC following these steps:
* press CTRL - ALT - CANC on my keyboard;
* press ALT - A at the same time on my keyboard.

THANK YOU in advance to all the ones who will decide to help me! PLEASE, do
it a.s.a.p. !!!

- Mirco Soderi -
Re: Urgent: How can I turn off my PC using Visual Basic?
#324
Author: Wilko
Date: Thu, 21 Nov 2002 22:28
32 lines
2196 bytes
Try this:

at module level in a module or PRIVATE in a form:
Declare Function ExitWindowsEx Lib "user32" (ByVal uFlags As Long, ByVal
dwReserved As Long) As Long

in a sub or function:
  Const EWX_SHUTDOWN = 1
  Dim ResLon As Long
  ResLon = ExitWindowsEx(EWX_SHUTDOWN, 0&)

Don't forget to save before you try this otherwise you will have to start
again...

Wilko

Mirco Soderi heeft geschreven in bericht ...
>Hello everyone!
>
>How can I turn off my PC using Visual Basic programming code?
>
>If you need to know it, I can turn off my PC following these steps:
>* press CTRL - ALT - CANC on my keyboard;
>* press ALT - A at the same time on my keyboard.
>
>THANK YOU in advance to all the ones who will decide to help me! PLEASE, do
>it a.s.a.p. !!!
>
>- Mirco Soderi -
>
>
>
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads