If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
System wake up from Standby/Hibernate to be done Programmatically
Hi
I want the system to wake up from Sleep/Hibernate through an application without user intervention.In this case even I dont know after how much time the system needs to be waken up.It shall be based on certain event only. No prior time is known that after 't' seconds the system shall wake up. Pls let me know how it can be done in VC++. Any WIN 32 API's available for the same. Regards |
Ads |
#2
|
|||
|
|||
System wake up from Standby/Hibernate to be done Programmatically
Do you mean that you will be using a hardware event to wake the machine from
hibernation or sleep and then you need to have a user mode application do something when the machine wakes up? -- John Hensley www.resqware.com "bhatia" wrote: Hi I want the system to wake up from Sleep/Hibernate through an application without user intervention.In this case even I dont know after how much time the system needs to be waken up.It shall be based on certain event only. No prior time is known that after 't' seconds the system shall wake up. Pls let me know how it can be done in VC++. Any WIN 32 API's available for the same. Regards |
#3
|
|||
|
|||
System wake up from Standby/Hibernate to be done Programmatica
Hi John
Yeah the lid open event for my notebook shall trigger the wake up for the system but I donot want any user intervention after he opens the lid i.e. he shall be not pressing any keys to wake up the system. Is there any method to do so or any Windows API to handle this scenario??? regards bhatia "John Hensley" wrote: Do you mean that you will be using a hardware event to wake the machine from hibernation or sleep and then you need to have a user mode application do something when the machine wakes up? -- John Hensley www.resqware.com "bhatia" wrote: Hi I want the system to wake up from Sleep/Hibernate through an application without user intervention.In this case even I dont know after how much time the system needs to be waken up.It shall be based on certain event only. No prior time is known that after 't' seconds the system shall wake up. Pls let me know how it can be done in VC++. Any WIN 32 API's available for the same. Regards |
#4
|
|||
|
|||
System wake up from Standby/Hibernate to be done Programmatica
bhatia,
It will depend upon your notebook as to whether it can be configured to wake up from suspend automatically when the lid is opened. My Toshiba for example, is configured to automatically hibernate when I close the lid and automatically resume when the lid is opened. There is a tab on the power options that allows me to configure the setting controlling this. A Win32 application can tell when the machine wakes up from sleep or hibernation by monitoring the WM_POWERBROADCAST message in its message handler. -- John Hensley www.resqware.com "bhatia" wrote: Hi John Yeah the lid open event for my notebook shall trigger the wake up for the system but I donot want any user intervention after he opens the lid i.e. he shall be not pressing any keys to wake up the system. Is there any method to do so or any Windows API to handle this scenario??? regards bhatia "John Hensley" wrote: Do you mean that you will be using a hardware event to wake the machine from hibernation or sleep and then you need to have a user mode application do something when the machine wakes up? -- John Hensley www.resqware.com "bhatia" wrote: Hi I want the system to wake up from Sleep/Hibernate through an application without user intervention.In this case even I dont know after how much time the system needs to be waken up.It shall be based on certain event only. No prior time is known that after 't' seconds the system shall wake up. Pls let me know how it can be done in VC++. Any WIN 32 API's available for the same. Regards |
#5
|
|||
|
|||
System wake up from Standby/Hibernate to be done Programmatica
Hi John
Thanx for your response.Whatever you have said here that is perfectly ok.I can do that setting on my notebook.But what if the same thing has to be done by my application i.e. wherein application wakes up the system on its own when the lid is opened.This needs to be done programatically.Moreover what you say for the notification message WM_POWERBROADCAST.That is bieng sent by the OS only when the resume operation has been initiated.I want my application to initiate the Resume operation and then OS will be firing the broadcast message to other applications etc. E.g. I can specify the time at which system shall resume after sleep using SetThreadExecutionState() API in XP but that is not the correct solution and moreover this API is used when the system has to be waken up for short duration to carry out some task and then after completion of the task it should go to sleep again. I hope I'm able to explain what I want for my application. Regards Bhatia "John Hensley" wrote: bhatia, It will depend upon your notebook as to whether it can be configured to wake up from suspend automatically when the lid is opened. My Toshiba for example, is configured to automatically hibernate when I close the lid and automatically resume when the lid is opened. There is a tab on the power options that allows me to configure the setting controlling this. A Win32 application can tell when the machine wakes up from sleep or hibernation by monitoring the WM_POWERBROADCAST message in its message handler. -- John Hensley www.resqware.com "bhatia" wrote: Hi John Yeah the lid open event for my notebook shall trigger the wake up for the system but I donot want any user intervention after he opens the lid i.e. he shall be not pressing any keys to wake up the system. Is there any method to do so or any Windows API to handle this scenario??? regards bhatia "John Hensley" wrote: Do you mean that you will be using a hardware event to wake the machine from hibernation or sleep and then you need to have a user mode application do something when the machine wakes up? -- John Hensley www.resqware.com "bhatia" wrote: Hi I want the system to wake up from Sleep/Hibernate through an application without user intervention.In this case even I dont know after how much time the system needs to be waken up.It shall be based on certain event only. No prior time is known that after 't' seconds the system shall wake up. Pls let me know how it can be done in VC++. Any WIN 32 API's available for the same. Regards |
#6
|
|||
|
|||
System wake up from Standby/Hibernate to be done Programmatica
There is no way for a Win32 application to resume the OS based on a hardware
event. The OS must be resumed before a Win32 application can do anything. To do what I think you are suggesting would require writing a kernel mode driver that intercepted the hardware event that is generated when the laptop lid is opened. A kernel mode driver could then decide if the OS should be resumed completely or go immediately back to sleep or into hibernation without resuming completely. -- John Hensley www.resqware.com "bhatia" wrote: Hi John Thanx for your response.Whatever you have said here that is perfectly ok.I can do that setting on my notebook.But what if the same thing has to be done by my application i.e. wherein application wakes up the system on its own when the lid is opened.This needs to be done programatically.Moreover what you say for the notification message WM_POWERBROADCAST.That is bieng sent by the OS only when the resume operation has been initiated.I want my application to initiate the Resume operation and then OS will be firing the broadcast message to other applications etc. E.g. I can specify the time at which system shall resume after sleep using SetThreadExecutionState() API in XP but that is not the correct solution and moreover this API is used when the system has to be waken up for short duration to carry out some task and then after completion of the task it should go to sleep again. I hope I'm able to explain what I want for my application. Regards Bhatia "John Hensley" wrote: bhatia, It will depend upon your notebook as to whether it can be configured to wake up from suspend automatically when the lid is opened. My Toshiba for example, is configured to automatically hibernate when I close the lid and automatically resume when the lid is opened. There is a tab on the power options that allows me to configure the setting controlling this. A Win32 application can tell when the machine wakes up from sleep or hibernation by monitoring the WM_POWERBROADCAST message in its message handler. -- John Hensley www.resqware.com "bhatia" wrote: Hi John Yeah the lid open event for my notebook shall trigger the wake up for the system but I donot want any user intervention after he opens the lid i.e. he shall be not pressing any keys to wake up the system. Is there any method to do so or any Windows API to handle this scenario??? regards bhatia "John Hensley" wrote: Do you mean that you will be using a hardware event to wake the machine from hibernation or sleep and then you need to have a user mode application do something when the machine wakes up? -- John Hensley www.resqware.com "bhatia" wrote: Hi I want the system to wake up from Sleep/Hibernate through an application without user intervention.In this case even I dont know after how much time the system needs to be waken up.It shall be based on certain event only. No prior time is known that after 't' seconds the system shall wake up. Pls let me know how it can be done in VC++. Any WIN 32 API's available for the same. Regards |
#7
|
|||
|
|||
System wake up from Standby/Hibernate to be done Programmatica
Hi John
Thanx for your reply.But if we see our notebooks when we press Fn + F4 keys the system wakes up.That is again Hardware event generated from keyboard and it wakes up the system.Maybe as you have said in this case it might be because of some driver that invokes the system wake up.Can you let me know how it happens when Fn + F4 keys are pressed? Maybe it can be a clue for me. Thanks and regards bhatia "John Hensley" wrote: There is no way for a Win32 application to resume the OS based on a hardware event. The OS must be resumed before a Win32 application can do anything. To do what I think you are suggesting would require writing a kernel mode driver that intercepted the hardware event that is generated when the laptop lid is opened. A kernel mode driver could then decide if the OS should be resumed completely or go immediately back to sleep or into hibernation without resuming completely. -- John Hensley www.resqware.com "bhatia" wrote: Hi John Thanx for your response.Whatever you have said here that is perfectly ok.I can do that setting on my notebook.But what if the same thing has to be done by my application i.e. wherein application wakes up the system on its own when the lid is opened.This needs to be done programatically.Moreover what you say for the notification message WM_POWERBROADCAST.That is bieng sent by the OS only when the resume operation has been initiated.I want my application to initiate the Resume operation and then OS will be firing the broadcast message to other applications etc. E.g. I can specify the time at which system shall resume after sleep using SetThreadExecutionState() API in XP but that is not the correct solution and moreover this API is used when the system has to be waken up for short duration to carry out some task and then after completion of the task it should go to sleep again. I hope I'm able to explain what I want for my application. Regards Bhatia "John Hensley" wrote: bhatia, It will depend upon your notebook as to whether it can be configured to wake up from suspend automatically when the lid is opened. My Toshiba for example, is configured to automatically hibernate when I close the lid and automatically resume when the lid is opened. There is a tab on the power options that allows me to configure the setting controlling this. A Win32 application can tell when the machine wakes up from sleep or hibernation by monitoring the WM_POWERBROADCAST message in its message handler. -- John Hensley www.resqware.com "bhatia" wrote: Hi John Yeah the lid open event for my notebook shall trigger the wake up for the system but I donot want any user intervention after he opens the lid i.e. he shall be not pressing any keys to wake up the system. Is there any method to do so or any Windows API to handle this scenario??? regards bhatia "John Hensley" wrote: Do you mean that you will be using a hardware event to wake the machine from hibernation or sleep and then you need to have a user mode application do something when the machine wakes up? -- John Hensley www.resqware.com "bhatia" wrote: Hi I want the system to wake up from Sleep/Hibernate through an application without user intervention.In this case even I dont know after how much time the system needs to be waken up.It shall be based on certain event only. No prior time is known that after 't' seconds the system shall wake up. Pls let me know how it can be done in VC++. Any WIN 32 API's available for the same. Regards |
#8
|
|||
|
|||
System wake up from Standby/Hibernate to be done Programmatica
When the system is in hibernation the machine is completely turned off with
the exception of a tiny amount of current that is used to power the electronic switching circuit for turning on the main power to the computer. This switching circuit is connected to any switches such as the lid switch or function key that be used to power on the computer. When one of these switching circuits turns on the main power to the computer the computer boots up just like any computer when it is first turned on. The ROMBIOS does its POST initialization and then loads the first sector of the hard disk into memory and executes the bootstrap code that is located in the first disk sector. The bootstrap code loads NTLOADER from the root directory of the hard drive and then NTLOADER reads the hibernation file from the hard disk into memory by reading sectors on the hard disk using the ROMBIOS int 13h disk interface API. The hibernation file is an image of the computer's memory that was written to the hard drive when the computer went into hibernation. After the hibernation file is read into memory, NTLOADER executes Windows kernel code that does any re-initializes of the kernel mode device drivers and then re-initializes the Windows GUI interface processes security logon and then resumes execution of Win32 applications and services at the point the computer was it was at when it went into hibernation. As you can see from this brief overview there are no drivers involved in actually waking a computer from hibernation and in fact the drivers are not even re-initialized until just before the computer is about to resume normal execution. Waking a computer up that is in sleep mode is very similar with the exception that power is turned off for everything but the computer memory so that memory does not need to be written to the hard drive. But the switching circuits are still used to turn on the main power to all of the other circuits when it is necessary to wake the machine. Again there are no drivers involved in actually waking the machine from sleep mode, it is done in the electronic switching ciruits. -- John Hensley www.resqware.com "bhatia" wrote: Hi John Thanx for your reply.But if we see our notebooks when we press Fn + F4 keys the system wakes up.That is again Hardware event generated from keyboard and it wakes up the system.Maybe as you have said in this case it might be because of some driver that invokes the system wake up.Can you let me know how it happens when Fn + F4 keys are pressed? Maybe it can be a clue for me. Thanks and regards bhatia "John Hensley" wrote: There is no way for a Win32 application to resume the OS based on a hardware event. The OS must be resumed before a Win32 application can do anything. To do what I think you are suggesting would require writing a kernel mode driver that intercepted the hardware event that is generated when the laptop lid is opened. A kernel mode driver could then decide if the OS should be resumed completely or go immediately back to sleep or into hibernation without resuming completely. -- John Hensley www.resqware.com "bhatia" wrote: Hi John Thanx for your response.Whatever you have said here that is perfectly ok.I can do that setting on my notebook.But what if the same thing has to be done by my application i.e. wherein application wakes up the system on its own when the lid is opened.This needs to be done programatically.Moreover what you say for the notification message WM_POWERBROADCAST.That is bieng sent by the OS only when the resume operation has been initiated.I want my application to initiate the Resume operation and then OS will be firing the broadcast message to other applications etc. E.g. I can specify the time at which system shall resume after sleep using SetThreadExecutionState() API in XP but that is not the correct solution and moreover this API is used when the system has to be waken up for short duration to carry out some task and then after completion of the task it should go to sleep again. I hope I'm able to explain what I want for my application. Regards Bhatia "John Hensley" wrote: bhatia, It will depend upon your notebook as to whether it can be configured to wake up from suspend automatically when the lid is opened. My Toshiba for example, is configured to automatically hibernate when I close the lid and automatically resume when the lid is opened. There is a tab on the power options that allows me to configure the setting controlling this. A Win32 application can tell when the machine wakes up from sleep or hibernation by monitoring the WM_POWERBROADCAST message in its message handler. -- John Hensley www.resqware.com "bhatia" wrote: Hi John Yeah the lid open event for my notebook shall trigger the wake up for the system but I donot want any user intervention after he opens the lid i.e. he shall be not pressing any keys to wake up the system. Is there any method to do so or any Windows API to handle this scenario??? regards bhatia "John Hensley" wrote: Do you mean that you will be using a hardware event to wake the machine from hibernation or sleep and then you need to have a user mode application do something when the machine wakes up? -- John Hensley www.resqware.com "bhatia" wrote: Hi I want the system to wake up from Sleep/Hibernate through an application without user intervention.In this case even I dont know after how much time the system needs to be waken up.It shall be based on certain event only. No prior time is known that after 't' seconds the system shall wake up. Pls let me know how it can be done in VC++. Any WIN 32 API's available for the same. Regards |
#9
|
|||
|
|||
System wake up from Standby/Hibernate to be done Programmatically
Hi John, I wanted to get some clarification from you on something you posted. ------------------- My Toshiba for example, is configured to automatically hibernate when I close the lid and automatically resume when the lid is opened. There is a tab on the power options that allows me to configure the setting controlling this. ------------------- How do you configure what your Toshiba laptop does when you open the lid? I have not found anything to allows you to configure this. I have my Toshiba laptop set to hibernate when I close the lid. However, my lid is starting to get loose and sometimes in my laptop bag it will open slightly and Windows will resume until the battery dies. I want my laptop to not resume when the lid is opened. I want to open the lid and press the power button to resume Widnows. Is that possible? Thanks, Lisa -- lagay ------------------------------------------------------------------------ lagay's Profile: http://forums.techarena.in/member.php?userid=26222 View this thread: http://forums.techarena.in/showthread.php?t=751643 http://forums.techarena.in |
#10
|
|||
|
|||
System wake up from Standby/Hibernate to be done Programmatica
Hi Lisa,
On my Toshiba Satellite there is a "Toshiba Power Saver" Control Panel applette that can be used to change what happens when the lid is closed and opened. To get to this setting I go into the Control Panel - Toshiba Power Saver - Power Save Modes - Details - System Power Mode. In this dialog there is a drop down list for "When I close the lid" that can be set to "No action". After changing the setting to "No action" I can hibernate manually before closing the lid and then when I open the lid nothing happens until I press the power button. -- John Hensley www.resqware.com "lagay" wrote: Hi John, I wanted to get some clarification from you on something you posted. ------------------- My Toshiba for example, is configured to automatically hibernate when I close the lid and automatically resume when the lid is opened. There is a tab on the power options that allows me to configure the setting controlling this. ------------------- How do you configure what your Toshiba laptop does when you open the lid? I have not found anything to allows you to configure this. I have my Toshiba laptop set to hibernate when I close the lid. However, my lid is starting to get loose and sometimes in my laptop bag it will open slightly and Windows will resume until the battery dies. I want my laptop to not resume when the lid is opened. I want to open the lid and press the power button to resume Widnows. Is that possible? Thanks, Lisa -- lagay ------------------------------------------------------------------------ lagay's Profile: http://forums.techarena.in/member.php?userid=26222 View this thread: http://forums.techarena.in/showthread.php?t=751643 http://forums.techarena.in |
#11
|
|||
|
|||
System wake up from Standby/Hibernate to be done Programmatically
Hi John, I changed my "close lid" to "no actoin", hibernated manually, closed the lid, reopened the lid and it automatically resumed Windows. I have no idea how to get the open lid to stop the resume. I have a Toshiba Tecra A4 laptop about 2 years old. Lisa -- lagay ------------------------------------------------------------------------ lagay's Profile: http://forums.techarena.in/member.php?userid=26222 View this thread: http://forums.techarena.in/showthread.php?t=751643 http://forums.techarena.in |
#12
|
|||
|
|||
System wake up from Standby/Hibernate to be done Programmatica
Lisa,
You need to be sure to change the settings in both the top and bottom windows on the "Power Saver Properties" page. The top window is for settings that apply when the laptop is plugged in and the bottom windows is for settings that apply when the laptop is running from the battery. I've also found that the changes are sometimes lost if I don't click the "Apply" button before the "OK" button that closes the "Power Saver Properties" page. -- John Hensley www.resqware.com "lagay" wrote: Hi John, I changed my "close lid" to "no actoin", hibernated manually, closed the lid, reopened the lid and it automatically resumed Windows. I have no idea how to get the open lid to stop the resume. I have a Toshiba Tecra A4 laptop about 2 years old. Lisa -- lagay ------------------------------------------------------------------------ lagay's Profile: http://forums.techarena.in/member.php?userid=26222 View this thread: http://forums.techarena.in/showthread.php?t=751643 http://forums.techarena.in |
#13
|
|||
|
|||
System wake up from Standby/Hibernate to be done Programmatically
Hi John, My Power Saver Properties windows looks slightly different than what you are describing. I've attached a screen shot of what mine looks like and the only place I can set the Close Lid option is under the Setup Action tab. Thanks, Lisa +-------------------------------------------------------------------+ |Filename: powersettings.JPG | |Download: http://forums.techarena.in/attachment.php?attachmentid=6301| +-------------------------------------------------------------------+ -- lagay ------------------------------------------------------------------------ lagay's Profile: http://forums.techarena.in/member.php?userid=26222 View this thread: http://forums.techarena.in/showthread.php?t=751643 http://forums.techarena.in |
#14
|
|||
|
|||
System wake up from Standby/Hibernate to be done Programmatica
Lisa,
On the left side of the dialog you need to select the profile that is used when running on batteries. Select the "Normal" lightbulb that has the battery beside it and then select the "No action" for "When I close the lid". You may need to also change this for all of the other lightbulbs below the "Normal" lightbulb depending on what profile is in use on your computer. -- John Hensley www.resqware.com "lagay" wrote: Hi John, My Power Saver Properties windows looks slightly different than what you are describing. I've attached a screen shot of what mine looks like and the only place I can set the Close Lid option is under the Setup Action tab. Thanks, Lisa +-------------------------------------------------------------------+ |Filename: powersettings.JPG | |Download: http://forums.techarena.in/attachment.php?attachmentid=6301| +-------------------------------------------------------------------+ -- lagay ------------------------------------------------------------------------ lagay's Profile: http://forums.techarena.in/member.php?userid=26222 View this thread: http://forums.techarena.in/showthread.php?t=751643 http://forums.techarena.in |
#15
|
|||
|
|||
System wake up from Standby/Hibernate to be done Programmatically
Unforunately, the light bulbs only apply to the Basic Setup tab. The Setup Action tab only has the "When I close the lid" option and the light bulbs are not available for selection when teh Setup Action tab is selected. Even though it might look that way, the two tabs don't work together. -- lagay ------------------------------------------------------------------------ lagay's Profile: http://forums.techarena.in/member.php?userid=26222 View this thread: http://forums.techarena.in/showthread.php?t=751643 http://forums.techarena.in |
|
Thread Tools | |
Display Modes | |
|
|