///这是由GUIDGEN产生的GUID:{06926B30-424E-4f1c-8EE3-543CD96573DC}
CRegKey reg;
char KeyName[]="Software\\Microsoft\\Internet Explorer\\Extensions\\{06926B30-424E-4f1c-8EE3-543CD96573DC}";
TCHAR PathName[MAX_PATH];
TCHAR IconPathName[MAX_PATH]; ///正常时的图标全路径
TCHAR HotIconPathName[MAX_PATH]; ///鼠标覆盖时的图标全路径
GetModuleFileName(0,PathName,MAX_PATH); ///得到本可执行文件的路径
strcpy(IconPathName,PathName);
strcpy(HotIconPathName,PathName);
strcat(HotIconPathName,",227"); ///131是图标的ID,你可以以资源方式打开EXE文件就可以看到所有资源及其ID
strcat(IconPathName,",228");
reg.Create(HKEY_LOCAL_MACHINE,KeyName);
reg.SetValue("{1FBA04EE-3024-11D2-8F1F-0000F87ABD16}","CLSID");
reg.SetValue("Yes","Default Visible");
reg.SetValue("按钮提示文本","ButtonText");
reg.SetValue(IconPathName,"Icon");
reg.SetValue(HotIconPathName,"HotIcon");
/////假如是执行脚本,可以是reg.SetValue("c:\\test.html","Script"); ///在test.html 存放你的脚本代码
reg.SetValue(PathName,"Exec");///打开网页
阅读(1221) | 评论(0) | 转发(0) |