Demo Control Panel Application

Environment: Win 9x/NT/2000 and Visual C++ 6

While not being very fancy, this application (called ControlPanel) is a small
demonstration of how the real Windows Control Panel functions.

When the Control Panel is launched, it looks for .cpl files in the Windows
system folder. The .cpl files (called applets) are simple DLLs that export the CPlApplet
function. For each applet found, the Control Panel loads that DLL with the ::LoadLibrary
function call and then uses the GetProcAddress function to realize a pointer
to the CPlApplet function. For each applet, it calls the CPlApplet function by passing it different messages such
as CPL_INIT, CPL_INQUIRE etc. You can get help about different messages in the online help of
MSDN.

When the Control Panel calls the CPlApplet function with CPL_INQUIRE message, the .cpl file
returns a CPLINFO structure which holds information about that perticular applet such
as its name, icon, info tip etc. When the Control Panel applet is double-clicked by
the user, the CPlApplet function is called with the CPL_DBLCLK value. At this point,
the applet generally displays a dialog from which the user can interact with the
applet.

Downloads

Download demo project – 32 KB

Download source – 46 KB

More by Author

Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends & analysis

Must Read