當前位置: 首頁>>代碼示例>>C++>>正文


C++ AfxGetResourceHandle函數代碼示例

本文整理匯總了C++中AfxGetResourceHandle函數的典型用法代碼示例。如果您正苦於以下問題:C++ AfxGetResourceHandle函數的具體用法?C++ AfxGetResourceHandle怎麽用?C++ AfxGetResourceHandle使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了AfxGetResourceHandle函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: DestroyIcon

BOOL CFilterEdit::SetCancelBitmaps(UINT uCancelNormal, UINT uCancelPressed, BOOL bShowAlways)
{
	m_bShowCancelButtonAlways = bShowAlways;

	if (m_hIconCancelNormal)
		DestroyIcon(m_hIconCancelNormal);
	if (m_hIconCancelPressed)
		DestroyIcon(m_hIconCancelPressed);

	m_hIconCancelNormal = (HICON)LoadImage(AfxGetResourceHandle(), MAKEINTRESOURCE(uCancelNormal), IMAGE_ICON, 0, 0, LR_DEFAULTCOLOR);
	m_hIconCancelPressed = (HICON)LoadImage(AfxGetResourceHandle(), MAKEINTRESOURCE(uCancelPressed), IMAGE_ICON, 0, 0, LR_DEFAULTCOLOR);

	if ((m_hIconCancelNormal == 0) || (m_hIconCancelPressed == 0))
		return FALSE;

	m_sizeCancelIcon = GetIconSize(m_hIconCancelNormal);

	ResizeWindow();
	return TRUE;
}
開發者ID:hfeeki,項目名稱:TortoiseGit,代碼行數:20,代碼來源:FilterEdit.cpp

示例2: AfxModuleLoadString

CString	AfxModuleLoadString( UINT nID )
{
	HINSTANCE hInstanceOld = AfxGetResourceHandle();
	AfxSetResourceHandle( AfxGetModuleHandle() );

	CString	string;
	string.LoadString( nID );
	
	AfxSetResourceHandle( hInstanceOld );
	return string;
}
開發者ID:amikey,項目名稱:tradingstrategyking,代碼行數:11,代碼來源:NetTS.cpp

示例3: AfxGetResourceHandle

void CNetworkHeaderBar::SetTitle(LPCTSTR lpszTitle)
{
	if ( m_strTitle.CompareNoCase(lpszTitle) )
	{
		m_strTitle = lpszTitle;
		if (m_hWnd) Invalidate();
	}
	HICON	m_hIcon = (HICON)LoadImage( AfxGetResourceHandle(),
			MAKEINTRESOURCE( IDI_CONNECT ), IMAGE_ICON, 16, 16, 0 );
		CWnd::SetIcon( m_hIcon, FALSE );
}
開發者ID:pics860,項目名稱:callcenter,代碼行數:11,代碼來源:CtrlNetworkHeaderBar.cpp

示例4: AfxGetResourceHandle

