Change icon from default
How can i change the application icon from the default 1.
And how do i add an icon to a dialog form
Thanx
[113 byte] By [
newBee2MFC] at [2007-11-19 16:00:50]

# 1 Re: Change icon from default
HICON hMyIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_MYICON));
SendMessage(hwnd, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
hwnd is the window handle.You can use GetsafeHwnd function for that.
and IDI_MYICON is the resouce Icon
I think this will help.If so pls rate this.
regards
# 2 Re: Change icon from default
Nothing happens
Try something else?
my code -
HICON icon = LoadIcon(NULL, MAKEINTRESOURCE(APP_ICO));
//this->SetIcon(icon, false);
this->SendMessage(WM_SETICON, ICON_BIG, (LPARAM)icon);
# 4 Re: Change icon from default
Hello,
Change the icon in project resource itself so that you can avoid additional coding. Remember to change icon for both sizes (32x32 & 16x16).
Regards.
Pravin.
# 6 Re: Change icon from default
Hello,
Choose the resource view from the workspace panel, expand and find the icon resource. If it is a dialog resource, there will be only one icon resource and if it is an SDI / MDI application, there will be two (one for the main window and another for the view(s). Double click (each of) the icon(s) and modify as per your requirement. Choose the device views standard (32x32) and small (16x16) from the combobox about the resource edit window to modify both. Compile and see that your icon is what you wanted.
Regards.
Pravin.
# 7 Re: Change icon from default
This part in CDialog.Ie hi should me a member of Dialog class
HICON hi;
Then
hi =AfxGetApp()->LoadIcon(IDI_ICON3);
SetIcon(hi,0);
hope this will help