Control Panel Applet Framework

 Download Source Code and Example

The Windows Control Panel is the ideal way to allow a user to alter settings for an application that runs in the background, or automatically. But what are control panel applets and how do you write one? Well, after some exploring in the MSDN I discovered that control panel applets are just standard DLLs with a particular set of entry points and a .cpl extension. Place such a file in the Windows System directory and the next time you start up control panel your applet will be there. Having discovered what I needed to know I set about writing a control panel applet and once I'd done that, I turned the bulk of the code into a mini applet framework so I wouldn't have to write it ever again!

To implement your control panel applet all you need to do is the following:
  • include "ControlApplet.hpp" and publicly derive a class from CJBControlPanelApplet.
  • call the CJBControlPanelApplet constructor and pass resource IDs for the applet's icon, name and description.
  • implement the pure virtual function OnDoubleClick() - this is where your applet becomes live and can display a dialog or whatever.
  • create an instance of your applet class at global scope.
  • link with ControlApplet.cpp and include ControlApplet.def in your project. ControlApplet.cpp gives you the implementation of CJBControlPanelApplet and suitable DllMain() and CPlApplet() DLL entry point functions.

So that this article and code can be kept up to date more easily I've provided a link to where the article is located on my own web pages. Read the full article and download the source code.

Last updated: 27 June 1998



Comments

  • Win 2000 and XP

    Posted by Legacy on 07/14/2002 12:00am

    Originally posted by: V-man

    Do any of you guys know how to get a control panel applcaition working in win2000 and XP?

    I'm having trouble with mine. Is this project working for you?

    V-man

    Reply
  • links is not dead

    Posted by Legacy on 02/18/2002 12:00am

    Originally posted by: Bob Thiry

    http://www.jetbyte.com/portfolio-showarticle.asp?articleId=11&catId=1&subcatId=2

    Reply
  • The download link is dead!

    Posted by Legacy on 02/11/2002 12:00am

    Originally posted by: Bug Alert

    Damn it.

    Reply
  • ControlPanel and MFC

    Posted by Legacy on 06/09/1999 12:00am

    Originally posted by: Michael Knoke

    The Framework for ControlPanel Applets works great, but
    I'm not able to make a ControlPanel DLL which uses MFC
    CPropertySheet.
    Each time I'm executing the ControlPanel it opens and
    shows the PropertySheet, but I get immediately a dialog
    window "Control Panel failure..." and a OK button to quit.

    The modal loop from CPropertySheet gets a wrong message
    (message pointer 0x00000038).

    What's wrong.. Has somebody an example?

    ciao..

    Michael

    Reply
  • add app into "keyboard" of control panel

    Posted by Legacy on 03/08/1999 12:00am

    Originally posted by: leaval wang

    Hi , i am leaval wang . i am in China . i met a question about control panel applet . i have written a program whose function is definition of hotkey , and i want to put it into "keyboard" of control panel , likely server it as a property page of "keyboard". would you give me some advice. thank you.

    Reply
Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • A modern mobile IT strategy is no longer an option, it is an absolute business necessity. Today's most productive employees are not tied to a desk, an office, or a location. They are mobile. And your company's IT strategy has to be ready to support them with easy, reliable, 24/7 access to the business information they need, from anywhere in the world, across a broad range of communication devices. Here's how some of the nation's most progressive corporations are meeting the many needs of their mobile workers …

  • As mobile devices have pushed their way into the enterprise, they have brought cloud apps along with them. This app explosion means account passwords are multiplying, which exposes corporate data and leads to help desk calls from frustrated users. This paper will discover how IT can improve user productivity, gain visibility and control over SaaS and mobile apps, and stop password sprawl. Download this white paper to learn: How you can leverage your existing AD to manage app access. Key capabilities to …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds