Control panel Win7 applets

倖福魔咒の 提交于 2019-12-02 08:17:42

On XP, you can drop the .cpl file into the system folder and be done with it:

How to Register DLL Control Panel Items

As of Windows XP, new Control Panel item DLLs should be installed in the associated application's folder under the Program Files folder. Items that are stored in the System32 directory with a .cpl extension do not need to be registered; they are automatically shown in the Control Panel. All other Control Panel items that use CPlApplet must be registered in one of two ways:

  • If the Control Panel item is to be available to all users, register the path on a per-computer basis by adding a REG_EXPAND_SZ value to the HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Control Panel\Cpls subkey, set to the DLL path.

  • If the Control Panel item is to be available on a per-user basis, use HKEY_CURRENT_USER as the root key instead of HKEY_LOCAL_MACHINE.

However, on Vista and later, your .cpl applet needs to be registered in the Registry. Dropping it in the system folder may not be enough.

Developing for the Control Panel

Types of Control Panel Applets
There are three types of Control Panel applets:

  • Command objects—applets that run commands specified in the registry

  • Shell folders—applets open up in the Control Panel. Examples of shell folder applets are the Fonts Folder, Administrative Tools, Personalization, System, User Accounts, and Programs

  • CPLs—applets that implement the CplApplet function

Command objects are the easiest to implement.

Adding and Registering Your Own Applets and Tasks
Adding your own applet to Control Panel is easier in Windows Vista. Software developers can now easily add their own applets and tasks to Control Panel.

In previous versions of Windows, you add applets to the Control Panel by using the Windows Registry and the CplApplet function. The operating system uses the Registry to enumerate the modules containing the applets. Each module's CplApplet function is called to display the applet, its icon and description, and then invoke the applet. This process is more complicated than using command objects because the applet must implement the CplApplet Interface. Although this process is still supported in Windows Vista, using command objects is encouraged since it is easier to implement.

Now, in Windows Vista, you can just write an executable (.exe), register it as a command object and the applet appears in Control Panel. For example, you can write an executable, MySystemApplet.exe, for your applet and add the applet to Control Panel by simply registering MySystemApplet.exe as a shell command object instead of tediously modifying the binary with an implementation of the CplApplet interface.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!