Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Forced poweroff
Message
De
19/04/1999 14:54:32
 
 
À
19/04/1999 09:37:28
Man Wai Chang
Hang Hing Metal Manufacturer
Hung Hom, Hong Kong
Information générale
Forum:
Visual C++
Catégorie:
Autre
Titre:
Divers
Thread ID:
00204524
Message ID:
00209810
Vues:
20
>My computer has power management built-in. So the hardware
>is definitely NOT a problem. And I just want to write a
>simple command-line exe to shutdown my PC, why do I need
>to spend so much? Thanks for your reply anyway.
>

I don't understand the question. The API call docs state that you need a GUI-based application to use the API call in question. What's the big deal? Create a WinMain so that there's a window context, and issue the API call. It works. If you're asking why that requirement exists, direct the question to MS - I don't design the internals of their API calls. ExitWindowsEx() functions from WinApps with a Winmain and WIndows context as it's expected. Under NT, user permissions may limit the functionality, as the environment was designed to do - if a user or process doesn't have the necessary permissions to do a systme shutdown, NT won't shut down because an unprivileged process tried to use the call.

As to why do you need to spend so much on books and documentation; if you want to have the references on hand, aren't satisfied with the details provided in the on-line help that comes with the tools, and can't borrow the necessary references from the library or a friend, buy them. I spend a lot of money to keep current with the environments I develop for, but I'm making more money than I'm spending on the references and tools. GCC is available for free, and it'll generate executable images for a wide range of environments, including the Wintel environments. You're welcome to use GNU products, or the Borland C compiler, or TinyC, or any of the other tools on the market if they fit your needs better than VC++. Just realize that the Win32 API is still going to work the same way, and you don't have the MS-provided support options available for these other products.

>> I think I already directed you to Jeff Richter's
>> "Advanced Windows" for more details on the
>> differences between a console app and a GUI-based app.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform