当前位置: 首页>>代码示例>>C++>>正文


C++ WIN3264TEST函数代码示例

本文整理汇总了C++中WIN3264TEST函数的典型用法代码示例。如果您正苦于以下问题:C++ WIN3264TEST函数的具体用法?C++ WIN3264TEST怎么用?C++ WIN3264TEST使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了WIN3264TEST函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: RegisterConsoleFontHKLM

void RegisterConsoleFontHKLM(LPCWSTR pszFontFace)
{
	if (!pszFontFace || !*pszFontFace)
		return;

	HKEY hk;
	DWORD nRights = KEY_ALL_ACCESS|WIN3264TEST((IsWindows64() ? KEY_WOW64_64KEY : 0),0);

	if (!RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Console\\TrueTypeFont",
	                  0, nRights, &hk))
	{
		wchar_t szId[32] = {0}, szFont[255]; DWORD dwLen, dwType;

		for (DWORD i = 0; i <20; i++)
		{
			szId[i] = L'0'; szId[i+1] = 0; wmemset(szFont, 0, 255);

			if (RegQueryValueExW(hk, szId, NULL, &dwType, (LPBYTE)szFont, &(dwLen = 255*2)))
			{
				RegSetValueExW(hk, szId, 0, REG_SZ, (LPBYTE)pszFontFace, (lstrlen(pszFontFace)+1)*2);
				break;
			}

			if (lstrcmpi(szFont, pszFontFace) == 0)
			{
				break; // он уже добавлен
			}
		}

		RegCloseKey(hk);
	}
}
开发者ID:1833183060,项目名称:ConEmu,代码行数:32,代码来源:Actions.cpp

示例2: return

bool HkFunc::Init(LPCWSTR asModule, HMODULE hModule)
{
	if ((State != sNotChecked) && (State != sUnloaded) && (State != sConEmuHk))
		return (State == sHooked || State == sConEmuHk);

	BOOL bTrampolined = FALSE;
	typedef BOOL (WINAPI* RequestTrampolines_t)(LPCWSTR asModule, HMODULE hModule);
	RequestTrampolines_t fnRequestTrampolines;

	// WARNING! Heap may be not initialized in this step!

	HMODULE hConEmuHk = GetModuleHandle(WIN3264TEST(L"ConEmuHk.dll",L"ConEmuHk64.dll"));
	if (hConEmuHk != NULL)
	{
		fnRequestTrampolines = (RequestTrampolines_t)GetProcAddress(hConEmuHk, "RequestTrampolines");
		if (!fnRequestTrampolines)
		{
			// Old build?
			_ASSERTE(fnRequestTrampolines!=NULL);
		}
		else
		{
			bTrampolined = fnRequestTrampolines(asModule, hModule);
		}
	}

	State = bTrampolined ? sHooked : sNotHooked;
	return (State == sHooked || State == sConEmuHk);
}
开发者ID:qyqx,项目名称:ConEmu,代码行数:29,代码来源:HkFunc.cpp

示例3: RegEnumKeys

int RegEnumKeys(HKEY hkRoot, LPCWSTR pszParentPath, RegEnumKeysCallback fn, LPARAM lParam)
{
	int iRc = -1;
	HKEY hk = NULL, hkChild = NULL;
	bool bContinue = true;
	LONG lrc;
	bool ib64 = IsWindows64();

	for (int s = 0; s < (ib64 ? 2 : 1); s++)
	{
		DWORD samDesired = KEY_READ;
		if (ib64)
		{
			if (s == 0)
				samDesired |= WIN3264TEST(KEY_WOW64_32KEY,KEY_WOW64_64KEY);
			else
				samDesired |= WIN3264TEST(KEY_WOW64_64KEY,KEY_WOW64_32KEY);
		}

		if (0 == (lrc = RegOpenKeyEx(hkRoot, pszParentPath, 0, samDesired, &hk)))
		{
			iRc = 0;
			UINT n = 0;
			wchar_t szSubKey[MAX_PATH] = L""; DWORD cchMax = countof(szSubKey) - 1;

			while (0 == (lrc = RegEnumKeyEx(hk, n++, szSubKey, &cchMax, NULL, NULL, NULL, NULL)))
			{
				if (0 == (lrc = RegOpenKeyEx(hk, szSubKey, 0, samDesired, &hkChild)))
				{
					if (fn != NULL)
					{
						if (!fn(hkChild, szSubKey, lParam))
							break;
					}
					iRc++;
					RegCloseKey(hkChild);
				}
				cchMax = countof(szSubKey) - 1;
			}

			RegCloseKey(hk);
		}
	}

	return iRc;
}
开发者ID:2asoft,项目名称:ConEmu,代码行数:46,代码来源:WRegistry.cpp

