在 DelphiXe 中,我通过项目主创建控制面板的新小程序,更改图标、名称等。为了激活反应,我编写 Showmessage ('Test');在 *.cpl 中编译、接收 dll、重命名。在此文件开头的 win.explorer 中会显示该消息。在 WinXp 中,我将此文件插入 c:\windows\system32,打开控制面板 Windows,我看到了小程序,并且在其启动时测试消息突出。我在Win7x64(或2008r2)上做的太多,但在小程序的控制面板中我没有观察到,重启问题并没有解决。试图在c:\windows\syswow64 中复制一个文件,也没有结果。如何强制小程序出现在Win7下的面板中?
代码:
library Project1;
uses
CtlPanel,
AppletModule1 in 'AppletModule1.pas' {AppletModule1AppletModule: TAppletModule};
exports CPlApplet;
{$R *.RES}
{$E cpl}
begin
Application.Initialize;
Application.CreateForm(TAppletModule1AppletModule, AppletModule1AppletModule);
Application.Run;
end.
////////////// and Unit module
unit AppletModule1;
interface
uses
Windows, Messages, SysUtils, Classes, CtlPanel, Dialogs;
type
TAppletModule1AppletModule = class(TAppletModule)
procedure AppletModuleActivate(Sender: TObject; Data: Integer);
private
{ private declarations }
protected
{ protected declarations }
public
{ public declarations }
end;
var
AppletModule1AppletModule: TAppletModule1AppletModule;
implementation
{$R *.DFM}
procedure TAppletModule1AppletModule.AppletModuleActivate(Sender: TObject;
Data: Integer);
begin
Showmessage('Test');
end;
end.