BOOL CIconImgList::LoadExtIconData( void)
{
    // 通常アイコンの読み込み
    m_hBmpDefault = ::LoadBitmap( AfxGetResourceHandle(), MAKEINTRESOURCE( IDB_ICONIMG));

    TCHAR szFilePath[ MAX_PATH];
    int nLength = GetModuleFileName( NULL, szFilePath, MAX_PATH);
    for( int nIndex = nLength; nIndex >= 0; nIndex--)
    {
        if( TEXT( '\\') == szFilePath[ nIndex])
        {
            lstrcpy( &szFilePath[ nIndex + 1], TEXT( "GetIcon.xml"));
            break;
        }
    }


    BOOL blResult = FALSE;
    MSXML2::IXMLDOMDocumentPtr piDocument;
    if( SUCCEEDED( piDocument.CreateInstance( _T( "Microsoft.XMLDOM"))))
    {
        piDocument->PutvalidateOnParse( VARIANT_TRUE);
        if( VARIANT_FALSE != piDocument->load( _variant_t( _bstr_t( szFilePath))))
        {
            if( LoadIcons( piDocument))
            {
                blResult = LoadGroups( piDocument);
            }
        }
        else
        {
            MSXML2::IXMLDOMParseErrorPtr piError;

            piError = piDocument->GetparseError();
            long lCode = piError->GeterrorCode();
            TRACE( _T( "0x%08X\n"), lCode);	// 0x800C0005

            if( NULL != piError && 0 != lCode && 0x800C0005/*INET_E_RESOURCE_NOT_FOUND*/ != lCode)
            {
                long lRaw = piError->Getline();
                long lCol = piError->Getlinepos();

                _bstr_t cBstr = piError->Getreason();
                _bstr_t cBstrSrc = piError->GetsrcText();

                CString cStr;

                cStr.Format( _T( "拡張アイコンデータファイルを解析できませんでした。\n%s\n\nソース:%s\n位置:%d行 %d文字"), ( ( char*)cBstr), ( ( char*)cBstrSrc), lRaw, lCol);
                MessageBox( NULL, cStr, NULL, MB_OK | MB_ICONEXCLAMATION);
            }
        }
    }
    return blResult;
}
開發者ID:sayrun,項目名稱:SOboe,代碼行數:54,代碼來源:IconImgList.cpp

示例5: GetRect

void VDEIODLL_EXPORT_API GetRect(CPoint& Point1,CPoint& Point2,BOOL& bFlag)
{
	AFX_MANAGE_STATE(AfxGetStaticModuleState());
	HINSTANCE main_hInstance = AfxGetResourceHandle();    //獲取主程序資源句柄
	AfxSetResourceHandle(theApp.m_hInstance);             //獲取dll程序資源句柄
	CWVedio Dlg;
	int ret = Dlg.DoModal();
	if (ret == 100)
	{
		Dlg.GetPoint(Point1,Point2,bFlag);
	}
}
開發者ID:Strongc,項目名稱:game-ui-solution,代碼行數:12,代碼來源:Vedio.cpp

示例6: LoadIconFromModule

    HICON LoadIconFromModule(UINT uID, LPCTSTR lpzModuleName)
    {
        HICON hRet = NULL;

        HINSTANCE hResOld = SwitchResourceToModule(lpzModuleName);
        {
            hRet = LoadIcon(AfxGetResourceHandle(), MAKEINTRESOURCE(uID));
        }
        AfxSetResourceHandle(hResOld);

        return hRet;
    };
開發者ID:fffonion,項目名稱:V8,代碼行數:12,代碼來源:UIHelper.cpp

示例7: AfxGetResourceHandle

void Cexcxx_wce_sqlDlg::OnSize(UINT /*nType*/, int /*cx*/, int /*cy*/)
{
	if (AfxIsDRAEnabled())
	{
		DRA::RelayoutDialog(
			AfxGetResourceHandle(), 
			this->m_hWnd, 
			DRA::GetDisplayMode() != DRA::Portrait ? 
			MAKEINTRESOURCE(IDD_SIMPLEPROJECT_DIALOG_WIDE) : 
			MAKEINTRESOURCE(IDD_SIMPLEPROJECT_DIALOG));
	}
}
開發者ID:CompassHXM,項目名稱:h-store,代碼行數:12,代碼來源:excxx_wce_sqlDlg.cpp

示例8: ThreadProc

UINT	ThreadProc(LPVOID pVoid)
{

    if(ProgressDlg::hDialog == NULL)
	{
		DialogBox(AfxGetResourceHandle(),
							MAKEINTRESOURCE(DlgID),
							NULL,(DLGPROC)DialogProc);
	}
	return 1;

}
開發者ID:comarius,項目名稱:getic3d,代碼行數:12,代碼來源:ProgressDlg.cpp

示例9: AfxGetResourceHandle

void CThreadSynBySemaphoreDlg::OnSize(UINT /*nType*/, int /*cx*/, int /*cy*/)
{
	if (AfxIsDRAEnabled())
	{
		DRA::RelayoutDialog(
			AfxGetResourceHandle(), 
			this->m_hWnd, 
			DRA::GetDisplayMode() != DRA::Portrait ? 
			MAKEINTRESOURCE(IDD_THREADSYNBYSEMAPHORE_DIALOG_WIDE) : 
			MAKEINTRESOURCE(IDD_THREADSYNBYSEMAPHORE_DIALOG));
	}
}
開發者ID:isongbo,項目名稱:MyCode,代碼行數:12,代碼來源:ThreadSynBySemaphoreDlg.cpp

示例10: AfxGetResourceHandle

void CAucma_HeaterDlg::OnSize(UINT /*nType*/, int /*cx*/, int /*cy*/)
{
	if (AfxIsDRAEnabled())
	{
		DRA::RelayoutDialog(
			AfxGetResourceHandle(), 
			this->m_hWnd, 
			DRA::GetDisplayMode() != DRA::Portrait ? 
			MAKEINTRESOURCE(IDD_AUCMA_HEATER_DIALOG_WIDE) : 
			MAKEINTRESOURCE(IDD_AUCMA_HEATER_DIALOG));
	}
}
開發者ID:svn2github,項目名稱:jy007551312,代碼行數:12,代碼來源:Aucma_HeaterDlg.cpp

示例11: CHashString

//---------------------------------------------------------------------
// Function:	OnCreate
// Description:	Called from the main windows create function
// Parameters:	CMDIFrameWnd *mainWnd = main frames CMDIFrameWnd pointer
// Returns:		.
//---------------------------------------------------------------------
void CModelViewEditor::OnCreate(CMDIFrameWnd *mainWnd)
{
	MENUINFOMESSAGE mim;
	CBitmap menuBitmap;
	HINSTANCE appInst;

	static DWORD msgHash_GetMenuInfo = CHashString(_T("GetMenuInfo")).GetUniqueID();
	m_ToolBox->SendMessage(msgHash_GetMenuInfo, sizeof(MENUINFOMESSAGE), &mim);

	// get the apps instance handle for loading resources
	appInst = AfxGetResourceHandle();
	// now tell the application to look in dll for resources
	AfxSetResourceHandle(ModelViewEditorDLL.hModule);

	// we need to mergeMenus
	VERIFY(MergeMenus(&m_DocTemplate->m_hMenuShared, mim.m_hMenu, _T("&Window")));	
	// and accelerators
	VERIFY(MergeAccelerators(&m_DocTemplate->m_hAccelTable, mim.m_hAccel));

	mim.m_hAccel = NULL;
	mim.m_hMenu = NULL;
	// load up hi-res toolbar icon
	menuBitmap.LoadBitmap(IDB_TOOLBAR);
	// we don't really have to have to toolbar visible do we?
	mim.m_MenuRsrc = IDR_MODELVIEWTYPE;
	mim.m_MenuBitmap = &menuBitmap;

	static DWORD msgHash_SetMenuInfo = CHashString(_T("SetMenuInfo")).GetUniqueID();
	m_ToolBox->SendMessage(msgHash_SetMenuInfo, sizeof(MENUINFOMESSAGE), &mim);

	static DWORD msgHash_RegisterResourceCollection = CHashString(_T("RegisterResourceCollection")).GetUniqueID();
	DWORD result = m_ToolBox->SendMessage(msgHash_RegisterResourceCollection, sizeof(RESOURCECOLLECTION), &m_ObjCollection);

	if (result != MSG_HANDLED)
	{
		assert(0);
	}

	// We do not need to create Cal3D objects. Opening them seems to be enough

	//FILETYPECREATIONINFO fileInfo; 
	//fileInfo.m_Description = MODELVIEW_EXTENSION_DESCRIPTION; 
	//fileInfo.m_CreationCallback = CModelViewEditor::ModelViewEditorCreationCallback; 
	//static DWORD msgHash_RegisterFileTypeCreationInfo = CHashString(_T("RegisterFileTypeCreationInfo")).GetUniqueID();
	//result = m_ToolBox->SendMessage(msgHash_RegisterFileTypeCreationInfo, sizeof( FILETYPECREATIONINFO ), &fileInfo, NULL, NULL );

	//if (result != MSG_HANDLED)
	//{
	//	assert(0);
	//}

	AfxSetResourceHandle(appInst);
}
開發者ID:klhurley,項目名稱:ElementalEngine2,代碼行數:59,代碼來源:ModelViewEditor.cpp

