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


C++ AfxGetInstanceHandle函數代碼示例

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


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

示例1: ASSERT


//.........這裏部分代碼省略.........
	WORD wTakeChairID=(m_wBankerUser+7-cbSiceFirst)%GAME_PLAYER;
	for (WORD i=0;i<GAME_PLAYER;i++)
	{
		//計算數目
		BYTE cbValidCount=HEAP_FULL_COUNT-m_cbHeapCardInfo[wTakeChairID][1]-((i==0)?(cbSiceSecond-1)*2:0);
		BYTE cbRemoveCount=__min(cbValidCount,cbTakeCount);

		//提取撲克
		cbTakeCount-=cbRemoveCount;
		m_cbHeapCardInfo[wTakeChairID][(i==0)?1:0]+=cbRemoveCount;

		//完成判斷
		if (cbTakeCount==0)
		{
			m_wHeapHand=wTakeChairID;
			m_wHeapTail=(m_wBankerUser+7-cbSiceFirst)%GAME_PLAYER;
			break;
		}

		//切換索引
		wTakeChairID=(wTakeChairID+1)%GAME_PLAYER;
	}

	//撲克設置
	for (WORD i=0;i<GAME_PLAYER;i++)
	{
		//變量定義
		WORD wViewChairID=SwitchViewChairID(i);

		//組合界麵
		m_GameClientView.m_WeaveCard[i][0].SetDisplayItem(true);
		m_GameClientView.m_WeaveCard[i][1].SetDisplayItem(true);
		m_GameClientView.m_WeaveCard[i][2].SetDisplayItem(true);
		m_GameClientView.m_WeaveCard[i][3].SetDisplayItem(true);
		m_GameClientView.m_HeapCard[wViewChairID].SetCardData(m_cbHeapCardInfo[i][0],m_cbHeapCardInfo[i][1],HEAP_FULL_COUNT);

		//用戶撲克
		if (wViewChairID!=2)
		{
			WORD wIndex=(wViewChairID>=3)?2:wViewChairID;
			m_GameClientView.m_UserCard[wIndex].SetCardData(CountArray(pGameStart->cbCardData)-1,(i==m_wBankerUser));
		}
		else
		{
			BYTE cbBankerCard=(i==m_wBankerUser)?pGameStart->cbCardData[MAX_COUNT-1]:0;
			m_GameClientView.m_HandCardControl.SetCardData(pGameStart->cbCardData,MAX_COUNT-1,cbBankerCard);
		}

		//旁觀界麵
		if (bPlayerMode==false)
		{
			m_GameClientView.m_TableCard[wViewChairID].SetCardData(NULL,0);
			m_GameClientView.m_DiscardCard[wViewChairID].SetCardData(NULL,0);
			m_GameClientView.m_WeaveCard[wViewChairID][0].SetCardData(NULL,0);
			m_GameClientView.m_WeaveCard[wViewChairID][1].SetCardData(NULL,0);
			m_GameClientView.m_WeaveCard[wViewChairID][2].SetCardData(NULL,0);
			m_GameClientView.m_WeaveCard[wViewChairID][3].SetCardData(NULL,0);
		}
	}

	//出牌提示
	if ((bPlayerMode==true)&&(m_wCurrentUser!=INVALID_CHAIR))
	{
		WORD wMeChairID=GetMeChairID();
		if (m_wCurrentUser==wMeChairID) m_GameClientView.SetStatusFlag(true,false);
	}

	//動作處理
	if ((bPlayerMode==true)&&(pGameStart->cbUserAction!=WIK_NULL))
	{

		ShowOperateControl(pGameStart->cbUserAction,0);
		SetGameTimer(GetMeChairID(),IDI_OPERATE_CARD,TIME_OPERATE_CARD);
	}

	//更新界麵
	m_GameClientView.UpdateGameView(NULL);

	//激活框架
	if (bPlayerMode==true)
		ActiveGameFrame();

	//環境處理
		PlayGameSound(AfxGetInstanceHandle(),TEXT("GAME_START"));


	//設置時間
	if (m_wCurrentUser!=INVALID_CHAIR)
	{
		m_GameClientView.SetCurrentUser(SwitchViewChairID(m_wCurrentUser));
		SetGameTimer(m_wCurrentUser,IDI_OPERATE_CARD,TIME_OPERATE_CARD);
	}
	//托管設置
	for (WORD i=0;i<GAME_PLAYER;i++)
	{
		m_GameClientView.SetTrustee(SwitchViewChairID(i),pGameStart->bTrustee[i]);
	}

	return true;
}
開發者ID:codercold,項目名稱:whgame,代碼行數:101,代碼來源:GameClientDlg.cpp

示例2: DllEntryPoint

int CVSFilterApp::ExitInstance()
{
	DllEntryPoint(AfxGetInstanceHandle(), DLL_PROCESS_DETACH, 0); // "DllMain" of the dshow baseclasses

	return CWinApp::ExitInstance();
}
開發者ID:anguoyang,項目名稱:MediaPoint,代碼行數:6,代碼來源:VSFilter.cpp

示例3: LoadString

