这篇教程C++ DisplayLastError函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中DisplayLastError函数的典型用法代码示例。如果您正苦于以下问题:C++ DisplayLastError函数的具体用法?C++ DisplayLastError怎么用?C++ DisplayLastError使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了DisplayLastError函数的27个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: _wsprintfvoid CDefaultTerminal::CheckRegisterOsStartup(){ LPCWSTR ValueName = StartupValueName; bool bCurState = false; bool bNeedState = gpSet->isSetDefaultTerminal && gpSet->isRegisterOnOsStartup; HKEY hk; DWORD nSize; //, nType = 0; wchar_t szCurValue[MAX_PATH*3] = {}; wchar_t szNeedValue[MAX_PATH*2+80] = {}; LONG lRc; bool bPrevTSA = false; LPCWSTR pszConfigName = gpSetCls->GetConfigName(); if (pszConfigName && !*pszConfigName) pszConfigName = NULL; _wsprintf(szNeedValue, SKIPLEN(countof(szNeedValue)) L"/"%s/" %s%s%s/SetDefTerm /Detached /MinTSA%s", gpConEmu->ms_ConEmuExe, pszConfigName ? L"/Config /"" : L"", pszConfigName ? pszConfigName : L"", pszConfigName ? L"/" " : L"", gpSet->isRegisterOnOsStartupTSA ? L"" : L" /Exit"); if (IsRegisteredOsStartup(szCurValue, countof(szCurValue)-1, &bPrevTSA) && *szCurValue) { bCurState = true; } if ((bCurState != bNeedState) || (bNeedState && (lstrcmpi(szNeedValue, szCurValue) != 0))) { if (0 == (lRc = RegCreateKeyEx(HKEY_CURRENT_USER, L"Software//Microsoft//Windows//CurrentVersion//Run", 0, NULL, 0, KEY_ALL_ACCESS, NULL, &hk, NULL))) { if (bNeedState) { nSize = ((DWORD)_tcslen(szNeedValue)+1) * sizeof(szNeedValue[0]); if (0 != (lRc = RegSetValueEx(hk, ValueName, 0, REG_SZ, (LPBYTE)szNeedValue, nSize))) { DisplayLastError(L"Failed to set ConEmuDefaultTerminal value in HKCU//Software//Microsoft//Windows//CurrentVersion//Run", lRc); } } else { if (0 != (lRc = RegDeleteValue(hk, ValueName))) { DisplayLastError(L"Failed to remove ConEmuDefaultTerminal value from HKCU//Software//Microsoft//Windows//CurrentVersion//Run", lRc); } } RegCloseKey(hk); } else { DisplayLastError(L"Failed to open HKCU//Software//Microsoft//Windows//CurrentVersion//Run for write", lRc); } }}
开发者ID:AshWilliams,项目名称:ConEmu,代码行数:54,
示例2: invalid// staticvoid Library::HandleShellExecuteError(HINSTANCE h){ /* Returns a value greater than 32 if successful, or an error value that is less than or equal to 32 otherwise. The following table lists the error values. The return value is cast as an HINSTANCE for backward compatibility with 16-bit Windows applications. It is not a true HINSTANCE, however. The only thing that can be done with the returned HINSTANCE is to cast it to an int and compare it with the value 32 or one of the error codes below. 0 The operating system is out of memory or resources. ERROR_FILE_NOT_FOUND The specified file was not found. ERROR_PATH_NOT_FOUND The specified path was not found. ERROR_BAD_FORMAT The .exe file is invalid (non-Microsoft Win32 .exe or error in .exe image). SE_ERR_ACCESSDENIED The operating system denied access to the specified file. SE_ERR_ASSOCINCOMPLETE The file name association is incomplete or invalid. SE_ERR_DDEBUSY The Dynamic Data Exchange (DDE) transaction could not be completed because other DDE transactions were being processed. SE_ERR_DDEFAIL The DDE transaction failed. SE_ERR_DDETIMEOUT The DDE transaction could not be completed because the request timed out. SE_ERR_DLLNOTFOUND The specified dynamic-link library (DLL) was not found. SE_ERR_FNF The specified file was not found. SE_ERR_NOASSOC There is no application associated with the given file name extension. This error will also be returned if you attempt to print a file that is not printable. SE_ERR_OOM There was not enough memory to complete the operation. SE_ERR_PNF The specified path was not found. SE_ERR_SHARE A sharing violation occurred. */ int nError = (int) h; if (nError > 32) // no error return; DisplayLastError("");}
开发者ID:omerdagan84,项目名称:neomem,代码行数:33,
示例3: wcscpy_cvoid ConEmuAbout::OnInfo_WhatsNew(bool bLocal){ wchar_t sFile[MAX_PATH+80]; int iExec = -1; if (bLocal) { wcscpy_c(sFile, gpConEmu->ms_ConEmuBaseDir); wcscat_c(sFile, L"//WhatsNew-ConEmu.txt"); if (FileExists(sFile)) { iExec = (int)ShellExecute(ghWnd, L"open", sFile, NULL, NULL, SW_SHOWNORMAL); if (iExec >= 32) { return; } } } wcscpy_c(sFile, gsWhatsNew); iExec = (int)ShellExecute(ghWnd, L"open", sFile, NULL, NULL, SW_SHOWNORMAL); if (iExec >= 32) { return; } DisplayLastError(L"File 'WhatsNew-ConEmu.txt' not found, go to web page failed", iExec);}
开发者ID:Alexander-Shukaev,项目名称:ConEmu,代码行数:30,
示例4: GetTickCountvoid ConEmuAbout::OnInfo_ReportCrash(LPCWSTR asDumpWasCreatedMsg){ if (nLastCrashReported) { // if previous gsReportCrash was opened less than 60 sec ago DWORD nLast = GetTickCount() - nLastCrashReported; if (nLast < 60000) { // Skip this time return; } } if (asDumpWasCreatedMsg && !*asDumpWasCreatedMsg) { asDumpWasCreatedMsg = NULL; } DWORD shellRc = (DWORD)(INT_PTR)ShellExecute(ghWnd, L"open", gsReportCrash, NULL, NULL, SW_SHOWNORMAL); if (shellRc <= 32) { DisplayLastError(L"ShellExecute failed", shellRc); } else if (asDumpWasCreatedMsg) { MsgBox(asDumpWasCreatedMsg, MB_OK|MB_ICONEXCLAMATION|MB_SYSTEMMODAL); } nLastCrashReported = GetTickCount();}
开发者ID:Alexander-Shukaev,项目名称:ConEmu,代码行数:30,
示例5: MultiByteToWideCharNS_IMETHODIMPWinCEUConvAdapter::GetMaxLength(const char * aSrc, PRInt32 aSrcLength, PRInt32 * aDestLength){ if (mCodepage == -1 || aSrc == nsnull ) return NS_ERROR_FAILURE; int count = MultiByteToWideChar(mCodepage, MB_PRECOMPOSED, aSrc, aSrcLength, NULL, NULL); if (count == 0 && GetLastError() == ERROR_INVALID_PARAMETER) { // fall back on the current system Windows "ANSI" code page count = MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, aSrc, aSrcLength, NULL, NULL); } #ifdef ALERT_DBG if (count == 0) DisplayLastError("MultiByteToWideChar (0)");#endif *aDestLength = count; return NS_OK;}
开发者ID:MozillaOnline,项目名称:gecko-dev,代码行数:35,
示例6: wcscpy_cbool CConEmuUpdate::CanUpdateInstallation(){ if (UpdateDownloadSetup() == 1) { // Если через Setupper - то msi сам разберется и ругнется когда надо return true; } // Раз дошли сюда - значит ConEmu был просто "распакован" if (IsUserAdmin()) { // ConEmu запущен "Под администратором", проверки не нужны return true; } wchar_t szTestFile[MAX_PATH*2]; wcscpy_c(szTestFile, gpConEmu->ms_ConEmuExeDir); wcscat_c(szTestFile, L"//ConEmuUpdate.check"); HANDLE hFile = CreateFile(szTestFile, GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL|FILE_ATTRIBUTE_TEMPORARY, NULL); if (hFile == INVALID_HANDLE_VALUE) { DWORD nErr = GetLastError(); wcscpy_c(szTestFile, L"Can't update installation folder!/r/n"); wcscat_c(szTestFile, gpConEmu->ms_ConEmuExeDir); DisplayLastError(szTestFile, nErr); return false; } CloseHandle(hFile); DeleteFile(szTestFile); // OK return true;}
开发者ID:NickLatysh,项目名称:conemu,代码行数:35,
示例7: GetSysColorvoid CTabPanelWin::ShowToolbar(bool bShow){ if (bShow) { if (!IsToolbarCreated() && (CreateToolbar() != NULL)) { REBARBANDINFO rbBand = {80}; // не используем size, т.к. приходит "новый" размер из висты и в XP обламываемся rbBand.fMask = RBBIM_SIZE | RBBIM_CHILD | RBBIM_CHILDSIZE | RBBIM_ID | RBBIM_STYLE | RBBIM_COLORS; rbBand.fStyle = RBBS_CHILDEDGE | RBBS_FIXEDSIZE | RBBS_VARIABLEHEIGHT; rbBand.clrBack = GetSysColor(COLOR_BTNFACE); rbBand.clrFore = GetSysColor(COLOR_BTNTEXT); SIZE sz = {0,0}; SendMessage(mh_Toolbar, TB_GETMAXSIZE, 0, (LPARAM)&sz); // Set values unique to the band with the toolbar. rbBand.wID = 2; rbBand.hwndChild = mh_Toolbar; rbBand.cx = rbBand.cxMinChild = rbBand.cxIdeal = mn_LastToolbarWidth = sz.cx; rbBand.cyChild = rbBand.cyMinChild = rbBand.cyMaxChild = sz.cy + mn_ThemeHeightDiff; // Add the band that has the toolbar. if (!SendMessage(mh_Rebar, RB_INSERTBAND, (WPARAM)-1, (LPARAM)&rbBand)) { DisplayLastError(_T("Can't initialize rebar (toolbar)")); } } } else { _ASSERTEX(bShow); }}
开发者ID:martell,项目名称:ConEmu,代码行数:34,
示例8: SetForegroundWindowvoid CEFindDlg::FindTextDialog(){ if (mh_FindDlg && IsWindow(mh_FindDlg)) { SetForegroundWindow(mh_FindDlg); return; } CVConGuard VCon; CRealConsole* pRCon = (CVConGroup::GetActiveVCon(&VCon) >= 0) ? VCon->RCon() : NULL; // Создаем диалог поиска только для консольных приложений if (!pRCon || (pRCon->GuiWnd() && !pRCon->isBufferHeight()) || !pRCon->GetView()) { //DisplayLastError(L"No RealConsole, nothing to find"); return; } gpConEmu->SkipOneAppsRelease(true); mh_FindDlg = CreateDialogParam((HINSTANCE)GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_FIND), ghWnd, findTextProc, 0/*Param*/); if (!mh_FindDlg) { DisplayLastError(L"Can't create Find text dialog", GetLastError()); }}
开发者ID:G-VAR,项目名称:ConEmu,代码行数:26,
示例9: WideCharToMultiByteNS_IMETHODIMPWinCEUConvAdapter::Convert(const PRUnichar * aSrc, PRInt32 * aSrcLength, char * aDest, PRInt32 * aDestLength){ if (mCodepage == -1) return NS_ERROR_FAILURE; char * defaultChar = "?"; int count = WideCharToMultiByte(mCodepage, 0, aSrc, *aSrcLength, aDest, *aDestLength, defaultChar, NULL); #ifdef ALERT_DBG if (count == 0) DisplayLastError("WideCharToMultiByte");#endif *aSrcLength = count; *aDestLength = count; return NS_OK;}
开发者ID:MozillaOnline,项目名称:gecko-dev,代码行数:29,
示例10: MyOpenClipboardbool MyOpenClipboard(LPCWSTR asAction){ _ASSERTE(gnMyClipboardOpened==0 || gnMyClipboardOpened==1); if (gnMyClipboardOpened > 0) { InterlockedIncrement(&gnMyClipboardOpened); return true; } BOOL lbRc; int iMaxTries = 100; // Open Windows' clipboard while (!(lbRc = OpenClipboard((ghWnd && IsWindow(ghWnd)) ? ghWnd : NULL)) && (iMaxTries-- > 0)) { DWORD dwErr = GetLastError(); wchar_t szCode[32]; _wsprintf(szCode, SKIPCOUNT(szCode) L", Code=%u", dwErr); wchar_t* pszMsg = lstrmerge(L"OpenClipboard failed (", asAction, L")", szCode); LogString(pszMsg); int iBtn = DisplayLastError(pszMsg, dwErr, MB_RETRYCANCEL|MB_ICONSTOP); SafeFree(pszMsg); if (iBtn != IDRETRY) return false; } InterlockedIncrement(&gnMyClipboardOpened); _ASSERTE(gnMyClipboardOpened==1); LogString(L"OpenClipboard succeeded"); return true;}
开发者ID:ForNeVeR,项目名称:ConEmu,代码行数:34,
示例11: switchbool CDlgItemHelper::ProcessHyperlinkCtrl(HWND hDlg, WORD nCtrlId){ if (!isHyperlinkCtrl(nCtrlId)) { return false; } CEStr lsUrl; switch (nCtrlId) { case stConEmuUrl: lsUrl = gsHomePage; break; case stHomePage: lsUrl = gsFirstStart; break; default: if (GetString(hDlg, nCtrlId, &lsUrl.ms_Val) <= 0) return false; if ((0 != wcsncmp(lsUrl, L"http://", 7)) && (0 != wcsncmp(lsUrl, L"https://", 8)) ) return false; } DWORD shellRc = (DWORD)(INT_PTR)ShellExecute(ghWnd, L"open", lsUrl, NULL, NULL, SW_SHOWNORMAL); if (shellRc <= 32) { DisplayLastError(L"ShellExecute failed", shellRc); return false; } return true;}
开发者ID:2asoft,项目名称:ConEmu,代码行数:34,
示例12: _ASSERTE// Открыть диалог с подтверждением параметров создания/закрытия/пересоздания консолиint CRecreateDlg::RecreateDlg(RConStartArgsEx* apArgs, bool abDontAutoSelCmd /*= false*/){ if (!this) { _ASSERTE(this); return IDCANCEL; } mb_DontAutoSelCmd = abDontAutoSelCmd; if (mh_Dlg && IsWindow(mh_Dlg)) { DisplayLastError(L"Close previous 'Create dialog' first, please!", -1); return IDCANCEL; } DontEnable de; gpConEmu->SkipOneAppsRelease(true); //if (!gpConEmu->mh_RecreatePasswFont) //{ // gpConEmu->mh_RecreatePasswFont = CreateFont( //} mn_DlgRc = IDCANCEL; mp_Args = apArgs; mh_Parent = (apArgs->aRecreate == cra_EditTab && ghOpWnd) ? ghOpWnd : ghWnd; #ifdef _DEBUG if ((mh_Parent == ghWnd) && gpConEmu->isIconic()) { _ASSERTE(FALSE && "Window must be shown before dialog!"); } #endif InitVars(); bool bPrev = gpConEmu->SetSkipOnFocus(true); CDpiForDialog::Create(mp_DpiAware); // Modal dialog (CreateDialog) int nRc = CDynDialog::ExecuteDialog(IDD_RESTART, mh_Parent, RecreateDlgProc, (LPARAM)this); UNREFERENCED_PARAMETER(nRc); gpConEmu->SetSkipOnFocus(bPrev); FreeVars(); //if (gpConEmu->mh_RecreatePasswFont) //{ // DeleteObject(gpConEmu->mh_RecreatePasswFont); // gpConEmu->mh_RecreatePasswFont = NULL; //} gpConEmu->SkipOneAppsRelease(false); return mn_DlgRc;}
开发者ID:davgit,项目名称:ConEmu,代码行数:60,
示例13: DisplayLastErrorvoid ConEmuAbout::OnInfo_ReportBug(){ DWORD shellRc = (DWORD)(INT_PTR)ShellExecute(ghWnd, L"open", gsReportBug, NULL, NULL, SW_SHOWNORMAL); if (shellRc <= 32) { DisplayLastError(L"ShellExecute failed", shellRc); }}
开发者ID:Alexander-Shukaev,项目名称:ConEmu,代码行数:8,
示例14: LoadResourcesvoid ConEmuAbout::DonateBtns_Add(HWND hDlg, int AlignLeftId, int AlignVCenterId){ if (!m_Btns[0].pImg) LoadResources(); RECT rcLeft = {}, rcTop = {}; HWND hCtrl; hCtrl = GetDlgItem(hDlg, AlignLeftId); GetWindowRect(hCtrl, &rcLeft); MapWindowPoints(NULL, hDlg, (LPPOINT)&rcLeft, 2); hCtrl = GetDlgItem(hDlg, AlignVCenterId); GetWindowRect(hCtrl, &rcTop); int nPreferHeight = rcTop.bottom - rcTop.top; MapWindowPoints(NULL, hDlg, (LPPOINT)&rcTop, 2); #ifdef _DEBUG DpiValue dpi; CDpiAware::QueryDpiForWindow(hDlg, &dpi); #endif int X = rcLeft.left; for (size_t i = 0; i < countof(m_Btns); i++) { if (!m_Btns[i].pImg) continue; // Image was failed TODO("Вертикальное центрирование по объекту AlignVCenterId"); int nDispW = 0, nDispH = 0; if (!m_Btns[i].pImg->GetSizeForHeight(nPreferHeight, nDispW, nDispH)) { _ASSERTE(FALSE && "Image not available for dpi?"); continue; // Image was failed? } _ASSERTE(nDispW>0 && nDispH>0); int nY = rcTop.top + ((rcTop.bottom - rcTop.top - nDispH + 1) / 2); hCtrl = CreateWindow(L"STATIC", m_Btns[i].ResId, WS_CHILD|WS_VISIBLE|SS_NOTIFY|SS_OWNERDRAW, X, nY, nDispW, nDispH, hDlg, (HMENU)m_Btns[i].nCtrlId, g_hInstance, NULL); #ifdef _DEBUG if (!hCtrl) DisplayLastError(L"Failed to create image button control"); #endif //X += nDispW + (10 * dpi.Ydpi / 96); X += nDispW + (nDispH / 3); } RegisterTip(hDlg); UNREFERENCED_PARAMETER(hCtrl);}
开发者ID:Alexander-Shukaev,项目名称:ConEmu,代码行数:57,
示例15: szUrlvoid ConEmuAbout::OnInfo_OnlineWiki(LPCWSTR asPageName /*= NULL*/){ CEStr szUrl(lstrmerge(CEWIKIBASE, asPageName ? asPageName : L"TableOfContents", L".html")); DWORD shellRc = (DWORD)(INT_PTR)ShellExecute(ghWnd, L"open", szUrl, NULL, NULL, SW_SHOWNORMAL); if (shellRc <= 32) { DisplayLastError(L"ShellExecute failed", shellRc); }}
开发者ID:Alexander-Shukaev,项目名称:ConEmu,代码行数:9,
示例16: _ASSERTEHWND CConEmuChild::CreateView(){ if (!this) { _ASSERTE(this!=NULL); return NULL; } if (mh_WndDC || mh_WndBack) { _ASSERTE(mh_WndDC == NULL && mh_WndBack == NULL); return mh_WndDC; } if (!gpConEmu->isMainThread()) { // Окно должно создаваться в главной нити! HWND hCreate = gpConEmu->PostCreateView(this); UNREFERENCED_PARAMETER(hCreate); _ASSERTE(hCreate && (hCreate == mh_WndDC)); return mh_WndDC; } CVirtualConsole* pVCon = (CVirtualConsole*)this; _ASSERTE(pVCon!=NULL); //-- тут консоль только создается, guard не нужен //CVConGuard guard(pVCon); TODO("Заменить ghWnd на ghWndWork"); HWND hParent = ghWnd; // Имя класса - то же самое, что и у главного окна DWORD style = /*WS_VISIBLE |*/ WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN; DWORD styleEx = 0; RECT rcBack = gpConEmu->CalcRect(CER_BACK, pVCon); RECT rc = gpConEmu->CalcRect(CER_DC, rcBack, CER_BACK, pVCon); mh_WndBack = CreateWindowEx(styleEx, gsClassNameBack, L"BackWND", style, rcBack.left, rcBack.top, rcBack.right - rcBack.left, rcBack.bottom - rcBack.top, hParent, NULL, (HINSTANCE)g_hInstance, pVCon); mn_WndDCStyle = style; mn_WndDCExStyle = styleEx; mh_WndDC = CreateWindowEx(styleEx, gsClassName, L"DrawWND", style, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, hParent, NULL, (HINSTANCE)g_hInstance, pVCon); if (!mh_WndDC || !mh_WndBack) { DisplayLastError(L"Can't create DC window!"); return NULL; // } SetWindowPos(mh_WndDC, HWND_TOP, 0,0,0,0, SWP_NOMOVE|SWP_NOSIZE); // Установить переменную среды с дескриптором окна SetConEmuEnvVar(mh_WndDC); return mh_WndDC;}
开发者ID:havocbane,项目名称:ConEmu,代码行数:56,
示例17: _ASSERTEvoid ConEmuAbout::LoadResources(){ struct ImgLoadInfo { LPCWSTR ResId; UINT nCtrlId; int nWidth; int nHeight; } Images[] = { {L"DONATE", pLinkDonate, 74, 21}, {L"FLATTR", pLinkFlattr, 89, 18}, }; _ASSERTE(countof(m_Btns) == countof(Images)); for (size_t i = 0; i < countof(Images); i++) { if (m_Btns[i].hBmp) continue; // Already loaded m_Btns[i].ResId = Images[i].ResId; m_Btns[i].nCtrlId = Images[i].nCtrlId; m_Btns[i].pszUrl = (Images[i].nCtrlId == pLinkDonate) ? gsDonatePage : gsFlattrPage; m_Btns[i].hBmp = (HBITMAP)LoadImage(g_hInstance, Images[i].ResId, IMAGE_BITMAP, 0, 0, LR_LOADTRANSPARENT|LR_LOADMAP3DCOLORS); if (m_Btns[i].hBmp == NULL) { #ifdef _DEBUG DWORD nErr = GetLastError(); DisplayLastError(L"Failed to load button image!", nErr); #endif m_Btns[i].bmp.bmWidth = Images[i].nWidth; m_Btns[i].bmp.bmHeight = Images[i].nHeight; } else { ZeroStruct(m_Btns[i].bmp); if (!GetObject(m_Btns[i].hBmp, sizeof(m_Btns[i].bmp), &m_Btns[i].bmp) || m_Btns[i].bmp.bmWidth <= 0 || m_Btns[i].bmp.bmHeight <= 0) { #ifdef _DEBUG DWORD nErr = GetLastError(); DisplayLastError(L"GetObject() on button image failed!", nErr); #endif m_Btns[i].bmp.bmWidth = Images[i].nWidth; m_Btns[i].bmp.bmHeight = Images[i].nHeight; } } }}
开发者ID:rheostat2718,项目名称:conemu-maximus5,代码行数:43,
示例18: DisplayLastErrorvoid CPushInfo::OpenNotificationUrl(){ if (!mp_Active || !mp_Active->pszUrl) return; DWORD shellRc = (DWORD)(INT_PTR)ShellExecute(ghWnd, L"open", mp_Active->pszUrl, NULL, NULL, SW_SHOWNORMAL); if (shellRc <= 32) { DisplayLastError(L"ShellExecute failed", shellRc); }}
开发者ID:ForNeVeR,项目名称:ConEmu,代码行数:10,
示例19: _ASSERTE// Открыть диалог с подтверждением параметров создания/закрытия/пересоздания консолиint CRecreateDlg::RecreateDlg(RConStartArgs* apArgs){ if (!this) { _ASSERTE(this); return IDCANCEL; } if (mh_Dlg && IsWindow(mh_Dlg)) { DisplayLastError(L"Close previous 'Create dialog' first, please!", -1); return IDCANCEL; } DontEnable de; gpConEmu->SkipOneAppsRelease(true); //if (!gpConEmu->mh_RecreatePasswFont) //{ // gpConEmu->mh_RecreatePasswFont = CreateFont( //} mn_DlgRc = IDCANCEL; mp_Args = apArgs; mh_Parent = (apArgs->aRecreate == cra_EditTab && ghOpWnd) ? ghOpWnd : ghWnd; #ifdef _DEBUG if ((mh_Parent == ghWnd) && gpConEmu->isIconic()) { _ASSERTE(FALSE && "Window must be shown before dialog!"); } #endif InitVars(); bool bPrev = gpConEmu->SetSkipOnFocus(true); int nRc = DialogBoxParam(g_hInstance, MAKEINTRESOURCE(IDD_RESTART), mh_Parent, RecreateDlgProc, (LPARAM)this); UNREFERENCED_PARAMETER(nRc); gpConEmu->SetSkipOnFocus(bPrev); FreeVars(); //if (gpConEmu->mh_RecreatePasswFont) //{ // DeleteObject(gpConEmu->mh_RecreatePasswFont); // gpConEmu->mh_RecreatePasswFont = NULL; //} gpConEmu->SkipOneAppsRelease(false); return mn_DlgRc;}
开发者ID:rheostat2718,项目名称:conemu-maximus5,代码行数:56,
示例20: DisplayLastErrorbool CDlgItemHelper::OpenHyperlink(CEStr& url, HWND hParent){ DWORD shellRc = (DWORD)(INT_PTR)ShellExecute(hParent, L"open", url, NULL, NULL, SW_SHOWNORMAL); if (shellRc <= 32) { DisplayLastError(L"ShellExecute failed", shellRc); return false; } return true;}
开发者ID:Maximus5,项目名称:ConEmu,代码行数:11,
示例21: InitCommCtrlsvoid ConEmuAbout::OnInfo_About(LPCWSTR asPageName /*= NULL*/){ InitCommCtrls(); bool bOk = false; if (!asPageName && sLastOpenTab[0]) { // Reopen last active tab asPageName = sLastOpenTab; } ReloadSysInfo(); { DontEnable de; if (!mp_DpiAware) mp_DpiAware = new CDpiForDialog(); HWND hParent = (ghOpWnd && IsWindowVisible(ghOpWnd)) ? ghOpWnd : ghWnd; // Modal dialog (CreateDialog) INT_PTR iRc = CDynDialog::ExecuteDialog(IDD_ABOUT, hParent, aboutProc, (LPARAM)asPageName); bOk = (iRc != 0 && iRc != -1); mh_AboutDlg = NULL; if (mp_DpiAware) mp_DpiAware->Detach(); #ifdef _DEBUG // Any problems with dialog resource? if (!bOk) DisplayLastError(L"DialogBoxParam(IDD_ABOUT) failed"); #endif } if (!bOk) { wchar_t* pszTitle = lstrmerge(gpConEmu->GetDefaultTitle(), L" About"); DontEnable de; MSGBOXPARAMS mb = {sizeof(MSGBOXPARAMS), ghWnd, g_hInstance, pAbout, pszTitle, MB_USERICON, MAKEINTRESOURCE(IMAGE_ICON), 0, NULL, LANG_NEUTRAL }; SafeFree(pszTitle); // Use MessageBoxIndirect instead of MessageBox to show our icon instead of std ICONINFORMATION MessageBoxIndirect(&mb); }}
开发者ID:Alexander-Shukaev,项目名称:ConEmu,代码行数:47,
示例22: LoadResourcesvoid ConEmuAbout::DonateBtns_Add(HWND hDlg, int AlignLeftId, int AlignVCenterId){ if (!m_Btns[0].hBmp) LoadResources(); RECT rcLeft = {}, rcTop = {}; HWND hCtrl; hCtrl = GetDlgItem(hDlg, AlignLeftId); GetWindowRect(hCtrl, &rcLeft); MapWindowPoints(NULL, hDlg, (LPPOINT)&rcLeft, 2); hCtrl = GetDlgItem(hDlg, AlignVCenterId); GetWindowRect(hCtrl, &rcTop); MapWindowPoints(NULL, hDlg, (LPPOINT)&rcTop, 2); int nDisplayDpi = gpSetCls->QueryDpi(); int X = rcLeft.left; for (size_t i = 0; i < countof(m_Btns); i++) { if (!m_Btns[i].hBmp) continue; // Image was failed TODO("Вертикальное центрирование по объекту AlignVCenterId"); int nDispW = m_Btns[i].bmp.bmWidth * nDisplayDpi / 96; int nDispH = m_Btns[i].bmp.bmHeight * nDisplayDpi / 96; int nY = rcTop.top + ((rcTop.bottom - rcTop.top - nDispH + 1) / 2); hCtrl = CreateWindow(L"STATIC", m_Btns[i].ResId, WS_CHILD|WS_VISIBLE|SS_NOTIFY|SS_OWNERDRAW, X, nY, nDispW, nDispH, hDlg, (HMENU)m_Btns[i].nCtrlId, g_hInstance, NULL); #ifdef _DEBUG if (!hCtrl) DisplayLastError(L"Failed to create image button control"); #endif X += nDispW + (10 * nDisplayDpi / 96); } RegisterTip(hDlg); UNREFERENCED_PARAMETER(hCtrl);}
开发者ID:rheostat2718,项目名称:conemu-maximus5,代码行数:47,
示例23: _ASSERTEvoid CTabPanelWin::ShowToolsPane(bool bShow){ if (bShow) { _ASSERTE(isMainThread()); if (!IsToolbarCreated() && (CreateToolbar() != NULL)) { REBARBANDINFO rbBand = {REBARBANDINFO_SIZE}; // не используем size, т.к. приходит "новый" размер из висты и в XP обламываемся rbBand.fMask = RBBIM_SIZE | RBBIM_CHILD | RBBIM_CHILDSIZE | RBBIM_ID | RBBIM_STYLE; rbBand.fStyle = RBBS_CHILDEDGE | RBBS_FIXEDSIZE | RBBS_VARIABLEHEIGHT; #if 0 rbBand.fMask |= RBBIM_COLORS; rbBand.clrFore = RGB(255,255,255); rbBand.clrBack = RGB(0,0,255); #endif SIZE sz = {0,0}; SendMessage(mh_Toolbar, TB_GETMAXSIZE, 0, (LPARAM)&sz); rbBand.wID = rbi_ToolBar; rbBand.hwndChild = mh_Toolbar; rbBand.cx = rbBand.cxMinChild = rbBand.cxIdeal = mn_LastToolbarWidth = sz.cx; rbBand.cyChild = rbBand.cyMinChild = rbBand.cyMaxChild = sz.cy + mn_ThemeHeightDiff; if (!SendMessage(mh_Rebar, RB_INSERTBAND, (WPARAM)-1, (LPARAM)&rbBand)) { DisplayLastError(_T("Can't initialize rebar (toolbar)")); } } } else { _ASSERTEX(!bShow); INT_PTR nPaneIndex = SendMessage(mh_Rebar, RB_IDTOINDEX, rbi_ToolBar, 0); if (nPaneIndex >= 0) { SendMessage(mh_Rebar, RB_DELETEBAND, nPaneIndex, 0); DestroyWindow(mh_Toolbar); mh_Toolbar = NULL; } }}
开发者ID:negadj,项目名称:ConEmu,代码行数:44,
示例24: _tmain//----------------------------------------------------------------------////Main entry for program////----------------------------------------------------------------------int _tmain(int argc, TCHAR *argv[]){ LPTSTR lpLogoffRemote, lpLogoffLocal; // // Parse command line // if (!ParseCommandLine(argc, argv)) { PrintUsage(); return 1; } // //Should we log off session on remote server? // if (szRemoteServerName) { if (bVerbose) { if (AllocAndLoadString(&lpLogoffRemote, GetModuleHandle(NULL), IDS_LOGOFF_REMOTE)) _putts(lpLogoffRemote); } //FIXME: Add Remote Procedure Call to logoff user on a remote machine _ftprintf(stderr, "Remote Procedure Call in logoff.exe has not been implemented"); } // //Perform logoff of current session on local machine instead // else { if (bVerbose) { //Get resource string, and print it. if (AllocAndLoadString(&lpLogoffLocal, GetModuleHandle(NULL), IDS_LOGOFF_LOCAL)) _putts(lpLogoffLocal); } //Actual logoff if (!ExitWindows(NULL, NULL)) { DisplayLastError(); return 1; } } return 0;}
开发者ID:RareHare,项目名称:reactos,代码行数:48,
示例25: xGetSelectedText/* xGetSelectedText - built-in function 'get-selected-text' */static xlValue xGetSelectedText(void){ DWORD start,end,length; xlValue obj,str; Widget *widget; HLOCAL hText; char *p; /* parse the arguments */ obj = xlGetArgInstance(c_basicEditText); xlLastArg(); /* get the widget structure */ widget = GetWidget(obj); /* get the selection */ SendMessage(widget->wnd,EM_GETSEL,(WPARAM)&start,(LPARAM)&end); /* compute the text length */ if ((length = end - start) < 0) return xlNil; /* get a handle to the edit text */ if ((hText = (HLOCAL)SendMessage(widget->wnd,EM_GETHANDLE,0,0)) == NULL) return xlNil; /* allocate a string and get the selection */ xlCPush(obj); str = xlNewString((xlFIXTYPE)length); if ((p = (char *)LocalLock(hText)) == NULL) { DisplayLastError(); str = xlNil; } else { memcpy(xlGetString(str),p,length); LocalUnlock(hText); } xlDrop(1); /* return the string */ return str;}
开发者ID:navoj,项目名称:xlisp,代码行数:43,
示例26: InitCommCtrlsvoid 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,
示例27: SetForegroundWindowvoid CEFindDlg::FindTextDialog(){ if (mh_FindDlg && IsWindow(mh_FindDlg)) { SetForegroundWindow(mh_FindDlg); return; } CVConGuard VCon; CRealConsole* pRCon = (CVConGroup::GetActiveVCon(&VCon) >= 0) ? VCon->RCon() : NULL; // Создаем диалог поиска только для консольных приложений if (!pRCon || (pRCon->GuiWnd() && !pRCon->isBufferHeight()) || !pRCon->GetView()) { //DisplayLastError(L"No RealConsole, nothing to find"); return; } if (gpConEmu->mp_TabBar && gpConEmu->mp_TabBar->ActivateSearchPane(true)) { // Контрол поиска встроен и показан в панели инструментов return; } gpConEmu->SkipOneAppsRelease(true); if (!mp_DpiAware) mp_DpiAware = new CDpiForDialog(); // (CreateDialog) mp_Dlg = CDynDialog::ShowDialog(IDD_FIND, ghWnd, findTextProc, 0/*Param*/); mh_FindDlg = mp_Dlg ? mp_Dlg->mh_Dlg : NULL; if (!mh_FindDlg) { DisplayLastError(L"Can't create Find text dialog", GetLastError()); }}
开发者ID:ChunHungLiu,项目名称:ConEmu,代码行数:37,
注:本文中的DisplayLastError函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ DisplayLog函数代码示例 C++ DisplayHelp函数代码示例 |