示例4: _ASSERTE

void CSetPgDebug::debugLogCommand(CESERVER_REQ* pInfo, BOOL abInput, DWORD anTick, DWORD anDur, LPCWSTR asPipe, CESERVER_REQ* pResult/*=NULL*/)
{
	CSetPgDebug* pDbgPg = (CSetPgDebug*)gpSetCls->GetPageObj(thi_Debug);
	if (!pDbgPg)
		return;
	if (pDbgPg->GetActivityLoggingType() != glt_Commands)
		return;

	_ASSERTE(abInput==TRUE || pResult!=NULL || (pInfo->hdr.nCmd==CECMD_LANGCHANGE || pInfo->hdr.nCmd==CECMD_GUICHANGED || pInfo->hdr.nCmd==CMD_FARSETCHANGED || pInfo->hdr.nCmd==CECMD_ONACTIVATION));

	LogCommandsData* pData = (LogCommandsData*)calloc(1,sizeof(LogCommandsData));

	if (!pData)
		return;

	pData->bInput = abInput;
	pData->bMainThread = (abInput == FALSE) && isMainThread();
	pData->nTick = anTick - pDbgPg->mn_ActivityCmdStartTick;
	pData->nDur = anDur;
	pData->nCmd = pInfo->hdr.nCmd;
	pData->nSize = pInfo->hdr.cbSize;
	pData->nPID = abInput ? pInfo->hdr.nSrcPID : pResult ? pResult->hdr.nSrcPID : 0;
	LPCWSTR pszName = asPipe ? PointToName(asPipe) : NULL;
	lstrcpyn(pData->szPipe, pszName ? pszName : L"", countof(pData->szPipe));
	switch (pInfo->hdr.nCmd)
	{
	case CECMD_POSTCONMSG:
		_wsprintf(pData->szExtra, SKIPLEN(countof(pData->szExtra))
			L"HWND=x%08X, Msg=%u, wParam=" WIN3264TEST(L"x%08X",L"x%08X%08X") L", lParam=" WIN3264TEST(L"x%08X",L"x%08X%08X") L": ",
			pInfo->Msg.hWnd, pInfo->Msg.nMsg, WIN3264WSPRINT(pInfo->Msg.wParam), WIN3264WSPRINT(pInfo->Msg.lParam));
		GetClassName(pInfo->Msg.hWnd, pData->szExtra+lstrlen(pData->szExtra), countof(pData->szExtra)-lstrlen(pData->szExtra));
		break;
	case CECMD_NEWCMD:
		lstrcpyn(pData->szExtra, pInfo->NewCmd.GetCommand(), countof(pData->szExtra));
		break;
	case CECMD_GUIMACRO:
		lstrcpyn(pData->szExtra, pInfo->GuiMacro.sMacro, countof(pData->szExtra));
		break;
	case CMD_POSTMACRO:
		lstrcpyn(pData->szExtra, (LPCWSTR)pInfo->wData, countof(pData->szExtra));
		break;
	}

	PostMessage(pDbgPg->Dlg(), DBGMSG_LOG_ID, DBGMSG_LOG_CMD_MAGIC, (LPARAM)pData);
}
开发者ID:ForNeVeR,项目名称:ConEmu,代码行数:45,代码来源:SetPgDebug.cpp

示例5: PrintVersion