void CDlgShowPrivateKeyEC::UpdateEcListBox()
{
	unsigned int bitlength;

	m_dom_param_listview.DeleteAllItems(); // Delete all data in the listview
// == EC curve parameter a, b, p
	LoadString(AfxGetInstanceHandle(),IDS_STRING_EC_SEPERATOR,pc_str,STR_LAENGE_STRING_TABLE);
	m_dom_param_listview.InsertItem( 0, pc_str );
	LoadString(AfxGetInstanceHandle(),IDS_STRING_EC_DESCRIPTION,pc_str,STR_LAENGE_STRING_TABLE);
	m_dom_param_listview.SetItemText( 0, 1, pc_str );
	m_dom_param_listview.InsertItem( 1, "a" );
	m_dom_param_listview.SetItemText( 1, 1, ecParamString.a );
	bitlength = theApp.SecudeLib.lngtouse(curveParameter->E->a);
	_itoa(bitlength+1, pc_str, 10);
	m_dom_param_listview.SetItemText( 2, 2, pc_str ); // Bitlänge von a
	m_dom_param_listview.InsertItem( 2, "b" );
	m_dom_param_listview.SetItemText( 2, 1, ecParamString.b );
	bitlength = theApp.SecudeLib.lngtouse(curveParameter->E->b);
	_itoa(bitlength+1, pc_str, 10);
	m_dom_param_listview.SetItemText( 2, 2, pc_str ); // Bitlänge von b
	m_dom_param_listview.InsertItem( 3, "p" );
	m_dom_param_listview.SetItemText( 3, 1, ecParamString.p );
	bitlength = theApp.SecudeLib.lngtouse(curveParameter->E->p);
	_itoa(bitlength+1, pc_str, 10);
	m_dom_param_listview.SetItemText( 3, 2, pc_str ); // Bitlänge von p
// == EC curve point G = (x,y)
	m_dom_param_listview.InsertItem( 4, " " );
	LoadString(AfxGetInstanceHandle(),IDS_STRING_EC_SEPERATOR,pc_str,STR_LAENGE_STRING_TABLE);
	m_dom_param_listview.InsertItem( 5, pc_str );
	LoadString(AfxGetInstanceHandle(),IDS_STRING_EC_POINT_DESCRIPTION,pc_str,STR_LAENGE_STRING_TABLE);
	m_dom_param_listview.SetItemText( 5, 1, pc_str );
	m_dom_param_listview.InsertItem( 6, "x" );
	m_dom_param_listview.SetItemText( 6, 1, ecParamString.G_xcoord );
	bitlength = theApp.SecudeLib.lngtouse(curveParameter->G->x);
	_itoa(bitlength+1, pc_str, 10);
	m_dom_param_listview.SetItemText( 6, 2, pc_str ); // Bitlänge von x coord of G
	m_dom_param_listview.InsertItem( 7, "y" );
	m_dom_param_listview.SetItemText( 7, 1, ecParamString.G_ycoord );
	bitlength = theApp.SecudeLib.lngtouse(curveParameter->G->y);
	_itoa(bitlength+1, pc_str, 10);
	m_dom_param_listview.SetItemText( 7, 2, pc_str ); // Bitlänge von y coord of G
// == EC kofactor k, the prime number r is the order of G
	m_dom_param_listview.InsertItem( 8, " " );
	LoadString(AfxGetInstanceHandle(),IDS_STRING_EC_SEPERATOR,pc_str,STR_LAENGE_STRING_TABLE);
	m_dom_param_listview.InsertItem( 9, pc_str );
	LoadString(AfxGetInstanceHandle(),IDS_STRING_KF_ORD_DESCRIPTION,pc_str,STR_LAENGE_STRING_TABLE);
	m_dom_param_listview.SetItemText( 9, 1, pc_str );
	m_dom_param_listview.InsertItem( 10, "k" );
	m_dom_param_listview.SetItemText( 10, 1, ecParamString.k );
	bitlength = theApp.SecudeLib.lngtouse(curveParameter->k);
	_itoa(bitlength+1, pc_str, 10);
	m_dom_param_listview.SetItemText( 10, 2, pc_str ); // Bitlänge von k
	m_dom_param_listview.InsertItem( 11, "r" );
	m_dom_param_listview.SetItemText( 11, 1, ecParamString.r );
	bitlength = theApp.SecudeLib.lngtouse(curveParameter->r);
	_itoa(bitlength+1, pc_str, 10);
	m_dom_param_listview.SetItemText( 11, 2, pc_str ); // Bitlänge von r
	m_dom_param_listview.InsertItem( 12, " " );

	m_pubKey_listview.DeleteAllItems(); // Delete all data in the listview
	m_pubKey_listview.InsertItem( 0, " ");
	m_pubKey_listview.InsertItem( 1, ((CString)"x = ") + ecParamString.pubKey_xcoord);
	bitlength = theApp.SecudeLib.lngtouse(curveParameter->pubKey->x);
	_itoa(bitlength+1, pc_str, 10);
	m_pubKey_listview.SetItemText( 1, 1, pc_str ); // Bitlänge von x
	m_pubKey_listview.InsertItem( 2, ((CString)"y = ") + ecParamString.pubKey_ycoord);
	bitlength = theApp.SecudeLib.lngtouse(curveParameter->pubKey->y);
	_itoa(bitlength+1, pc_str, 10);
	m_pubKey_listview.SetItemText( 2, 1, pc_str ); // Bitlänge von y
	m_pubKey_listview.InsertItem( 3, " ");

	m_privKey_listview.DeleteAllItems(); // Delete all data in the listview
	m_privKey_listview.InsertItem( 0, " ");
	m_privKey_listview.InsertItem( 1, ((CString)"s = ") + ecParamString.privKey);
	bitlength = theApp.SecudeLib.lngtouse(curveParameter->privKey);
	_itoa(bitlength+1, pc_str, 10);
	m_privKey_listview.SetItemText( 1, 1, pc_str ); // Bitlänge von s
	m_privKey_listview.InsertItem( 2, " ");
}
開發者ID:flomar,項目名稱:CrypTool-VS2015,代碼行數:79,代碼來源:DlgShowPrivateKeyEC.cpp

示例4: AfxVerifyLicFile

BOOL CREditCtrl::CREditCtrlFactory::VerifyUserLicense()
{
	return AfxVerifyLicFile(AfxGetInstanceHandle(), _szLicFileName,
		_szLicString);
}
開發者ID:gondur,項目名稱:mig_src,代碼行數:5,代碼來源:REDITCTL.CPP

示例5: sizeof

BOOL CAdminControlApp::InitInstance()
{
//TODO: call AfxInitRichEdit2() to initialize richedit2 library.
	// 如果一個運行在 Windows XP 上的應用程序清單指定要
	// 使用 ComCtl32.dll 版本 6 或更高版本來啟用可視化方式,
	//則需要 InitCommonControlsEx()。否則,將無法創建窗口。

	//崩潰開始處
// 	CR_INSTALL_INFO info = {0};  
// 	info.cb = sizeof(CR_INSTALL_INFO); 
// 	info.pszAppName = TEXT("AdminControl"); 
// 	info.pszAppVersion = TEXT("1.0.0");     
// 	info.dwFlags |= CR_INST_ALL_POSSIBLE_HANDLERS;  
// 	info.dwFlags |= CR_INST_DONT_SEND_REPORT;  
// 	info.dwFlags |= CR_INST_NO_GUI;
// 	info.pszErrorReportSaveDir = TEXT("./UMErrReport");  
// 
// 	// Install crash handlers
// 	int nInstResult = crInstall(&info);            
// 	//assert(nInstResult==0);
// 	if(nInstResult!=0)
// 	{
// 		TCHAR buff[256];
// 		crGetLastErrorMsg(buff, 256); // Get last error
// 		_tprintf(_T("%s\n"), buff); // and output it to the screen
// 		return 1;
// 	}

	INITCOMMONCONTROLSEX InitCtrls;
	InitCtrls.dwSize = sizeof(InitCtrls);
	// 將它設置為包括所有要在應用程序中使用的
	// 公共控件類。
	InitCtrls.dwICC = ICC_WIN95_CLASSES;
	InitCommonControlsEx(&InitCtrls);

	CWinAppEx::InitInstance();

	m_ParameterGlobal.LoadParameter();

	AfxEnableControlContainer();

	// 標準初始化
	// 如果未使用這些功能並希望減小
	// 最終可執行文件的大小,則應移除下列
	// 不需要的特定初始化例程
	// 更改用於存儲設置的注冊表項
	// TODO: 應適當修改該字符串,
	// 例如修改為公司或組織名
	SetRegistryKey(_T("應用程序向導生成的本地應用程序"));

//	CAdminControlDlg dlg;
// 	CDlgLogin m_login;
// 	if (m_login.DoModal() != IDOK)
// 	{
// 		return FALSE;
// 	}
// 	m_MissionLogon.ShowLogon();
// 	
// 	m_pMainWnd = &dlg;
// 	INT_PTR nResponse = dlg.DoModal();
// 	if (nResponse == IDOK)
// 	{
// 		// TODO: 在此放置處理何時用
// 		//  “確定”來關閉對話框的代碼
// 	}
// 	else if (nResponse == IDCANCEL)
// 	{
// 		// TODO: 在此放置處理何時用
// 		//  “取消”來關閉對話框的代碼
// 	}
	const TCHAR szPlazaClass[]=TEXT("UM");
	WNDCLASS WndClasss;
	ZeroMemory(&WndClasss,sizeof(WndClasss));

	//注冊窗口
	WndClasss.style=CS_DBLCLKS;
	WndClasss.hIcon=NULL;
	WndClasss.lpfnWndProc=DefWindowProc;
	WndClasss.lpszClassName=szPlazaClass;
	WndClasss.hInstance=AfxGetInstanceHandle();
	WndClasss.hCursor=LoadStandardCursor(MAKEINTRESOURCE(IDC_HAND_CUR));
	if (AfxRegisterClass(&WndClasss)==FALSE) AfxThrowResourceException();

	AfxInitRichEdit();
	//建立窗口
	CMyFrameWnd * pPlatformFrame=new CMyFrameWnd;
	pPlatformFrame->Create(szPlazaClass,szProduct,WS_CLIPCHILDREN|WS_CLIPSIBLINGS|WS_SYSMENU,CRect(0,0,0,0));

	m_pMainWnd = pPlatformFrame;
	m_pMainWnd->ShowWindow(SW_HIDE);
	m_pMainWnd->UpdateWindow();
	// 由於對話框已關閉,所以將返回 FALSE 以便退出應用程序,
	//  而不是啟動應用程序的消息泵。
	return TRUE;
}
開發者ID:cyrillic7,項目名稱:CPFrom,代碼行數:95,代碼來源:AdminControl.cpp

