Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » Newbie corner » Ctrl::Quit() and system shutdown
Ctrl::Quit() and system shutdown [message #35558] Wed, 29 February 2012 11:06 Go to previous message
jjacksonRIAB is currently offline  jjacksonRIAB
Messages: 220
Registered: June 2011
Experienced Member
How do I override a system shutdown to prompt a user, for example, to save their files?

Quit() does not seem to be called when I do a system shutdown, log off, or reboot on either Windows or Linux.

Just using modified example code:

#include <CtrlLib/CtrlLib.h>
 
using namespace Upp;
 
#define IMAGECLASS Tray
#define IMAGEFILE  <TrayIcon/tray.iml>
#include <Draw/iml.h>
 
struct App : TrayIcon {
    virtual void LeftDouble() {
        Icon(Tray::Icon1());
        PromptOK("TrayIcon launched this prompt!");
        Icon(Tray::Icon());
    }
    
    virtual void Quit() {
        PromptOK("Quitting...");
	Break();
    }
    
    virtual void LeftDown() {
        Info("TrayIcon", "You have clicked the TrayIcon!\n""TrayIcon is U++ reference example.");
    }
 
    virtual void Menu(Bar& bar) {
        bar.Add("Info..", THISBACK(LeftDouble));
        bar.Separator();
        bar.Add("Exit", THISBACK(Quit));
    }
 
    typedef App CLASSNAME;
 
    App() {
        Icon(Tray::Icon());
        Tip("This is U++ TrayIcon");
    }
};
 
GUI_APP_MAIN
{
    App().Run();
}


If I shutdown, the PromptOK window never shows, but it does show when I select Exit...

[Updated on: Wed, 29 February 2012 12:10]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Previous Topic: EditDouble background color
Next Topic: Using TheIDE/U++ and Visual Studio 2008/2010 IDE as a team in a project
Goto Forum:
  


Current Time: Mon Apr 29 04:38:50 CEST 2024

Total time taken to generate the page: 0.05099 seconds