本文整理匯總了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;
}
示例2: AfxModuleLoadString
CString AfxModuleLoadString( UINT nID )
{
HINSTANCE hInstanceOld = AfxGetResourceHandle();
AfxSetResourceHandle( AfxGetModuleHandle() );
CString string;
string.LoadString( nID );
AfxSetResourceHandle( hInstanceOld );
return string;
}
示例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 );
}
示例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;
}
示例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);
}
}
示例6: LoadIconFromModule
HICON LoadIconFromModule(UINT uID, LPCTSTR lpzModuleName)
{
HICON hRet = NULL;
HINSTANCE hResOld = SwitchResourceToModule(lpzModuleName);
{
hRet = LoadIcon(AfxGetResourceHandle(), MAKEINTRESOURCE(uID));
}
AfxSetResourceHandle(hResOld);
return hRet;
};
示例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));
}
}
示例8: ThreadProc
UINT ThreadProc(LPVOID pVoid)
{
if(ProgressDlg::hDialog == NULL)
{
DialogBox(AfxGetResourceHandle(),
MAKEINTRESOURCE(DlgID),
NULL,(DLGPROC)DialogProc);
}
return 1;
}
示例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));
}
}
示例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));
}
}
示例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);
}
示例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();
}
}
示例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));
}
}
示例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;
}
示例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;
}