示例6: GetDlgItem

BOOL CAboutDlg::OnInitDialog()
{
    // Get the default text before it is overwritten by the call to __super::OnInitDialog()
    GetDlgItem(IDC_AUTHORS_LINK)->GetWindowText(m_credits);
#ifndef MPCHC_LITE
    GetDlgItem(IDC_LAVFILTERS_VERSION)->GetWindowText(m_LAVFiltersVersion);
#endif

    __super::OnInitDialog();

    // Because we set LR_SHARED, there is no need to explicitly destroy the icon
    m_icon.SetIcon((HICON)LoadImage(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDR_MAINFRAME), IMAGE_ICON, 48, 48, LR_SHARED));

    m_appname = _T("MPC-HC");
    if (VersionInfo::IsNightly() || VersionInfo::Is64Bit()) {
        m_appname += _T(" (");
    }
    if (VersionInfo::IsNightly()) {
        m_appname += VersionInfo::GetNightlyWord();
    }
    if (VersionInfo::IsNightly() && VersionInfo::Is64Bit()) {
        m_appname += _T(", ");
    }
    if (VersionInfo::Is64Bit()) {
        m_appname += _T("64-bit");
    }
    if (VersionInfo::IsNightly() || VersionInfo::Is64Bit()) {
        m_appname += _T(")");
    }

#ifdef MPCHC_LITE
    m_appname += _T(" Lite");
#endif

    // Build the path to Authors.txt
    m_AuthorsPath = GetProgramPath() + _T("Authors.txt");
    // Check if the file exists
    if (FileExists(m_AuthorsPath)) {
        // If it does, we make the filename clickable
        m_credits.Replace(_T("Authors.txt"), _T("<a>Authors.txt</a>"));
    }

    m_homepage.Format(_T("<a>%s</a>"), WEBSITE_URL);

    m_strBuildNumber = VersionInfo::GetFullVersionString();

#if defined(__INTEL_COMPILER)
#if (__INTEL_COMPILER >= 1210)
    m_MPCCompiler = _T("ICL ") MAKE_STR(__INTEL_COMPILER) _T(" Build ") MAKE_STR(__INTEL_COMPILER_BUILD_DATE);
#else
#error Compiler is not supported!
#endif
#elif defined(_MSC_VER)
#if (_MSC_VER == 1800)              // 2013
#if (_MSC_FULL_VER == 180030501)
    m_MPCCompiler = _T("MSVC 2013 Update 2");
#elif (_MSC_FULL_VER < 180021005)
    m_MPCCompiler = _T("MSVC 2013 Preview/Beta/RC");
#else
    m_MPCCompiler = _T("MSVC 2013");
#endif
#elif (_MSC_VER <= 1700)
#error Compiler is not supported!
#endif
#else
#error Please add support for your compiler
#endif

#if (__AVX__)
    m_MPCCompiler += _T(" (AVX)");
#elif (__SSSE3__)
    m_MPCCompiler += _T(" (SSSE3)");
#elif (__SSE3__)
    m_MPCCompiler += _T(" (SSE3)");
#elif !defined(_M_X64) && defined(_M_IX86_FP)
#if (_M_IX86_FP == 2)   // /arch:SSE2 was used
    m_MPCCompiler += _T(" (SSE2)");
#elif (_M_IX86_FP == 1) // /arch:SSE was used
    m_MPCCompiler += _T(" (SSE)");
#endif
#endif

#ifdef _DEBUG
    m_MPCCompiler += _T(" Debug");
#endif

    m_LAVFilters.Format(IDS_STRING_COLON, _T("LAV Filters"));
#ifndef MPCHC_LITE
    CString LAVFiltersVersion = CFGFilterLAV::GetVersion();
    if (!LAVFiltersVersion.IsEmpty()) {
        m_LAVFiltersVersion = LAVFiltersVersion;
    }
