コード例 #1
0
ファイル: maindlg.cpp プロジェクト: dbremner/stablupd
INT_PTR Main_OnInitDialog(HWND hWnd, HWND /*hWndFocus*/, LPARAM)
{
	WORD	wDefLangID = MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US);

	// Set the icon.
	CIconHandle hIcon;
	hIcon.LoadIcon(IDI_ICON_UPDATESTR);
	CWindow wnd(hWnd);
	wnd.SetIcon(hIcon, TRUE);
	wnd.SetIcon(hIcon, FALSE);

	CComboBox combo(wnd.GetDlgItem(IDC_COMBO_LANGUAGES));
	CString strBuf;
	// Fill the languages-combobox.
	int nDefIndex = 0;
	for(int i = 0; i < NO_OF_LANGUAGES; i++ )
	{
		// Load the string, insert it & specify the language ID as
		// the item data.
		strBuf.LoadString(s_langInfo[i].nStrID);
		int nIndex = combo.AddString(strBuf);
		combo.SetItemData(nIndex, s_langInfo[i].wLangID);
		if( wDefLangID == s_langInfo[i].wLangID )
			nDefIndex = nIndex;
	}

	// Select the default index.
	combo.SetCurSel(nDefIndex);

	return TRUE;
}
コード例 #2
0
bool CTuoIcon::LoadFromFile()
{
	CIconHandle ico;
	ico.LoadIcon(m_strFileName.c_str(), 16, 16, LR_LOADFROMFILE);
	if (ico == NULL)
		return false;
	m_hIcon = ico;
	return true;
}