void PrintVersion()
{
	wchar_t szProgInfo[255], szVer[32];
	MultiByteToWideChar(CP_ACP, 0, CONEMUVERS, -1, szVer, countof(szVer));
	_wsprintf(szProgInfo, SKIPLEN(countof(szProgInfo))
		L"ConEmuC build %s %s. " CECOPYRIGHTSTRING_W L"\n",
		szVer, WIN3264TEST(L"x86",L"x64"));
	_wprintf(szProgInfo);
}
开发者ID:BigVal71,项目名称:ConEmu,代码行数:9,代码来源:ConEmuC.cpp

示例6: IsClinkLoaded

bool IsClinkLoaded()
{
	// Check processes supported
	if (!gbIsCmdProcess && !gbIsPowerShellProcess)
		return false;
	// Check, if clink library is loaded
	HMODULE hClink = GetModuleHandle(WIN3264TEST(L"clink_dll_x86.dll", L"clink_dll_x64.dll"));
	return (hClink != NULL);
}
开发者ID:1833183060,项目名称:ConEmu,代码行数:9,代码来源:hkCmdExe.cpp

示例7: OnSetUnhandledExceptionFilter

LPTOP_LEVEL_EXCEPTION_FILTER WINAPI OnSetUnhandledExceptionFilter(LPTOP_LEVEL_EXCEPTION_FILTER lpTopLevelExceptionFilter)
{
	//typedef LPTOP_LEVEL_EXCEPTION_FILTER(WINAPI* OnSetUnhandledExceptionFilter_t)(LPTOP_LEVEL_EXCEPTION_FILTER lpTopLevelExceptionFilter);
	ORIGINAL_KRNL(SetUnhandledExceptionFilter);

	LPTOP_LEVEL_EXCEPTION_FILTER lpRc = F(SetUnhandledExceptionFilter)(lpTopLevelExceptionFilter);

	#ifdef _DEBUG
	DWORD dwErr = GetLastError();
	wchar_t szDbgInfo[100];
	msprintf(szDbgInfo, countof(szDbgInfo),
		L"SetUnhandledExceptionFilter(" WIN3264TEST(L"0x%08X",L"0x%08X%08X") L")=" WIN3264TEST(L"0x%08X",L"0x%08X%08X") L", code=%u\n",
		WIN3264WSPRINT(lpTopLevelExceptionFilter), WIN3264WSPRINT(lpRc), dwErr);
	DebugString(szDbgInfo);
	SetLastError(dwErr);
	#endif

	return lpRc;
}
开发者ID:AITW,项目名称:ConEmu,代码行数:19,代码来源:hkKernel.cpp

示例8: OnExitProcess

// May be called from "C" programs
VOID WINAPI OnExitProcess(UINT uExitCode)
{
	//typedef BOOL (WINAPI* OnExitProcess_t)(UINT uExitCode);
	ORIGINAL_KRNL(ExitProcess);

	#if 0
	if (gbIsLessProcess)
	{
		_ASSERTE(FALSE && "Continue to ExitProcess");
	}
	#endif

	gnDllState |= ds_OnExitProcess;

	#ifdef PRINT_ON_EXITPROCESS_CALLS
	wchar_t szInfo[80]; _wsprintf(szInfo, SKIPCOUNT(szInfo) L"\n\x1B[1;31;40m::ExitProcess(%u) called\x1B[m\n", uExitCode);
	WriteProcessed(szInfo, lstrlen(szInfo), NULL);
	#endif

	// And terminate our threads
	DoDllStop(false, ds_OnExitProcess);

	bool bUseForceTerminate;

	// Issue 1865: Due to possible dead locks in LdrpAcquireLoaderLock() call TerminateProcess
	bUseForceTerminate = gbHookServerForcedTermination;

	#ifdef USE_GH_272_WORKAROUND
	// gh#272: For unknown yet reason existance of nvd3d9wrap.dll (or nvd3d9wrapx.dll on 64-bit)
	//		caused stack overflow with following calls
	//
	//		nvd3d9wrap!GetNVDisplayW+0x174f
	//		nvd3d9wrap!GetNVDisplayW+0x174f
	//		user32!_UserClientDllInitialize+0x2ca
	//		ntdll!LdrpCallInitRoutine+0x14
	//		ntdll!LdrShutdownProcess+0x1aa
	//		ntdll!RtlExitUserProcess+0x74
	//		kernel32!ExitProcessStub+0x12
	//		CallExit!main+0x47
	if (!bUseForceTerminate && GetModuleHandle(WIN3264TEST(L"nvd3d9wrap.dll",L"nvd3d9wrapx.dll")))
	{
		bUseForceTerminate = true;
	}
	#endif // USE_GH_272_WORKAROUND

	if (bUseForceTerminate)
	{
		ORIGINAL_KRNL(TerminateProcess);
		F(TerminateProcess)(GetCurrentProcess(), uExitCode);
		return; // Assume not to get here
	}

	F(ExitProcess)(uExitCode);
}
开发者ID:AITW,项目名称:ConEmu,代码行数:55,代码来源:hkProcess.cpp

示例9: OnLoadLibraryWWork

/* ************** */
HMODULE WINAPI OnLoadLibraryWWork(FARPROC lpfn, HookItem *ph, BOOL bMainThread, const wchar_t* lpFileName)
{
	typedef HMODULE(WINAPI* OnLoadLibraryW_t)(const wchar_t* lpFileName);
	HMODULE module = NULL;

	OnLoadLibraryLog(NULL,lpFileName);

	// Спрятать ExtendedConsole.dll с глаз долой, в сервисную папку "ConEmu"
	if (lpFileName 
		&& ((lstrcmpiW(lpFileName, L"ExtendedConsole.dll") == 0)
			|| lstrcmpiW(lpFileName, L"ExtendedConsole64.dll") == 0))
	{
		CESERVER_CONSOLE_MAPPING_HDR *Info = (CESERVER_CONSOLE_MAPPING_HDR*)calloc(1,sizeof(*Info));
		if (Info && ::LoadSrvMapping(ghConWnd, *Info))
		{
			size_t cchMax = countof(Info->ComSpec.ConEmuBaseDir)+64;
			wchar_t* pszFullPath = (wchar_t*)calloc(cchMax,sizeof(*pszFullPath));
			if (pszFullPath)
			{
				_wcscpy_c(pszFullPath, cchMax, Info->ComSpec.ConEmuBaseDir);
				_wcscat_c(pszFullPath, cchMax, WIN3264TEST(L"\\ExtendedConsole.dll",L"\\ExtendedConsole64.dll"));

				module = ((OnLoadLibraryW_t)lpfn)(pszFullPath);

				SafeFree(pszFullPath);
			}
		}
		SafeFree(Info);
	}

	if (!module)
		module = ((OnLoadLibraryW_t)lpfn)(lpFileName);
	DWORD dwLoadErrCode = GetLastError();

	if (gbLdrDllNotificationUsed)
		return module;

	// Issue 1079: Almost hangs with PHP
	if (lstrcmpi(lpFileName, L"kernel32.dll") == 0)
		return module;

	if (PrepareNewModule(module, NULL, lpFileName))
	{
		if (ph && ph->PostCallBack)
		{
			SETARGS1(&module,lpFileName);
			ph->PostCallBack(&args);
		}
	}

	SetLastError(dwLoadErrCode);
	return module;
}
开发者ID:Heather,项目名称:ConEmu,代码行数:54,代码来源:hkLibrary.cpp

示例10: OnVirtualProtect