#endif

    m_buildDate = VersionInfo::GetBuildDateString();

    OSVERSIONINFOEX osVersion = SysVersion::GetFullVersion();
    m_OSName.Format(_T("Windows NT %1u.%1u (build %u"),
                    osVersion.dwMajorVersion, osVersion.dwMinorVersion, osVersion.dwBuildNumber);
    if (osVersion.szCSDVersion[0]) {
//.........這裏部分代碼省略.........
開發者ID:EchoLiao,項目名稱:mpc-hc,代碼行數:101,代碼來源:AboutDlg.cpp

示例7: AfxGetAppSettings

BOOL CSaveDlg::OnInitDialog()
{
	CCmdUIDialog::OnInitDialog();

	AppSettings& s = AfxGetAppSettings();

	CString str, in = m_name, out = m_out;

	if (m_in.Find(_T("http://")) != -1 || m_in.Find(_T("ftp://")) != -1) {
		m_anim.SendMessage(ACM_OPEN, (WPARAM)AfxGetInstanceHandle(), (LPARAM)IDR_AVI_WEB_FILECOPY);
	} else {
		m_anim.SendMessage(ACM_OPEN, (WPARAM)AfxGetInstanceHandle(), (LPARAM)IDR_AVI_FILECOPY);
	}
	m_anim.Play(0, (UINT)-1, (UINT)-1);

	if (in.GetLength() > 60) {
		in = in.Left(17) + _T("..") + in.Right(43);
	}

	if (out.GetLength() > 60) {
		out = out.Left(17) + _T("..") + out.Right(43);
	}

	str.Format(_T("%s\r\n%s"), in, out);
	m_fromto.SetWindowText(str);

	m_progress.SetRange(0, 100);

	if (OpenImageCheck(m_in) && s.strSnapShotExt != _T(".*")) {
		OpenImageDIB(m_in, m_out, s.iThumbQuality, 0);
		EndDialog(IDOK);
		return TRUE;
	}

	if (FAILED(pGB.CoCreateInstance(CLSID_FilterGraph)) || !(pMC = pGB) || !(pME = pGB) || !(pMS = pGB)
			|| FAILED(pME->SetNotifyWindow((OAHWND)m_hWnd, WM_GRAPHNOTIFY, 0))) {
		m_report.SetWindowText(_T("Error"));
		return FALSE;
	}

	HRESULT hr;

	CStringW fnw = m_in;
	CComPtr<IFileSourceFilter> pReader;

	if (!pReader && m_in.Mid(m_in.ReverseFind('.')+1).MakeLower() == _T("cda")) {
		hr = S_OK;
		CComPtr<IUnknown> pUnk = (IUnknown*)(INonDelegatingUnknown*)DNew CCDDAReader(NULL, &hr);

		if (FAILED(hr) || !(pReader = pUnk) || FAILED(pReader->Load(fnw, NULL))) {
			pReader.Release();
		}
	}

	if (!pReader) {
		hr = S_OK;
		CComPtr<IUnknown> pUnk = (IUnknown*)(INonDelegatingUnknown*)DNew CCDXAReader(NULL, &hr);

		if (FAILED(hr) || !(pReader = pUnk) || FAILED(pReader->Load(fnw, NULL))) {
			pReader.Release();
		}
	}

	if (!pReader /*&& ext == _T("ifo")*/) {
		hr = S_OK;
		CComPtr<IUnknown> pUnk = (IUnknown*)(INonDelegatingUnknown*)DNew CVTSReader(NULL, &hr);

		if (FAILED(hr) || !(pReader = pUnk) || FAILED(pReader->Load(fnw, NULL))) {
			pReader.Release();
		} else {
			CPath pout(m_out);
			pout.RenameExtension(_T(".ifo"));
			CopyFile(m_in, pout, FALSE);
		}
	}

	if (!pReader) {
		hr = S_OK;
		CComPtr<IUnknown> pUnk;
		hr = pUnk.CoCreateInstance(CLSID_AsyncReader);

		if (FAILED(hr) || !(pReader = pUnk) || FAILED(pReader->Load(fnw, NULL))) {
			pReader.Release();
		}
	}

	if (!pReader) {
		hr = S_OK;
		CComPtr<IUnknown> pUnk;
		hr = pUnk.CoCreateInstance(CLSID_URLReader);

		if (CComQIPtr<IBaseFilter> pSrc = pUnk) {
			hr = pGB->AddFilter(pSrc, fnw);

			if (FAILED(hr) || !(pReader = pUnk) || FAILED(hr = pReader->Load(fnw, NULL))) {
				pReader.Release();
				pGB->RemoveFilter(pSrc);
			}
		}
	}
//.........這裏部分代碼省略.........
開發者ID:WinnerSoftLab,項目名稱:WinnerMediaPlayer,代碼行數:101,代碼來源:SaveDlg.cpp

示例8: GetDlgItem

BOOL CAboutDlg::OnInitDialog()
{
    // Get the default text before it is overwritten by the call to __super::OnInitDialog()
    GetDlgItem(IDC_STATIC1)->GetWindowText(m_appname);
    GetDlgItem(IDC_AUTHORS_LINK)->GetWindowText(m_credits);
#ifndef MPCHC_LITE
    GetDlgItem(IDC_LAVFILTERS_VERSION)->GetWindowText(m_LAVFiltersVersion);
#endif

    __super::OnInitDialog();

    // Because we set LR_SHARED, there is no need to explicitly destroy the icon
    m_icon.SetIcon((HICON)LoadImage(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDR_MAINFRAME), IMAGE_ICON, 48, 48, LR_SHARED));

#if MPC_BETA_RELEASE || _WIN64
    m_appname += _T(" (");
#endif

#if MPC_BETA_RELEASE
    m_appname += MPC_VERSION_BETA;
#endif

#if MPC_BETA_RELEASE && _WIN64
    m_appname += _T(", ");
#endif

#ifdef _WIN64
    m_appname += _T("64-bit");
#endif

#if MPC_BETA_RELEASE || _WIN64
    m_appname += _T(")");
#endif

#ifdef MPCHC_LITE
    m_appname += _T(" Lite");
#endif

    // Build the path to Authors.txt
    m_AuthorsPath = GetProgramPath() + _T("Authors.txt");
    // Check if the file exists
    if (FileExists(m_AuthorsPath)) {
        // If it does, we make the filename clickable
        m_credits.Replace(_T("Authors.txt"), _T("<a>Authors.txt</a>"));
    }

    m_homepage.Format(_T("<a>%s</a>"), WEBSITE_URL);

    m_strBuildNumber = MPC_VERSION_STR_FULL;

#if defined(__INTEL_COMPILER)
#if (__INTEL_COMPILER >= 1210)
    m_MPCCompiler = _T("ICL ") MAKE_STR(__INTEL_COMPILER) _T(" Build ") MAKE_STR(__INTEL_COMPILER_BUILD_DATE);
#else
#error Compiler is not supported!
#endif
#elif defined(_MSC_VER)
#if (_MSC_VER == 1700) // 2012
#if (_MSC_FULL_VER == 170060610)
    m_MPCCompiler = _T("MSVC 2012 Update 3");
#elif (_MSC_FULL_VER == 170060315)  // MSVC 2012 Update 2
#error VS2012 Update 2 is not supported because the binaries will not run on XP. Install Update 3 instead.
#elif (_MSC_FULL_VER == 170051106)
    m_MPCCompiler = _T("MSVC 2012 Update 1");
#elif (_MSC_FULL_VER < 170050727)   // MSVC 2012
#error Please install the latest Update for VS2012.
#else
    m_MPCCompiler = _T("MSVC 2012");
#endif
#elif (_MSC_VER == 1600) // 2010
#if (_MSC_FULL_VER >= 160040219)
    m_MPCCompiler = _T("MSVC 2010 SP1");
#else
    m_MPCCompiler = _T("MSVC 2010");
#endif
#elif (_MSC_VER < 1600)
#error Compiler is not supported!
#endif
#else
#error Please add support for your compiler
#endif

#if (__AVX__)
    m_MPCCompiler += _T(" (AVX)");
#elif (__SSSE3__)
    m_MPCCompiler += _T(" (SSSE3)");
#elif (__SSE3__)
    m_MPCCompiler += _T(" (SSE3)");
#elif !defined(_M_X64) && defined(_M_IX86_FP)
#if (_M_IX86_FP == 2)   // /arch:SSE2 was used
    m_MPCCompiler += _T(" (SSE2)");
#elif (_M_IX86_FP == 1) // /arch:SSE was used
    m_MPCCompiler += _T(" (SSE)");
#endif
#endif

#ifdef _DEBUG
    m_MPCCompiler += _T(" Debug");
#endif

//.........這裏部分代碼省略.........
開發者ID:JavanWang,項目名稱:mpc-hc,代碼行數:101,代碼來源:AboutDlg.cpp

示例9: lstrcpy

void CpermoDlg::DrawInfo(CDC* pDC)
{
	CFont font, *pOldFont;
	LOGFONT logFont;
	pDC->GetCurrentFont()->GetLogFont(&logFont);
	logFont.lfWidth = 0;
	logFont.lfHeight = nFontSize;
	logFont.lfWeight = FW_REGULAR;
	lstrcpy(logFont.lfFaceName, _T("微軟雅黑"));
	font.CreateFontIndirect(&logFont);
	pOldFont = pDC->SelectObject(&font);
	COLORREF cOldTextColor;
	if (IDM_GREEN == nSkin || IDM_ORANGE == nSkin)
	{
		cOldTextColor = pDC->SetTextColor(RGB(0, 0, 0));
	}
	else
	{
		cOldTextColor = pDC->SetTextColor(RGB(255, 255, 255));
	}
	int nOldBkMode = pDC->SetBkMode(TRANSPARENT);
	CString strCPU, strMem, strNetUp, strNetDown;
	strCPU.Format(_T("%d%%"), nCPU);
	strMem.Format(_T("%d%%"), nMem);
	if (fNetUp >= 1000)
	{
		strNetUp.Format(_T("%.2fMB/S"), fNetUp/1024.0);
	}
	else
	{
		if (fNetUp < 100)
		{
			strNetUp.Format(_T("%.1fKB/S"), fNetUp);
		}
		else
		{
			strNetUp.Format(_T("%.0fKB/S"), fNetUp);
		}
	}
	if (fNetDown >= 1000)
	{
		strNetDown.Format(_T("%.2fMB/S"), fNetDown/1024.0);
	}
	else
	{
		if (fNetDown < 100)
		{
			strNetDown.Format(_T("%.1fKB/S"), fNetDown);
		}
		else
		{
			strNetDown.Format(_T("%.0fKB/S"), fNetDown);
		}
	}
	CRect rText;
	rText.left = 1;
	rText.right = 36;
	rText.top = 2;
	rText.bottom = 21;
	pDC->DrawText(strCPU, &rText, DT_CENTER | DT_VCENTER | DT_SINGLELINE);
	rText.left = 186;
	rText.right = 219;
	pDC->DrawText(strMem, &rText, DT_CENTER | DT_VCENTER | DT_SINGLELINE);
	if (IDM_BLACK == nSkin || IDM_BLUE == nSkin)
	{
		pDC->SetTextColor(RGB(255, 255, 255));
	}
	else
	{
		pDC->SetTextColor(RGB(0, 0, 0));
	}

	CRect rcIcon;
	rcIcon.left = 38;
	rcIcon.right = 50;
	rcIcon.top = 5;
	rcIcon.bottom = 17;
	DrawIconEx(pDC->GetSafeHdc(), rcIcon.left, rcIcon.top, LoadIcon(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDI_DOWN)), rcIcon.Width(), rcIcon.Height(), 0, NULL, DI_NORMAL);
	rText.left = 52;
	rText.right = 110;
	pDC->DrawText(strNetDown, &rText, DT_CENTER | DT_VCENTER | DT_SINGLELINE);
	rcIcon.left = 112;
	rcIcon.right = 124;
	DrawIconEx(pDC->GetSafeHdc(), rcIcon.left, rcIcon.top, LoadIcon(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDI_UP)), rcIcon.Width(), rcIcon.Height(), 0, NULL, DI_NORMAL);
	rText.left = 126;
	rText.right = 185;
	pDC->DrawText(strNetUp, &rText, DT_CENTER | DT_VCENTER | DT_SINGLELINE);


	pDC->SetTextColor(cOldTextColor);
	pDC->SetBkMode(nOldBkMode);
	pDC->SelectObject(pOldFont);
	font.DeleteObject();
}
開發者ID:ccxuy,項目名稱:permo,代碼行數:94,代碼來源:permoDlg.cpp

