Last updated on: 5/30/2013 8:55 PM
Created on: 3/21/2014 2:18 PM
The SC-7 framework is intended to run in the background but as an application and not a service. On Windows, this is known as a system tray app and for this reason, this interface class receives its name. The UI for the framework under Windows is accessed by the system tray icon. Events such as application start and application shutdown as well as system level events are funneled through this mechanism. Applets, by design, are intended to run with out any user interface interaction, this includes receiving events from a user interface based operating system. In order for applets to receive notifications that they need to perform initialization or that the framework is shutting down, the applet must implement the ISCSystemTrayExtenstion() interface.
The ISCSystemTrayExtension() is a simple interface of 7 methods and 3 pure virtual methods that must be implemented. Upon framework startup, the framework makes a call to OnSystemTrayCreate() to indicate that the framework is starting up. A post code as to the current status of the framework is passed in as a parameter and must be set to an error code if the creation routine can not be executed. While the framework is operational, there are two circumstances in which the framework will call OnSystemTrayStart(). The first reason is that the user initiated the SC-7 framework to run. This should be considered the first time that the applet is being started. OnSystemTrayStart() gets called each time the system resumes from a suspend operation, such as an idle computer resuming from being set to sleep (hibernate) mode.
There are three methods that handle the stop and shutdown side of the operations. CanSystemTrayShutdown() is called by the framework to query if all applets are in a state in which it is safe for the system to possibly hiberate, shutdown or the framework close. If all applets confirm that a system tray shut down event can occur, the OnSystemTrayStop() method is called to perform any actions the applets need to take to stop current operations. In the event that the framework is closing, OnSystemTrayDestroy() is called to have the applet release all resources of the system the applet may have currently obtained. Note that OnSystemTrayDestroy() is called at the conclusion of the framework running the applets and can no longer abort a shutdown operation, that must be done in OnSystemTrayStop().
If there is a chance in the system, such as thumbdrives are added or removed, OnSystemDeviceAlert() is called. This method is called for any of the device change notifications listed in the documentation and based on target platform, only a subset of those may be called. If a thumbdrive or USB drive is about to be removed this method gets called with DCN_DEVICEQUERYREMOVAL to allow the applet to abort the unmounting (undocking) of the device.
While the interface has references to system tray operations, in operating systems that don't have traditional system trays, such as Android, these methods will still be invoked by the framework so it is important that start up and shut down operations all take place with in this implementation.
TopicsDeveloper's Historical Persepctive Why A Platform Standards The User Experience
InterfacesISCApplet ISCTaskListExtension ISCConfigPanelExtension ISCErrorReporterExtension ISCLogConnector/ISCLogEntry ISCCertificateStoreExtension ISCSystemTrayExtension ISCAppletWindowExtension ISCSecureObjectExtension
Applet Building StepsStep 1: Create The Applet Step 2: Adding Action Items Step 3: Adding Configuration Panels Step 4: Adding Custom Error Text Step 5: Startup/Shutdown Step 6: Adding Main Window Support Step 7: Adding Obejct Window Support