Board index » delphi » Adding an Applet to the Control Panel Problem

Adding an Applet to the Control Panel Problem

Hi All,

I have managed to get an applet working following the advice at:
http://www.gnomehome.demon.nl/uddf/pages/windows.htm#windows22

However, the line:
hIcon:=LoadIcon(HInstance,'MAINICON');
loads the standard Delphi Icon (flaming torch).

So I tried editing the .res file to include my own Icon. But
on recompilation I still get the flaming torch.

If I rename the Icon in the resource file as Icon1 and change the
code to read:
hIcon:=LoadIcon(HInstance,'Icon1');
the icon displayed in the Control Panel is the standard windows
file icon (before association with an app.) NOT the icon I placed
in the .res file.

Anybody have any ideas here.

Cheers

Ian

 

Re:Adding an Applet to the Control Panel Problem


Hi All,

I have managed to get an applet working following the advice at:
http://www.gnomehome.demon.nl/uddf/pages/windows.htm#windows22

However, the line:
hIcon:=LoadIcon(HInstance,'MAINICON');
loads the standard Delphi Icon (flaming torch).

So I tried editing the .res file to include my own Icon. But
on recompilation I still get the flaming torch.

If I rename the Icon in the resource file as Icon1 and change the
code to read:
hIcon:=LoadIcon(HInstance,'Icon1');
the icon displayed in the Control Panel is the standard windows
file icon (before association with an app.) NOT the icon I placed
in the .res file.

Anybody have any ideas here.

Cheers

Ian

Re:Adding an Applet to the Control Panel Problem


In article <34FEED53.EED18...@netcomuk.co.uk>, Ian Watkins
<iwatk...@netcomuk.co.uk> writes

Quote
>Hi All,

>I have managed to get an applet working following the advice at:
>http://www.gnomehome.demon.nl/uddf/pages/windows.htm#windows22

>However, the line:
>hIcon:=LoadIcon(HInstance,'MAINICON');
>loads the standard Delphi Icon (flaming torch).

>So I tried editing the .res file to include my own Icon. But
>on recompilation I still get the flaming torch.

I think you have to make sure that you edit the .res file
while Delphi *isn't* running. Delphi will then load your new
icon with the project and not overwrite it the next time you
recompile.

--
Jeremy Collins

Re:Adding an Applet to the Control Panel Problem


Quote
Jeremy Collins wrote:

> In article <34FEED53.EED18...@netcomuk.co.uk>, Ian Watkins
> <iwatk...@netcomuk.co.uk> writes
> >Hi All,

> >I have managed to get an applet working following the advice at:
> >http://www.gnomehome.demon.nl/uddf/pages/windows.htm#windows22

> >However, the line:
> >hIcon:=LoadIcon(HInstance,'MAINICON');
> >loads the standard Delphi Icon (flaming torch).

> >So I tried editing the .res file to include my own Icon. But
> >on recompilation I still get the flaming torch.

> I think you have to make sure that you edit the .res file
> while Delphi *isn't* running. Delphi will then load your new
> icon with the project and not overwrite it the next time you
> recompile.

> --
> Jeremy Collins

Hi Jeremy (and group)

Thanks for that. Works a treat. Now have a working Control Panel
Applet with the icon and everything is sweet ;-)

Thanks again.

Cheers

Ian

Re:Adding an Applet to the Control Panel Problem


    I think the subject title says it all.  Thanks for any help you can
offer this newbie. :-)

David Carvalho
Carvalho1 (at) worldnet.att.net

P.S. I was just wondering because the previous posts were talking about
editing their .res file.

Re:Adding an Applet to the Control Panel Problem


Quote
David Carvalho wrote:

>I think the subject title says it all.  Thanks for any help you can
>offer this newbie. :-)

>David Carvalho
>Carvalho1 (at) worldnet.att.net

Hi David,

Yes, I had a problem with an icon in a DLL that was to be renamed
as a .CPL for a control panel applet.

It required editing a .res file *outside* of the Delphi3 IDE.

If you look in the Borlad\Delphi3\Bin directory you will find an
.EXE called Imagedit.exe. Fire this up and you can open .res files
for editing.

Hope this helps

Cheers

Ian

Re:Adding an Applet to the Control Panel Problem


In article <6dqiic$...@bgtnsc02.worldnet.att.net> "David Carvalho" <Carval...@NOSPAMworldnet.att.net> writes:

Quote
>    I think the subject title says it all.  Thanks for any help you can
>offer this newbie. :-)
>David Carvalho
>Carvalho1 (at) worldnet.att.net
>P.S. I was just wondering because the previous posts were talking about
>editing their .res file.

I picked up a cheap copy of Borland C++ once... it has a tool called Resource
Workshop that's wonderful.  Borland doesn't include it anymore -- b'damned if
I know why!

You can find software like that at auction (e.g. ebay.com) for a song
sometimes.

Re:Adding an Applet to the Control Panel Problem


    Cool!  Thanks for the info. :-)

David Carvalho (Delphi Newbie)
Carvalho1 (at) worldnet.att.net

Quote

>Hi David,

>Yes, I had a problem with an icon in a DLL that was to be renamed
>as a .CPL for a control panel applet.

>It required editing a .res file *outside* of the Delphi3 IDE.

>If you look in the Borlad\Delphi3\Bin directory you will find an
>.EXE called Imagedit.exe. Fire this up and you can open .res files
>for editing.

>Hope this helps

>Cheers

>Ian

Re:Adding an Applet to the Control Panel Problem


Quote
David Carvalho wrote:

>     I think the subject title says it all.  Thanks for any help you can
> offer this newbie. :-)

It depends on what you're editing.

In Delphi, you can edit images in a res file using the image editor.

Otherwise, I tend to use the Resource Workshop from BP7.

Andrew
--
Andrew Gabb
 email: ag...@tpgi.com.au
 phone: +61 8 8342-1021
   fax: +61 8 8269-3280
Technology Australasia's website is at http://www.taa.com.au
-----

Other Threads