示例12: StartVedio

void VDEIODLL_EXPORT_API StartVedio(CString strFilePath,CString strFileName,int nRate,
	CPoint Point1,CPoint Point2,int nFlag,HWND GetCurHwnd)
{
	AFX_MANAGE_STATE(AfxGetStaticModuleState());
	HINSTANCE main_hInstance = AfxGetResourceHandle();    //獲取主程序資源句柄
	AfxSetResourceHandle(theApp.m_hInstance);             //獲取dll程序資源句柄
	if(NULL == lpVeioScreen)
	{
		lpVeioScreen = new VedioScreen(strFilePath,strFileName,nRate,Point1,Point2,nFlag,GetCurHwnd);
		lpVeioScreen->StartVedio();
	}
}
開發者ID:Strongc,項目名稱:game-ui-solution,代碼行數:12,代碼來源:Vedio.cpp

示例13: AfxGetResourceHandle

void CTITIANII_OSD_TESTDlg::OnSize(UINT /*nType*/, int /*cx*/, int /*cy*/)
{
    if (AfxIsDRAEnabled())
    {
        DRA::RelayoutDialog(
            AfxGetResourceHandle(),
            this->m_hWnd,
            DRA::GetDisplayMode() != DRA::Portrait ?
            MAKEINTRESOURCE(IDD_TITIANII_OSD_TEST_DIALOG_WIDE) :
            MAKEINTRESOURCE(IDD_TITIANII_OSD_TEST_DIALOG));
    }
}
開發者ID:xuweiqiang,項目名稱:LibVRPresent,代碼行數:12,代碼來源:TITIANII_OSD_TESTDlg.cpp

示例14: LoadIcon

bool  CShellTreeList::createMEdUI(HWND hMainWnd)
{
	CWnd* pWnd = CWnd::FromHandle(hMainWnd);
	
	m_hICON = LoadIcon(AfxGetResourceHandle(),MAKEINTRESOURCE(IDI_SHELLTREE));

	CRect rectDummy(0, 0, 0, 0);
	const DWORD dwTreeStyle = WS_CHILD | WS_VISIBLE | TVS_HASLINES | TVS_LINESATROOT | TVS_HASBUTTONS;

	m_wndTree.Create(dwTreeStyle, rectDummy, pWnd, 1200);
    return true;
}
開發者ID:YOlodfssdf,項目名稱:evolution3d,代碼行數:12,代碼來源:ShellTreeList.cpp

示例15: TXFlexRay_vShowConfigureMsgWindow

USAGEMODE HRESULT TXFlexRay_vShowConfigureMsgWindow(void* pParentWnd, ETYPE_BUS eBUS)
{
    //Place this code at the beginning of the export function.
    //Save previous resource handle and switch to current one.
    HINSTANCE hInst = AfxGetResourceHandle();
    AfxSetResourceHandle(TXFlexRayWindowDLL.hResource);

    int nRes = nShowTxWindow(pParentWnd, eBUS);

    AfxSetResourceHandle(hInst);
    return nRes;
}
開發者ID:Raghavchandrashetty,項目名稱:busmaster,代碼行數:12,代碼來源:TXWindowFlexRay.cpp


注:本文中的AfxGetResourceHandle函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。