是使用控制面版里的功能还是……
如果是前者可以使用API
UNIT WinExec(LPCSTR lpCmdLine,UINT uCmdShow);
如
x=:winexec('rundll32.exe shell32.dll,Control_RunDLL access.col,,3,',9);
如果是前者可以使用API
UNIT WinExec(LPCSTR lpCmdLine,UINT uCmdShow);
如
x=:winexec('rundll32.exe shell32.dll,Control_RunDLL access.col,,3,',9);
而且你可以到delphi.mychangshu.com里面去下载这本书的源码
具体怎么写这些.cpl,可以参考“深度历险”这本书,里面有详细介绍。
下面是个书上的例子
library hellocpl; // 盢 program э library, ボ璶籹 DLLuses
Windows,
SysUtils,
Dialogs,
CPL; // 级糶 Control Panel Applet 祘Αゲ斗 uses CPL.PAS{$R hello.res} // 硈挡戈方郎procedure MsgBox(const Msg: string);
begin
MessageBox(0, PChar(Msg), 'Hello, Control Panel',
MB_ICONINFORMATION);
end;function CPlApplet(hwndCPL: HWND; uMsg: UINT;
lParam1: LPARAM; lParam2: LPARAM): LongInt; stdcall;
var
pInfo: PCPlInfo;
begin
case uMsg of
CPL_INIT:
begin
MsgBox('Μ CPL_INIT !!');
Result := 1; // Θ
end;
CPL_GETCOUNT:
begin
MsgBox('Μ CPL_GETCOUNT !!');
Result := 1; // じン
end;
CPL_INQUIRE:
begin
MsgBox('Μ CPL_INQUIRE !!');
pInfo := PCPlInfo(lParam2);
with pInfo^ do
begin
idName := 1; // 嘿 Resource ID
idInfo := 2; // 磞瓃 Resource ID
idIcon := 5; // 瓜ボ Resource ID
lData := 0; // ぃ惠ㄏノ璹戈
end;
end; CPL_NEWINQUIRE:
begin
MsgBox('Μ CPL_NEWINQUIRE !!');
end; CPL_DBLCLK:
begin
MsgBox('Μ CPL_DBLCLK !!'); MsgBox('顿, и琌程ォ北じン !!');
Result := 0; // Θ
end;
CPL_STOP:
begin
MsgBox('Μ CPL_STOP !!');
Result := 0; // Θ
end;
CPL_EXIT:
begin
MsgBox('Μ CPL_EXIT !!');
Result := 0; // Θ
end;
end;
end;// 蹲 CPlApplet ㄧΑ
exports
CPlApplet;begin
end.