当前位置: 首页>>代码示例>>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;未经允许,请勿转载。