示例10: ASSERT


//.........這裏部分代碼省略.........
    // Display splash screen
    CCommandLineInfo cmdInfo;
    ParseCommandLine(cmdInfo);
    short shRegServer = -1;
    short shUnRegServer = -1;

    if (__argc > 1)
    {
        shRegServer = (short) strcmpi(__targv[1],"/regserver");
        shUnRegServer = (short) strcmpi(__targv[1],"/unregserver");
    }

    // Don't display a new MDI child window during startup
    if (cmdInfo.m_nShellCommand == CCommandLineInfo::FileNew
            || cmdInfo.m_nShellCommand == CCommandLineInfo::FileOpen)
    {
        cmdInfo.m_nShellCommand = CCommandLineInfo::FileNothing;
    }

    // START CHANGES MADE FOR AUTOMATION

    if (cmdInfo.m_bRunEmbedded || cmdInfo.m_bRunAutomated)
    {
        m_bFromAutomation = TRUE;
        //      return TRUE;
    }
    else if (cmdInfo.m_nShellCommand == CCommandLineInfo::AppUnregister)
    {
        AfxOleUnregisterTypeLib(LIBID_CAN_MonitorApp);
    }
    else
    {
        COleObjectFactory::UpdateRegistryAll();
        AfxOleRegisterTypeLib(AfxGetInstanceHandle(), LIBID_CAN_MonitorApp);
    }

    if (  shRegServer == 0  || shUnRegServer == 0 ) //If command line argument match
    {
        return FALSE;
    }

    if (!m_bFromAutomation)
    {
        CSplashScreen::ActivateSplashScreen(cmdInfo.m_bShowSplash);
    }

    // Allocate memory for CFlags
    m_pouFlags = &(CFlags::ouGetFlagObj());
    // create main MDI Frame window
    CMainFrame* pMainFrame = new CMainFrame;

    if ( pMainFrame == nullptr )
    {
        ::PostQuitMessage(0);
        return FALSE;
    }

    if (!pMainFrame->LoadFrame(IDR_MAINFRAME))
    {
        return FALSE;
    }

    m_pMainWnd = pMainFrame;

    // Dispatch commands specified on the command line
    if (!ProcessShellCommand(cmdInfo))