BOOL WINAPI OnVirtualProtect(LPVOID lpAddress, SIZE_T dwSize, DWORD flNewProtect, PDWORD lpflOldProtect)
{
	//typedef BOOL(WINAPI* OnVirtualProtect_t)(LPVOID lpAddress, SIZE_T dwSize, DWORD flNewProtect, PDWORD lpflOldProtect);
	ORIGINAL_KRNL(VirtualProtect);
	BOOL bResult = FALSE;

	if (F(VirtualProtect))
		bResult = F(VirtualProtect)(lpAddress, dwSize, flNewProtect, lpflOldProtect);

	#ifdef _DEBUG
	DWORD dwErr = GetLastError();
	wchar_t szDbgInfo[100];
	msprintf(szDbgInfo, countof(szDbgInfo),
		L"VirtualProtect(" WIN3264TEST(L"0x%08X",L"0x%08X%08X") L"," WIN3264TEST(L"0x%08X",L"0x%08X%08X") L",%u,%u)=%u, code=%u\n",
		WIN3264WSPRINT(lpAddress), WIN3264WSPRINT(dwSize), flNewProtect, lpflOldProtect ? *lpflOldProtect : 0, bResult, dwErr);
	DebugString(szDbgInfo);
	SetLastError(dwErr);
	#endif

	return bResult;
}
开发者ID:AITW,项目名称:ConEmu,代码行数:21,代码来源:hkKernel.cpp

示例11: GetProcessBits

// Check running process bits - 32/64
int GetProcessBits(DWORD nPID, HANDLE hProcess /*= NULL*/)
{
	if (!IsWindows64())
		return 32;

	int ImageBits = WIN3264TEST(32,64); //-V112

	typedef BOOL (WINAPI* IsWow64Process_t)(HANDLE, PBOOL);
	static IsWow64Process_t IsWow64Process_f = NULL;

	if (!IsWow64Process_f)
	{
		HMODULE hKernel = GetModuleHandle(L"kernel32.dll");
		if (hKernel)
		{
			IsWow64Process_f = (IsWow64Process_t)GetProcAddress(hKernel, "IsWow64Process");
		}
	}

	if (IsWow64Process_f)
	{
		BOOL bWow64 = FALSE;
		HANDLE h = hProcess ? hProcess : OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, nPID);

		// IsWow64Process would be succeessfull for PROCESS_QUERY_LIMITED_INFORMATION (Vista+)
		if ((h == NULL) && IsWin6())
		{
			// PROCESS_QUERY_LIMITED_INFORMATION not defined in GCC
			h = OpenProcess(0x1000/*PROCESS_QUERY_LIMITED_INFORMATION*/, FALSE, nPID);
		}

		if (h == NULL)
		{
			// If it is blocked due to access rights - try to find alternative ways (by path or PERF COUNTER)
			ImageBits = 0;
		}
		else if (IsWow64Process_f(h, &bWow64) && !bWow64)
		{
			ImageBits = 64;
		}
		else
		{
			ImageBits = 32;
		}

		if (h && (h != hProcess))
			CloseHandle(h);
	}

	return ImageBits;
}
开发者ID:BigVal71,项目名称:ConEmu,代码行数:52,代码来源:WObjects.cpp

示例12: GetProcessBits

/// Check running process bitness - 32/64
int GetProcessBits(DWORD nPID, HANDLE hProcess /*= NULL*/)
{
	if (!IsWindows64())
		return 32;

	int ImageBits = WIN3264TEST(32,64); //-V112

	static BOOL (WINAPI* IsWow64Process_f)(HANDLE, PBOOL) = NULL;

	if (!IsWow64Process_f)
	{
		// Kernel32.dll is always loaded due to static link
		MModule kernel(GetModuleHandle(L"kernel32.dll"));
		kernel.GetProcAddress("IsWow64Process", IsWow64Process_f);
		// 64-bit OS must have this function
		_ASSERTE(IsWow64Process_f != NULL);
	}

	if (IsWow64Process_f)
	{
		BOOL bWow64 = FALSE;
		HANDLE h = hProcess ? hProcess : OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, nPID);

		// IsWow64Process would be succeessfull for PROCESS_QUERY_LIMITED_INFORMATION (Vista+)
		if ((h == NULL) && IsWin6())
		{
			// PROCESS_QUERY_LIMITED_INFORMATION not defined in GCC
			h = OpenProcess(0x1000/*PROCESS_QUERY_LIMITED_INFORMATION*/, FALSE, nPID);
		}

		if (h == NULL)
		{
			// If it is blocked due to access rights - try to find alternative ways (by path or PERF COUNTER)
			ImageBits = 0;
		}
		else if (IsWow64Process_f(h, &bWow64) && !bWow64)
		{
			ImageBits = 64;
		}
		else
		{
			ImageBits = 32;
		}

		if (h && (h != hProcess))
			CloseHandle(h);
	}

	return ImageBits;
}
开发者ID:Maximus5,项目名称:ConEmu,代码行数:51,代码来源:MProcessBits.cpp

