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

  • With 81% of employees using their phones at work, companies have stopped asking: "Is corporate data leaking from personal devices?" and started asking: "How do we effectively prevent corporate data from leaking from personal devices?" The answer has not been simple. ZixOne raises the bar on BYOD security by not allowing email data to reside on the device. In addition, Zix allows employees to maintain complete control of their personal device, therefore satisfying privacy demands of valued employees and the …

  • Agile development principles have gone from something used only by cutting-edge teams to a mainstream approach used by teams large and small. If you're not using agile methods already though, or if you've only been exposed to agile on small projects here and there, you may wonder if agile can ever work in your environment. Read this eBook to learn the fundamentals of agile and how to increase the productivity of your software teams while enabling them to produce higher-quality solutions that better fulfill …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds