Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can I put my pc to sleep and wake it up from FoxPro?
Message
 
 
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00947872
Message ID:
00948176
Views:
19
>I would like to know if there is away that i can put my pc into sleep mode and then wake it up again at a later time from within foxpro? Or is there some other method I can use.
Declare SetSuspendState In Powrprof.dll ;
   Integer Hibernate ;
  , Integer ForceCritical ;
  , Integer DisableWakeEvent
? SetSuspendState(.T., .F., .F.)
I've not experimented, but I'm betting you can substitute -1 and 0 for .T. and .F.

Also you've not stated what OS you are using, I tested the above on Win2KPro SP4 VFP 6.
Powrprof.dll was in C:\WinNT\System32\.
From MSDN:
Client: Requires Windows XP, Windows 2000 Professional, Windows Me, or Windows 98.
Server: Requires Windows Server 2003 or Windows 2000 Server.
FYI, exported functions in DLL's have case sensitive names, so you might want to paste the Declare above as is!

As far as waking the PC up - this can only be done by an external action i.e. external to the PC that is shutdown / sleeping. FYI on my main development PC there are BIOS settings that allow auto booting at a certain time or on a certain date – not sure that helps you much. You might want to search Google for "wake on LAN" "magic-packet" I’ve e-mailed you some FoxPro code that might help.

Here is the Google URL as is - the UT seems to like to mess things up!
http://www.google.com/search?hl=en&ie=UTF-8&q=%22wake+on+LAN%22+%22magic-packet%22
censored.
Previous
Reply
Map
View

Click here to load this message in the networking platform