Board index » delphi » Control Panel Application

Control Panel Application

Is it possible to write an application for the control panel?
If it is possible, is it necessary to register it or is it displayed
automatically in the Control Panel?

Cheers,
Josef

PS: Sorry for my bad English.

 

Re:Control Panel Application


Hi Josef

Essentially, a control panel applet is nothing more than a DLL with a couple
of predefined exported functions. You can find more information in the
microsoft knowledgebase about this (do a search for 'write control panel
applet'). I think there are even some examples in Delphi out on the net.
Shouldn't be to hard to find...

Best regards

Arjen Broeze

Quote
Josef Mller wrote in message <7uf38r$kp...@srv08a.s-world.net>...
>Is it possible to write an application for the control panel?
>If it is possible, is it necessary to register it or is it displayed
>automatically in the Control Panel?

>Cheers,
>Josef

>PS: Sorry for my bad English.

Re:Control Panel Application


Arjen Broeze <nospam.Arjen.Bro...@ict.nl> schrieb in im Newsbeitrag:
7ufapc$q9...@tasmania.dev.ict.nl...

Quote
>You can find more information in the
> microsoft knowledgebase about this (do a search for 'write control panel
> applet'). I think there are even some examples in Delphi out on the net.
> Shouldn't be to hard to find...

I couldn't find it. I searched in the US Version. I marked the following
options:
- Make a full text search
- Asking a question using a free-text query
My search was about Windows 98.
My question was: write control panel applet

There were 200 matches but none about writing a control panel applet.
What's wrong?

Thanks!
Josef

Re:Control Panel Application


Hi Josef

Try these links. They'll tell you all you need:

http://msdn.microsoft.com/library/sdkdoc/shellcc/shell/conpanel.htm
http://msdn.microsoft.com/library/psdk/shellcc/shell/functions/CPlApp...
#CPlApplet

Hope this helps

Arjen Broeze

Quote
Josef Mller wrote in message <7ufm6n$1d...@srv08a.s-world.net>...

>Arjen Broeze <nospam.Arjen.Bro...@ict.nl> schrieb in im Newsbeitrag:
>7ufapc$q9...@tasmania.dev.ict.nl...

>>You can find more information in the
>> microsoft knowledgebase about this (do a search for 'write control panel
>> applet'). I think there are even some examples in Delphi out on the net.
>> Shouldn't be to hard to find...
>I couldn't find it. I searched in the US Version. I marked the following
>options:
>- Make a full text search
>- Asking a question using a free-text query
>My search was about Windows 98.
>My question was: write control panel applet

>There were 200 matches but none about writing a control panel applet.
>What's wrong?

>Thanks!
>Josef

Re:Control Panel Application


-----------------------------------------------------

library cplappl;

uses
  Windows,
  CPL,
  SysUtils,
  Classes,
  Dialogs,
  form in 'form.pas' {Form1};

{$R APPLETS.RES}

function CPlApplet(hwndCPL : HWND; Msg : Word; lParam1, lParam2 : LongINt)
: LongInt;stdcall;
var PCPLInfo : PNewCPLInfo;

begin
  Result := 0; file://default return value
  try file://better not leave an exception out of the DLL
    case Msg of
        CPL_INIT : begin
                     file://misc initializations
                     Result := 1; file://if initialization failed, return 0
                   end;

    CPL_GETCOUNT : begin
                     file://number of applets supported by the library
                     Result := 1;
                   end;
   CPL_NEWINQUIRE: begin
                     file://applet number is in Integer(lParam1) if
mupltiple
applets
                     PCPLInfo := PNewCPLInfo(lParam2);
                     PCPLInfo^.dwSize := SizeOf(TNewCPLInfo);
                     PCPLInfo^.dwFlags := 0;
                     PCPLInfo^.dwHelpContext := 0;
                     PCPLInfo^.lData := 0;
                     PCPLInfo^.hIcon := LoadIcon(HInstance,PChar(100));
                     StrCopy(PCPLInfo^.szName,'Test CPL applet');
                     StrCopy(PCPLInfo^.szInfo,'Help Info about the test CPL
applet');
                     PCPLInfo^.szHelpFile[0] := #0;
                   end;

       CPL_SELECT:;    // applet icon selected
       CPL_DBLCLK: begin   file://applet icon double-clicked
                     file://applet number is in Integer(lParam1) if
mupltiple
applets
                     with TForm1.Create(nil) do file://show a delphi form
                     try
                       ShowModal;
                     finally
                       Free;
                     end;
                   end;
        CPL_EXIT  :;//call any uninitialization code;
     end;

  except
    on E:Exception do
    begin
      ShowMessage(E.Message);
    end;
  end;
end;

exports
  CPlApplet;
begin
end.

Do not forget to rename cplappl.dll to cplappl.cpl and put it in
Windows\System

You might want also to register you applet under the MMCPL key of the
HKEY_CURRENT_USER key in the registry.

---------------------------------------------------------------------------

--
??(From China)

Quote
Josef Mller <dip...@gmx.net> wrote in message

news:7ufm6n$1d3$1@srv08a.s-world.net...
Quote

> Arjen Broeze <nospam.Arjen.Bro...@ict.nl> schrieb in im Newsbeitrag:
> 7ufapc$q9...@tasmania.dev.ict.nl...

> >You can find more information in the
> > microsoft knowledgebase about this (do a search for 'write control panel
> > applet'). I think there are even some examples in Delphi out on the net.
> > Shouldn't be to hard to find...
> I couldn't find it. I searched in the US Version. I marked the following
> options:
> - Make a full text search
> - Asking a question using a free-text query
> My search was about Windows 98.
> My question was: write control panel applet

> There were 200 matches but none about writing a control panel applet.
> What's wrong?

> Thanks!
> Josef

Other Threads