|Products Purchase Publishing Articles Support Company Contact|
support > Product FAQ > SpyWorks > Control Panel Applets
Event Log Toolkit
NT Service Toolkit
Frequently Asked Questions - Control Panel Applets
1. I use SpyWorks to create a Control Panel Applet. On certain systems, under certain circumstances, I get an error message "An error occurred while Windows was working with Control Panel file C:\Windows\System\MyCplApp.cpl" when I closed the Control Panel. This message may appear even though I did not open up my Control Panel Applet.
We found an undocumented "behavior" of the Control Panel. Under certain circumstances, the Control Panel may send a Control Panel Applet the CPL_INIT message when the Control Panel (not the Control Panel Applet) is opened. The purpose of sending this message is to enumerate the number of applets or to retrieve an applet's icon. When this occurs, the applet will not receive a corresponding CPL_STOP or CPL_EXIT message when it is unloaded (immediately after all the applets have been enumerated or after the icons have been retrieved). Also, in this weird situation, the Control Panel will send the CPL_STOP and CPL_EXIT messages (without a corresponding CPL_INIT message) to the applets when the Control Panel is closed. In our Control Panel Applet implementation, we create a global dwExporter object on CPL_INIT and destroy it on CPL_STOP or CPL_EXIT. Our implementation will trigger an error when our applet receives a CPL_STOP in this weird situation because we never received a corresponding CPL_INIT to create our object in the first place. The solution is to verify that the dwExporter object exists before attempting to destroy it. In the Select Case for the CPL_STOP and CPL_EXIT messages of the CPLApplet function, change the code from:
Set holder = Nothing
If Not holder Is Nothing Then Set holder = Nothing
2. I'm trying to create a Control Panel Applet but am confused about the steps required to create one.
The easiest way to create a new Control Panel Applet is to start with our example as a template.
|Products Purchase Articles Support Company Contact