示例13: SetDlgItemText

LRESULT CSetPgUpdate::OnInitDialog(HWND hDlg, bool abInitial)
{
	ConEmuUpdateSettings* p = &gpSet->UpdSet;

	SetDlgItemText(hDlg, tUpdateVerLocation, p->UpdateVerLocation());

	checkDlgButton(hDlg, cbUpdateCheckOnStartup, p->isUpdateCheckOnStartup);
	checkDlgButton(hDlg, cbUpdateCheckHourly, p->isUpdateCheckHourly);
	checkDlgButton(hDlg, cbUpdateConfirmDownload, !p->isUpdateConfirmDownload);
	checkRadioButton(hDlg, rbUpdateStableOnly, rbUpdateLatestAvailable,
		(p->isUpdateUseBuilds==1) ? rbUpdateStableOnly : (p->isUpdateUseBuilds==3) ? rbUpdatePreview : rbUpdateLatestAvailable);

	checkDlgButton(hDlg, cbUpdateInetTool, p->isUpdateInetTool);
	SetDlgItemText(hDlg, tUpdateInetTool, p->GetUpdateInetToolCmd());

	checkDlgButton(hDlg, cbUpdateUseProxy, p->isUpdateUseProxy);
	SetDlgItemText(hDlg, tUpdateProxy, p->szUpdateProxy);
	SetDlgItemText(hDlg, tUpdateProxyUser, p->szUpdateProxyUser);
	SetDlgItemText(hDlg, tUpdateProxyPassword, p->szUpdateProxyPassword);

	OnButtonClicked(hDlg, NULL, cbUpdateInetTool); // Enable/Disable command field, button '...' and ‘Proxy’ fields

	int nPackage = p->UpdateDownloadSetup(); // 1-exe, 2-7zip
	checkRadioButton(hDlg, rbUpdateUseExe, rbUpdateUseArc, (nPackage==1) ? rbUpdateUseExe : rbUpdateUseArc);
	wchar_t szCPU[4] = L"";
	SetDlgItemText(hDlg, tUpdateExeCmdLine, p->UpdateExeCmdLine(szCPU));
	SetDlgItemText(hDlg, tUpdateArcCmdLine, p->UpdateArcCmdLine());
	SetDlgItemText(hDlg, tUpdatePostUpdateCmd, p->szUpdatePostUpdateCmd);
	enableDlgItem(hDlg, (nPackage==1) ? tUpdateArcCmdLine : tUpdateExeCmdLine, FALSE);
	// Show used or preferred installer bitness
	CEStr szFormat, szTitle; INT_PTR iLen;
	if ((iLen = GetString(hDlg, rbUpdateUseExe, &szFormat.ms_Val)) > 0)
	{
		if (wcsstr(szFormat.ms_Val, L"%s") != NULL)
		{
			wchar_t* psz = szTitle.GetBuffer(iLen+4);
			if (psz)
			{
				_wsprintf(psz, SKIPLEN(iLen+4) szFormat.ms_Val, (nPackage == 1) ? szCPU : WIN3264TEST(L"x86",L"x64"));
				SetDlgItemText(hDlg, rbUpdateUseExe, szTitle);
			}
		}
	}

	checkDlgButton(hDlg, cbUpdateLeavePackages, p->isUpdateLeavePackages);
	SetDlgItemText(hDlg, tUpdateDownloadPath, p->szUpdateDownloadPath);

	return 0;
}
开发者ID:ForNeVeR,项目名称:ConEmu,代码行数:49,代码来源:SetPgUpdate.cpp

示例14: GetComspec

