I have one resource file for several projects. In this resource file I have
several icons. For each project I would like to use different program icon.
I tried to change the icon in RegisterClass call:

wc.style = CS_HREDRAW | CS_VREDRAW;
wc.lpfnWndProc = (WNDPROC) WndProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = hInstance;
wc.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_ICON1));
wc.hCursor = 0;
wc.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH);
wc.lpszMenuName = 0;
wc.lpszClassName = szWindowClass;

But this does not work. Program always use the icon which was program icon
in the original project.

Where is defined and how can I change program icon?

Regards

Simon

Re: How can I change program icon in EC++? by Magnus

Magnus
Fri May 28 01:24:14 CDT 2004

If you mean the icon showing in the file explorer then I think it always
shows the first icon found in the resource. If you don't use the other icons
in the resource file you can use a couple of compile switches to skip them
or at least make sure the icon you want as program icon comes first.

Do note that changing the program icon will not take effect in the file
explorer until you soft reset the device since the icons are cached in
memory.

/Magnus

"Simon" <nobody@nobody.com> wrote in message
news:OxTblkGREHA.3596@tk2msftngp13.phx.gbl...
> I have one resource file for several projects. In this resource file I
have
> several icons. For each project I would like to use different program
icon.
> I tried to change the icon in RegisterClass call:
>
> wc.style = CS_HREDRAW | CS_VREDRAW;
> wc.lpfnWndProc = (WNDPROC) WndProc;
> wc.cbClsExtra = 0;
> wc.cbWndExtra = 0;
> wc.hInstance = hInstance;
> wc.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_ICON1));
> wc.hCursor = 0;
> wc.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH);
> wc.lpszMenuName = 0;
> wc.lpszClassName = szWindowClass;
>
> But this does not work. Program always use the icon which was program icon
> in the original project.
>
> Where is defined and how can I change program icon?
>
> Regards
>
> Simon
>
>



Re: How can I change program icon in EC++? by KS

KS
Fri May 28 10:20:06 CDT 2004

In eVC delete the IDR_MAINFRAME icon ... add your own icon to the resources
... rename it to IDR_MAINFRAME ... voila ...

KS

"Simon" <nobody@nobody.com> wrote in message
news:OxTblkGREHA.3596@tk2msftngp13.phx.gbl...
> I have one resource file for several projects. In this resource file I
have
> several icons. For each project I would like to use different program
icon.
> I tried to change the icon in RegisterClass call:
>
> wc.style = CS_HREDRAW | CS_VREDRAW;
> wc.lpfnWndProc = (WNDPROC) WndProc;
> wc.cbClsExtra = 0;
> wc.cbWndExtra = 0;
> wc.hInstance = hInstance;
> wc.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_ICON1));
> wc.hCursor = 0;
> wc.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH);
> wc.lpszMenuName = 0;
> wc.lpszClassName = szWindowClass;
>
> But this does not work. Program always use the icon which was program icon
> in the original project.
>
> Where is defined and how can I change program icon?
>
> Regards
>
> Simon
>
>



Re: How can I change program icon in EC++? by Simon

Simon
Fri May 28 13:26:13 CDT 2004

Problem solved. Icon with the lowest ID in the resource.h file will be
picked as the program icon.

Regards

Simon

"Magnus Persson" <numinel@arsmagica.com> wrote in message
news:elibpxHREHA.3944@TK2MSFTNGP11.phx.gbl...
> If you mean the icon showing in the file explorer then I think it always
> shows the first icon found in the resource. If you don't use the other
icons
> in the resource file you can use a couple of compile switches to skip them
> or at least make sure the icon you want as program icon comes first.
>
> Do note that changing the program icon will not take effect in the file
> explorer until you soft reset the device since the icons are cached in
> memory.
>
> /Magnus
>
> "Simon" <nobody@nobody.com> wrote in message
> news:OxTblkGREHA.3596@tk2msftngp13.phx.gbl...
> > I have one resource file for several projects. In this resource file I
> have
> > several icons. For each project I would like to use different program
> icon.
> > I tried to change the icon in RegisterClass call:
> >
> > wc.style = CS_HREDRAW | CS_VREDRAW;
> > wc.lpfnWndProc = (WNDPROC) WndProc;
> > wc.cbClsExtra = 0;
> > wc.cbWndExtra = 0;
> > wc.hInstance = hInstance;
> > wc.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_ICON1));
> > wc.hCursor = 0;
> > wc.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH);
> > wc.lpszMenuName = 0;
> > wc.lpszClassName = szWindowClass;
> >
> > But this does not work. Program always use the icon which was program
icon
> > in the original project.
> >
> > Where is defined and how can I change program icon?
> >
> > Regards
> >
> > Simon
> >
> >
>
>