【发布时间】:2023-03-24 12:27:01
【问题描述】:
在 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.
【问题讨论】:
-
顾,你少了几个步骤(关于注册)。尝试阅读 MSDN 文档msdn.microsoft.com/en-us/library/bb757044.aspx
-
谢谢!不知道,现在小程序也有注册需求。将标记您对答案的评论质量,但我不知道要在这里制作。
标签: delphi windows-7 control-panel