开发者

Windows XP control panel - providing a value for the "comments" field

Where does the Windows XP control panel get the value for the "Comments" field from? I'm writing an EXE control panel applicati开发者_如何学Goon, and it doesn't appear from the documentation that you can provide a value for that field.

Windows XP control panel - providing a value for the "comments" field


Registering an Executable File (exe) as a Control Panel Applet on Windows Vista using Windows Installer XML (WIX) at Link


[previous answer]

See the Executable Control Panel Item Registration of Registering Control Panel Items at http://msdn.microsoft.com/en-us/library/cc144195(VS.85).aspx

Specifically, you want InfoTip, which is the comments.

Registering Control Panel Items

Control Panel items must be registered in order to appear in the Control Panel window. If the Control Panel item is implemented as part of a .exe file then it is registered as a command object. Registration differs if the item is implemented as a .dll file that exports the CPlApplet function.


Using CPLApplet:

When Control Panel loads a .dll (or .cpl) file, it calls the CPlApplet function to get information such as the number of Control Panel items the file hosts, as well as information about each item.

When Windows first loads the Control Panel item, it retrieves the address of the CPlApplet function and subsequently uses that address to call the function and pass it messages. It might send the following messages.

You need to handle CPL_INQUIRE Message and fill the CPLINFO Structure.

typedef struct tagCPLINFO {
  int      idIcon;
  int      idName;
  int      idInfo;
  LONG_PTR lpData;
} CPLINFO;

idInfo is the resource identifier of the string containing the description. You cannot simply set this thing by filling in some registry key.

Edit: Ok, my bad, this is an old solution.


This string is retrieved from the HKCR\CLSID{guid}\InfoTip registry value. How to whack the registry into shape is explained very well in this MSDN Library article, not much I can add to that.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