// Найти "ComSpec" и вернуть lstrdup на него
wchar_t* GetComspec(const ConEmuComspec* pOpt)
{
	wchar_t* pszComSpec = NULL;

	if (pOpt)
	{
		if ((pOpt->csType == cst_Explicit) && *pOpt->ComspecExplicit)
		{
			pszComSpec = lstrdup(pOpt->ComspecExplicit);
		}

		if (!pszComSpec && (pOpt->csBits == csb_SameOS))
		{
			BOOL bWin64 = IsWindows64();
			if (bWin64 ? *pOpt->Comspec64 : *pOpt->Comspec32)
				pszComSpec = lstrdup(bWin64 ? pOpt->Comspec64 : pOpt->Comspec32);
		}

		if (!pszComSpec && (pOpt->csBits == csb_SameApp))
		{
			BOOL bWin64 = WIN3264TEST(FALSE,TRUE);
			if (bWin64 ? *pOpt->Comspec64 : *pOpt->Comspec32)
				pszComSpec = lstrdup(bWin64 ? pOpt->Comspec64 : pOpt->Comspec32);
		}

		if (!pszComSpec)
		{
			BOOL bWin64 = (pOpt->csBits != csb_x32);
			if (bWin64 ? *pOpt->Comspec64 : *pOpt->Comspec32)
				pszComSpec = lstrdup(bWin64 ? pOpt->Comspec64 : pOpt->Comspec32);
		}
	}
	else
	{
		_ASSERTE(pOpt && L"pOpt должен быть передан, по идее");
	}

	if (!pszComSpec)
	{
		wchar_t szComSpec[MAX_PATH];
		pszComSpec = lstrdup(GetComspecFromEnvVar(szComSpec, countof(szComSpec)));
	}

	// Уже должно быть хоть что-то
	_ASSERTE(pszComSpec && *pszComSpec);
	return pszComSpec;
}
开发者ID:BigVal71,项目名称:ConEmu,代码行数:48,代码来源:WObjects.cpp

示例15: InitCommCtrls

void ConEmuAbout::OnInfo_About(LPCWSTR asPageName /*= NULL*/)
{
	InitCommCtrls();

	bool bOk = false;

	{
		DontEnable de;
		HWND hParent = (ghOpWnd && IsWindowVisible(ghOpWnd)) ? ghOpWnd : ghWnd;
		// Modal dialog
		INT_PTR iRc = DialogBoxParam(g_hInstance, MAKEINTRESOURCE(IDD_ABOUT), hParent, aboutProc, (LPARAM)asPageName);
		bOk = (iRc != 0 && iRc != -1);

		ZeroStruct(m_Btns);
		mh_AboutDlg = NULL;

		#ifdef _DEBUG
		// Any problems with dialog resource?
		if (!bOk) DisplayLastError(L"DialogBoxParam(IDD_ABOUT) failed");
		#endif
	}

	if (!bOk)
	{
		WCHAR szTitle[255];
		LPCWSTR pszBits = WIN3264TEST(L"x86",L"x64");
		LPCWSTR pszDebug = L"";
		#ifdef _DEBUG
		pszDebug = L"[DEBUG] ";
		#endif
		_wsprintf(szTitle, SKIPLEN(countof(szTitle)) L"About ConEmu (%02u%02u%02u%s %s%s)", 
			(MVV_1%100),MVV_2,MVV_3,_T(MVV_4a), pszDebug, pszBits);
		DontEnable de;
		MSGBOXPARAMS mb = {sizeof(MSGBOXPARAMS), ghWnd, g_hInstance,
			pAbout,
			szTitle,
			MB_USERICON, MAKEINTRESOURCE(IMAGE_ICON), 0, NULL, LANG_NEUTRAL
		};
		MessageBoxIndirectW(&mb);
		//MessageBoxW(ghWnd, pHelp, szTitle, MB_ICONQUESTION);
	}
}
开发者ID:NickLatysh,项目名称:conemu,代码行数:42,代码来源:AboutDlg.cpp


注:本文中的WIN3264TEST函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。