Two new member functions are added to OC Window class:
HICON Window::SetIcon(HICON hIcon, BOOL bBigIcon = FALSE);
HICON Window::GetIcon(BOOL bBigIcon = FALSE);
|
A new util function is also added to make it easier to set the icon from given icon file:
HICON set_window_icon_from_file(HWND hWnd, LPCSTR szIconPath)
|
See below for the example of setting the icon of the HTML app dialog:
BOOL CMyHTMLDlg::OnInitDialog()
{
HTMLDlg::OnInitDialog();
string strIconPath = __FILE__;
strIconPath = GetFilePath(strIconPath) + "test.ico" ;
set_window_icon_from_file(GetSafeHwnd(), strIconPath);
return TRUE
}
|