開發者ID:IXXAT-wucherer,項目名稱:busmaster,代碼行數:67,代碼來源:BUSMASTER.cpp

示例11: AfxGetInstanceHandle

BOOL CERadQueueCallApp::InitATL()
{
	_Module.Init(ObjectMap, AfxGetInstanceHandle());
	return TRUE;

}
開發者ID:albertzeng,項目名稱:eRadQueue,代碼行數:6,代碼來源:eRadQueueCall.cpp

示例12: ModifyTrayIcon

void ModifyTrayIcon(HWND hWnd, DWORD idi)
{
	TrayMessage(hWnd, NIF_ICON, NIM_MODIFY, _TRAY_ICON_ID, (HICON)LoadImage(AfxGetInstanceHandle(), 
		MAKEINTRESOURCE(idi), IMAGE_ICON, 16, 16, 0), _APP_NAME);
	SetClassLong(hWnd, GCL_HICON, (LONG)LoadIcon(AfxGetInstanceHandle(), MAKEINTRESOURCE(idi)));
}
開發者ID:hackshields,項目名稱:antivirus,代碼行數:6,代碼來源:KLGuard2.cpp

示例13: MAKEINTRESOURCE

void CAnimateButton::SetCursor(UINT nIDCursor)
{
	m_hCursor = ::LoadCursor(AfxGetInstanceHandle(), MAKEINTRESOURCE(nIDCursor));
	SendMessage(WM_SETCURSOR);
}
開發者ID:latelan,項目名稱:BlueClick,代碼行數:5,代碼來源:AnimateButton.cpp

