OK. This one is quite simple.
Since I tested behaviour, I created following results of my test:
I hope you can read html (red is possible error).
BTW I don't have all Windows updates because I had problem with Windows(including sasser).
SetIcon(); --> I avoided this function because :
_AFXWIN_INLINE HICON CWnd::SetIcon(HICON hIcon, BOOL bBigIcon)
{ ASSERT
:IsWindow(m_hWnd)); return (HICON)::SendMessage(m_hWnd, WM_SETICON, bBigIcon, (LPARAM)hIcon); }
)
I used: "SendMessage(WM_SETICON, ...);" = SM
Resources: 3 separate files with resource ids: IDI_ICONS(for small - list and details), IDI_ICONL(for large - icons), IDI_ICONX(for xlarge - tiles and thumbinals)
S=small, L=large, X=xlarge
App icon Windows Explorer (list view ctrl)
Function calls top-left(=small) Alt+Tab(=large) Small(16x16) Large(32x32) XLarge(48x48)
SM + ICON_SMALL + IDI_ICONS
S NULL S S S
SM + ICON_SMALL + IDI_ICONL L NULL S S S
SM + ICON_SMALL + IDI_ICONX X NULL S S S
SM + ICON_BIG + IDI_ICONS
S S S S S
SM + ICON_BIG + IDI_ICONL L L S S S
SM + ICON_BIG + IDI_ICONX X X S S S
SM + ICON_SMALL + IDI_ICONS
SM + ICON_SMALL + IDI_ICONL
SM + ICON_SMALL + IDI_ICONX
X X S S S
SM + ICON_BIG + IDI_ICONS
SM + ICON_BIG + IDI_ICONL
SM + ICON_BIG + IDI_ICONX
X X S S S
Resources: 1 ico file with icon sizes 32x32, 16x16, 48x48, Id = IDI_ICONALL
App icon Windows Explorer (list view)
Function calls top-left(=small) Alt+Tab(=large) Small(16x16) Large(32x32) XLarge(48x48)
SM + ICON_SMALL + IDI_ICONALL L NULL S L X
SM + ICON_BIG + IDI_ICONALL S L S L X
SM + ICON_SMALL + IDI_ICONALL
SM + ICON_BIG + IDI_ICONALL
L L S L X
SM + ICON_BIG + IDI_ICONALL
SM + ICON_SMALL + IDI_ICONALL
L L S L X
This is how it looked like over here:
BOOL CTestDlgIconDlg::OnInitDialog() {
CDialog::OnInitDialog();
....
SendMessage(WM_SETICON, ICON_BIG, (LPARAM)AfxGetApp()->LoadIcon(IDI_ICONALL));
SendMessage(WM_SETICON, ICON_SMALL, (LPARAM)AfxGetApp()->LoadIcon(IDI_ICONALL));
....
--------------------------------------------------------------------------------
MFC Library Reference
CWnd::SetIcon
Call this member function to set the handle to a specific icon, as identified by hIcon.
HICON SetIcon(
HICON hIcon,
BOOL bBigIcon
);Parameters
hIcon
A handle to a previous icon.
bBigIcon
Specifies a 32 pixel by 32 pixel icon if TRUE; specifies a 16 pixel by 16 pixel icon if FALSE.
Return Value
A handle to an icon.
Remarks
When the window class is registered, it selects an icon.
Example
See the example for CWnd::GetSystemMenu.
See Also
CWnd Overview | Class Members | Hierarchy Chart | GetIcon
--------------------------------------------------------------------------------
Send feedback on this topic to Microsoft
© Microsoft Corporation. All rights reserved.
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
WM_SETICON Message
--------------------------------------------------------------------------------
An application sends the WM_SETICON message to associate a new large or small icon with a window. The system displays the large icon in the ALT+TAB dialog box, and the small icon in the window caption.
Syntax
To send this message, call the SendMessage function as follows.
lResult = SendMessage( // returns LRESULT in lResult (HWND) hWndControl, // handle to destination control (UINT) WM_SETICON, // message ID (WPARAM) wParam, // = (WPARAM) () wParam; (LPARAM) lParam // = (LPARAM) () lParam; ); Parameters
wParam
Specifies the type of icon to be set. This parameter can be one of the following values.
ICON_BIG
Set the large icon for the window.
ICON_SMALL
Set the small icon for the window.
lParam
Handle to the new large or small icon. If this parameter is NULL, the icon indicated by wParamis removed.
Return Value
The return value is a handle to the previous large or small icon, depending on the value of wParam. It is NULL if the window previously had no icon of the type indicated by wParam.
Remarks
The DefWindowProc function returns a handle to the previous large or small icon associated with the window, depending on the value of wParam.
Message Information
Header Declared in Winuser.h, include Windows.h
Minimum operating systems Windows 95, Windows NT 4.0
See Also
Windows Overview, DefWindowProc, WM_GETICON
--------------------------------------------------------------------------------
© 2003 Microsoft Corporation. All rights reserved.