size : 1604
uploaded_on : Mon Nov 9 00:00:00 1998
modified_on : Wed Dec 8 14:03:26 1999
title : Control panel
org_filename : ctrlpanel.txt
author : Hiki Takehito
authoremail : takeone@pop06.odn.ne.jp
description : How to put a Delphi application inside the Control Panel
keywords :
tested : not tested yet
submitted_by : Unofficial Delphi Developers FAQ
submitted_by_email : uddf@gnomehome.demon.nl
uploaded_by : nobody
modified_by : nobody
owner : nobody
lang : plain
file-type : text/plain
category : delphi-system32bit
__END_OF_HEADER__
>Anyone know how to put a Delphi application inside the Control Panel?
If you use Delphi3, add Cpl unit at dpr file.
I show you a sample code. -----------
library Project1; {Change "program" to "library"}
uses
Cpl, {use Cpl unit}
Windows,
Forms,
Unit1 in 'Unit1.pas' {Form1};
{$R *.RES}
procedure ExecuteApp;
begin
Application.Initialize;
Application.CreateForm(TForm1,Form1);
Application.Run;
end;
{A callback function to export at Control Panel}
function CPlApplet(hwndCPl: THandle; uMsg: DWORD;
lParam1, lParam2: LongInt):LongInt;stdcall;
var
NewCplInfo:PNewCplInfo;
begin
Result:=0;
case uMsg of
{Initialization.Return True.}
CPL_INIT : Result:=1;
{Number of Applet.}
CPL_GETCOUNT : Result:=1;
{Transporting informations of this Applet to the Control Panel.}
CPL_NEWINQUIRE :
begin
NewCplInfo:=PNewCplInfo(lParam2);
with NewCplInfo^ do
begin
dwSize:=SizeOf(TNewCplInfo);
dwFlags:=0;
dwHelpContext:=0;
lData:=0;
{An icon to display on Control Panel.}
hIcon:=LoadIcon(HInstance,'MAINICON');
{Applet name}
szName:='Project1';
{Description of this Applet.}
szInfo:='This is a test Applet.';
szHelpFile:='';
end;
end;
{Executing this Applet.}
CPL_DBLCLK : ExecuteApp;
else Result:=0;
end;
end;
{Exporting the function of CplApplet}
exports
CPlApplet;
begin
end.
To use this, change the extention from "dll" to "cpl". And put into the System folder.
Applet means a piece of Control Panel.Display,Fonts,Mouse,System are all Applets.