示例14: LoadBitmap

// Initialise the dialog
//
BOOL CEventWizardDlg::OnInitDialog() 
{
	// Startup
	CDialog::OnInitDialog();

	int currentPosition = 1;

	// Create an m_ObjectImages
	m_ObjectImages.DeleteImageList();

	bool bSmallImages = false;

	// Check what size images we'll need
	// 32x32 without families or 16x16 with
	if (application->families.size() == 0)
	{
		m_ObjectImages.Create(32, 32, ILC_COLOR24, 3, 3);
		m_List.SetImageList(&m_ObjectImages, LVSIL_NORMAL);

		HBITMAP SystemBitmap = LoadBitmap(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDB_SYSTEM));
		ImageList_Add(m_ObjectImages, SystemBitmap, SystemBitmap);
		DeleteObject(SystemBitmap);
	}

	else
	{
		// If it's small, also set the view to small images
		m_List.SetView(LV_VIEW_SMALLICON);

		m_ObjectImages.Create(16, 16, ILC_COLOR24, 3, 3);
		m_List.SetImageList(&m_ObjectImages, LVSIL_SMALL);

		HBITMAP SystemBitmap = LoadBitmap(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDB_SYSTEMC));
		ImageList_Add(m_ObjectImages, SystemBitmap, SystemBitmap);	
		DeleteObject(SystemBitmap);

		bSmallImages = true;
	}

	// Prepare to iterate all objects to add icons
	POSITION pos = objMap->GetStartPosition();
	long mapKey;
	CObjType* ObjectType;

	// Add '(System)' because system uses it
	object_folders["(System)"] = 0;

	// Loop through and add all objects to the otList
	while (pos != NULL) 
	{
		objMap->GetNextAssoc(pos, mapKey, ObjectType);

		if(!ObjectType->m_bIsGroupType)
		{
			CObj *o;
			bool bAdd = false;

			// If global, its okay to add...if its not global..and we have a layout...we need to check
			if (ObjectType->m_bGlobal) 
			{
				bAdd = true;
			}
			else if(layout)
			{
				POSITION pos = layout->objects.GetStartPosition();

				for (int i = 0; i < layout->objects.GetCount(); i++) 
				{
					long ID;
					layout->objects.GetNextAssoc(pos, ID, o);
						
					if (o->GetGlobalID() == ObjectType->ObjectIdentifier)
					{
						bAdd = true;	
					}
				}
			}
			else // we have no layout to this event sheet
			{
				bAdd = true;
			}

			// Dont add if it doesn't have conditions/actions
			bool hasAces = false;
			for (int i = 0; i < ObjectType->GetTableCount(m_aceType); i++)
			{
				if (ObjectType->GetACESEntry(m_aceType, i)->aceListName == "")
				{
					hasAces = true;
					break;
				}
				if (hasAces)
					break;
			}
			if(!hasAces)
				bAdd = false;

			// Okay cool...look like its okay to add...just check if is showabout in the event sheet editor
//.........這裏部分代碼省略.........
開發者ID:aolko,項目名稱:construct,代碼行數:101,代碼來源:Event+Wizard+Dlg.cpp

示例15: memset

   // Register your unique class name that you wish to use
   WNDCLASS wndcls;

   memset(&wndcls, 0, sizeof(WNDCLASS));   // start with NULL defaults

   wndcls.style = CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW;

   //you can specify your own window procedure
   wndcls.lpfnWndProc = ::DefWindowProc; 
   wndcls.hInstance = AfxGetInstanceHandle();
   wndcls.hIcon = LoadIcon(wndcls.hInstance, MAKEINTRESOURCE(IDI_MYICON));
   wndcls.hCursor = LoadCursor(wndcls.hInstance, MAKEINTRESOURCE(IDC_ARROW));
   wndcls.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
   wndcls.lpszMenuName = NULL;

   // Specify your own class name for using FindWindow later
   wndcls.lpszClassName = _T("MyNewClass");

   // Register the new class and trace if it fails
   if(!AfxRegisterClass(&wndcls))
   {
      TRACE("Class Registration Failed\n");
   }
開發者ID:terryjintry,項目名稱:OLSource1,代碼行數:23,代碼來源:afxregisterclass_1.cpp


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