Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Mon Oct 14, 2019 6:03 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Any RB events on hibernate/sleep/shutdown?
PostPosted: Mon Dec 26, 2011 3:14 pm 
Offline

Joined: Sat Mar 25, 2006 1:39 pm
Posts: 894
Location: Morgan Hill, CA
Are there any RB events that are triggered in a running program when Windows goes into hibernate, sleep, or gets shut down? (I want to do some cleanup in all of these cases.)

Are there other events triggered when the system restarts from hibernate or sleep?

_________________
While fairly new to RB, I've been programming ever since that darned mastadon stepped on my abacus. Using RB 2009r5.1 on XP and Windows 7.


Top
 Profile  
Reply with quote  
 Post subject: Re: Any RB events on hibernate/sleep/shutdown?
PostPosted: Mon Dec 26, 2011 3:20 pm 
Offline

Joined: Mon May 31, 2010 5:35 am
Posts: 2412
Location: Netherlands
bob_barr wrote:
Are there any RB events that are triggered in a running program when Windows goes into hibernate, sleep, or gets shut down? (I want to do some cleanup in all of these cases.)

Are there other events triggered when the system restarts from hibernate or sleep?


App.Close() event?
perhaps as the app will be closed by windows, linux or mac osx.

Linux and mac osx might have signals but windows i think will do just App.Close

_________________
SWORT™
- Windows Vista, Windows XP, Windows 7, Linux Mint 11 and Mac OSX Lion
- REAL Studio Enterprise(latest) and WEB Edition(latest)
- Plugins (MBS Complete, ToringoLib, Einhugur, VanHoek + Some open source plugins)
For Dutch User Groups ask me to enter!


Top
 Profile  
Reply with quote  
 Post subject: Re: Any RB events on hibernate/sleep/shutdown?
PostPosted: Mon Dec 26, 2011 3:38 pm 
Offline

Joined: Sat Mar 25, 2006 1:39 pm
Posts: 894
Location: Morgan Hill, CA
Thanks. I'll check that out. I may be able to treat all three cases the same way if they all trigger the app.Close event. (Since I'm writing a Windows-only program, I don't need to worry about mac and linux.)

_________________
While fairly new to RB, I've been programming ever since that darned mastadon stepped on my abacus. Using RB 2009r5.1 on XP and Windows 7.


Top
 Profile  
Reply with quote  
 Post subject: Re: Any RB events on hibernate/sleep/shutdown?
PostPosted: Mon Dec 26, 2011 3:56 pm 
Offline

Joined: Mon May 31, 2010 5:35 am
Posts: 2412
Location: Netherlands
bob_barr wrote:
Thanks. I'll check that out. I may be able to treat all three cases the same way if they all trigger the app.Close event. (Since I'm writing a Windows-only program, I don't need to worry about mac and linux.)


you should just test it, as i have apps with tray items as well in windows.
They all seem to cleanup before the system shuts down.

Only when power is cut, they will loose data.

_________________
SWORT™
- Windows Vista, Windows XP, Windows 7, Linux Mint 11 and Mac OSX Lion
- REAL Studio Enterprise(latest) and WEB Edition(latest)
- Plugins (MBS Complete, ToringoLib, Einhugur, VanHoek + Some open source plugins)
For Dutch User Groups ask me to enter!


Top
 Profile  
Reply with quote  
 Post subject: Re: Any RB events on hibernate/sleep/shutdown?
PostPosted: Mon Dec 26, 2011 6:47 pm 
Offline

Joined: Sat Mar 25, 2006 1:39 pm
Posts: 894
Location: Morgan Hill, CA
I'm seeing the app.Deactivate event fire whenever the program's main window loses focus (for example, when you click on the Start button to go into hibernate or sleep). Besides that one, I'm not seeing any other events being triggered. (The CancelClose and Close events fire when exiting the program, of course.) There doesn't seem to be a way to detect that a hibernate or sleep has begun.

_________________
While fairly new to RB, I've been programming ever since that darned mastadon stepped on my abacus. Using RB 2009r5.1 on XP and Windows 7.


Top
 Profile  
Reply with quote  
 Post subject: Re: Any RB events on hibernate/sleep/shutdown?
PostPosted: Mon Dec 26, 2011 7:00 pm 
Offline

Joined: Mon May 31, 2010 5:35 am
Posts: 2412
Location: Netherlands
bob_barr wrote:
I'm seeing the app.Deactivate event fire whenever the program's main window loses focus (for example, when you click on the Start button to go into hibernate or sleep). Besides that one, I'm not seeing any other events being triggered. (The CancelClose and Close events fire when exiting the program, of course.) There doesn't seem to be a way to detect that a hibernate or sleep has begun.


No Hibernate or Sleep use System timeouts.
There are no RB events related to that, but maybe MonkeyBreadSoftware has it in it's plugins or you could try to use declares.

I will investigate it for you if i got some spare time left..;)

_________________
SWORT™
- Windows Vista, Windows XP, Windows 7, Linux Mint 11 and Mac OSX Lion
- REAL Studio Enterprise(latest) and WEB Edition(latest)
- Plugins (MBS Complete, ToringoLib, Einhugur, VanHoek + Some open source plugins)
For Dutch User Groups ask me to enter!


Top
 Profile  
Reply with quote  
 Post subject: Re: Any RB events on hibernate/sleep/shutdown?
PostPosted: Mon Dec 26, 2011 7:03 pm 
Offline

Joined: Mon May 31, 2010 5:35 am
Posts: 2412
Location: Netherlands
For use with declares (native RB code) you can learn more about the windows api here:
http://msdn.microsoft.com/en-us/library/windows/desktop/aa373223(v=vs.85).aspx

_________________
SWORT™
- Windows Vista, Windows XP, Windows 7, Linux Mint 11 and Mac OSX Lion
- REAL Studio Enterprise(latest) and WEB Edition(latest)
- Plugins (MBS Complete, ToringoLib, Einhugur, VanHoek + Some open source plugins)
For Dutch User Groups ask me to enter!


Top
 Profile  
Reply with quote  
 Post subject: Re: Any RB events on hibernate/sleep/shutdown?
PostPosted: Mon Dec 26, 2011 10:48 pm 
Offline

Joined: Sat Mar 25, 2006 1:39 pm
Posts: 894
Location: Morgan Hill, CA
Great link - thanks. That gives me something to go on. Time for a bit of testing.

_________________
While fairly new to RB, I've been programming ever since that darned mastadon stepped on my abacus. Using RB 2009r5.1 on XP and Windows 7.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group