这篇教程C++ IsDialogMessage函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中IsDialogMessage函数的典型用法代码示例。如果您正苦于以下问题:C++ IsDialogMessage函数的具体用法?C++ IsDialogMessage怎么用?C++ IsDialogMessage使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了IsDialogMessage函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: VTranslateDialogMessage/** Global Function to translate dialog messages.*/VBOOL VTranslateDialogMessage(MSG const& msg){ HWND hWndTop = msg.hwnd; /* Obtain the top level window. All dialogs are typically defined as top level popups.*/ while ( hWndTop ) { if ( GetWindowLong(hWndTop, GWL_STYLE) & WS_CHILD ) hWndTop = GetParent(hWndTop); else break; } /* Obtain the associated window pointer (if a VWCL window).*/ VWindow* pWindow = VWindow::GetVWindowFromHandle(hWndTop); if ( !pWindow ) return VFALSE; VBOOL bResult = VFALSE; /* Is it a dialog box?*/ if ( pWindow->IsVDialogType() ) { bResult = IsDialogMessage(hWndTop, (MSG*)&msg); /* Is it a modeless property sheet?*/ if ( !bResult && pWindow->GetRTTI() == VWindow::VWCL_RTTI_PROPERTY_SHEET && !((VDialog*)pWindow)->IsModal() ) bResult = PropSheet_IsDialogMessage(hWndTop, &msg); } /* Return result.*/ return bResult;}
开发者ID:OCLC-Developer-Network,项目名称:MARCView-Convert,代码行数:38,
示例2: WinMainint WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow){ // создание главного окна HWND hwnd; MSG msg; WNDCLASS w; memset(&w, 0, sizeof(WNDCLASS)); w.style = CS_HREDRAW | CS_VREDRAW; w.lpfnWndProc = WndProc; w.hInstance = hInstance; w.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH); w.lpszClassName = L"Основное окно"; //регистрируем класс окна RegisterClass(&w); hwnd = CreateWindow(w.lpszClassName, w.lpszClassName, WS_OVERLAPPEDWINDOW, 10, 10, 290, 100, NULL, NULL, hInstance, NULL); ShowWindow(hwnd, nCmdShow); UpdateWindow(hwnd); // добавление кнопки на главное окно CreateWindow(L"Button", L"Создать модальный диалог!", WS_CHILD | WS_VISIBLE, 10, 10, 250, 30, hwnd, (HMENU)ID_BUTTON, hInstance, NULL); //запускаем цикл обработки сообщений while (GetMessage(&msg, NULL, 0, 0)) { if (hDlgModal == 0 || !IsDialogMessage(hDlgModal, &msg)) { TranslateMessage(&msg); DispatchMessage(&msg); } } return msg.wParam;}
开发者ID:ShartepStudy,项目名称:STUDY,代码行数:36,
示例3: WinMainint APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdParam, int nCmdShow){ MSG msg; bstr *str; product = GetProduct(); str = bstr_new(); bstr_assign(str, "Are you sure you want to uninstall "); bstr_append(str, product); bstr_append(str, " ?"); if (MessageBox(NULL, str->text, "Uninstall", MB_YESNO) == IDNO) return (1); bstr_free(str, TRUE); hInst = hInstance; if (!hPrevInstance) RegisterSepClass(hInstance); mainDlg = CreateDialog(hInstance, MAKEINTRESOURCE(1), NULL, MainDlgProc); SetGuiFont(mainDlg); EnableWindow(GetDlgItem(mainDlg, BT_DELOK), FALSE); ShowWindow(mainDlg, SW_SHOW); ShowWindow(GetDlgItem(mainDlg, ST_DELDONE), SW_HIDE); while (GetMessage(&msg, NULL, 0, 0)) { if (!IsDialogMessage(mainDlg, &msg)) { TranslateMessage(&msg); DispatchMessage(&msg); } } return 0;}
开发者ID:dror-g,项目名称:nn-colletion,代码行数:36,
示例4: whilebool GWMain::processMessage(){ while (PeekMessage(¤tMsg, NULL, 0, 0, PM_REMOVE)) { // Check for exit. if (currentMsg.message == WM_QUIT) { exitCode = currentMsg.wParam; return false; } // Dialog boxes need to have their messages // translated differently. GWWindow* win = GWMap::getWindow(currentMsg.hwnd); if (win && dynamic_cast<GWDialog*>(win)) if (IsDialogMessage(currentMsg.hwnd,¤tMsg)) return true; if (hAccel && TranslateAccelerator(currentMsg.hwnd,hAccel,¤tMsg)) return true; // Normal translate/dispatch TranslateMessage(¤tMsg); DispatchMessage(¤tMsg); } return true;}
开发者ID:AltimorTASDK,项目名称:TribesRebirth,代码行数:24,
示例5: _tWinMainint APIENTRY _tWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ LPTSTR lpCmdLine, _In_ int nCmdShow){ HWND hDlg = CreateDialogParam(hInstance, MAKEINTRESOURCE(IDD_DLG_MAIN), NULL , DlgProc, reinterpret_cast<LPARAM>(hInstance)); ShowWindow(hDlg, SW_SHOW); // Main message loop: BOOL ret; MSG msg; while (GetMessage(&msg, NULL, 0, 0)) { if(!IsDialogMessage(hDlg, &msg)) { TranslateMessage(&msg); DispatchMessage(&msg); } } return (int) msg.wParam;}
开发者ID:Kerogi,项目名称:swas,代码行数:24,
示例6: GetMsgProcstatic LRESULT CALLBACK GetMsgProc(int nCode, WPARAM wParam, LPARAM lParam){ LPMSG lpMsg = (LPMSG) lParam; if ( (nCode >= 0) && (wParam == PM_REMOVE) ) { // Don't translate non-input events. if ( (lpMsg->message >= WM_KEYFIRST) && (lpMsg->message <= WM_KEYLAST) ) { if ( IsDialogMessage(s_hDlg, lpMsg) ) { // The value returned from this hookproc is ignored, // and it cannot be used to tell Windows the message has been handled. // To avoid further processing, convert the message to WM_NULL // before returning. lpMsg->message = WM_NULL; lpMsg->lParam = 0; lpMsg->wParam = 0; } } } return CallNextHookEx(s_hMsgHook, nCode, wParam, lParam);}
开发者ID:tbourg,项目名称:perso,代码行数:24,
示例7: CallNextHookEx/*================rvGETransformer::GetMsgProcEnsures normal dialog functions work in the transformer dialog================*/LRESULT FAR PASCAL rvGETransformer::GetMsgProc ( int nCode, WPARAM wParam, LPARAM lParam ){ LPMSG lpMsg = (LPMSG) lParam; if ( nCode >= 0 && PM_REMOVE == wParam ) { // Don't translate non-input events. if ( lpMsg->message != WM_SYSCHAR && (lpMsg->message >= WM_KEYFIRST && lpMsg->message <= WM_KEYLAST) ) { if ( IsDialogMessage( gTransDlg, lpMsg) ) { // The value returned from this hookproc is ignored, // and it cannot be used to tell Windows the message has been handled. // To avoid further processing, convert the message to WM_NULL // before returning. lpMsg->message = WM_NULL; lpMsg->lParam = 0; lpMsg->wParam = 0; } } } return CallNextHookEx(gTransHook, nCode, wParam, lParam);}
开发者ID:Salamek,项目名称:Shadow-of-Dust,代码行数:31,
示例8: IsDialogMessageBOOL CSelectUserDlg::PreTranslateMessage(MSG* pMsg){ return IsDialogMessage(pMsg);}
开发者ID:TonyAlloa,项目名称:miranda-dev,代码行数:4,
示例9: ShowUpdateDialogThreadStartstatic NTSTATUS ShowUpdateDialogThreadStart( __in PVOID Parameter ){ BOOL result; MSG message; PH_AUTO_POOL autoPool; PhInitializeAutoPool(&autoPool); UpdateDialogHandle = CreateDialog( (HINSTANCE)PluginInstance->DllBase, MAKEINTRESOURCE(IDD_UPDATE), PhMainWndHandle, UpdaterWndProc ); PhSetEvent(&InitializedEvent); while (result = GetMessage(&message, NULL, 0, 0)) { if (result == -1) break; if (!IsDialogMessage(UpdateDialogHandle, &message)) { TranslateMessage(&message); DispatchMessage(&message); } PhDrainAutoPool(&autoPool); } PhDeleteAutoPool(&autoPool); PhResetEvent(&InitializedEvent); // Ensure global objects are disposed and reset when window closes. if (SetupFilePath) { PhDereferenceObject(SetupFilePath); SetupFilePath = NULL; } if (UpdateCheckThreadHandle) { NtClose(UpdateCheckThreadHandle); UpdateCheckThreadHandle = NULL; } if (DownloadThreadHandle) { NtClose(DownloadThreadHandle); DownloadThreadHandle = NULL; } if (UpdaterDialogThreadHandle) { NtClose(UpdaterDialogThreadHandle); UpdaterDialogThreadHandle = NULL; } if (FontHandle) { DeleteObject(FontHandle); FontHandle = NULL; } FreeXmlData(); if (UpdateDialogHandle) { DestroyWindow(UpdateDialogHandle); UpdateDialogHandle = NULL; } return STATUS_SUCCESS;}
开发者ID:john-peterson,项目名称:processhacker,代码行数:78,
示例10: PreTranslateMessage BOOL PreTranslateMessage(MSG* pMsg) { return IsDialogMessage(pMsg); }
开发者ID:GordonSmith,项目名称:eclide,代码行数:4,
示例11: IsDialogMessageBOOL CRepositoryFilterView::PreTranslateMessage(MSG* pMsg){ BOOL retVal = IsDialogMessage(pMsg); return retVal;}
开发者ID:dehilsterlexis,项目名称:eclide-1,代码行数:5,
示例12: WinMain//.........这里部分代码省略......... memcpy(clock64, api.root, api.root_len+1); add_title(clock64,"Clock" ARCH_SUFFIX_64 ".exe"); api.Exec(clock64,lpCmdLine,NULL); } return 0; } #endif // _WIN64 // Do Not Allow the Program to Execute Twice! updated = 25; /**< wait up to 5 sec in 1/5th seconds for other instance */ do{ HANDLE processlock=CreateMutex(NULL,FALSE,g_szClassName); // we leak handle here, but Windows closes on process exit anyway (so why do it manually?) if(processlock && GetLastError()==ERROR_ALREADY_EXISTS){ CloseHandle(processlock); hwndMain = FindWindow(g_szClassName, NULL); if(hwndMain) { // This One Sends Commands to the Instance ProcessCommandLine(hwndMain,lpCmdLine); // That is Currently Running. return 0; } Sleep(200); continue; } break; }while(updated--); // Update settings if required and setup defaults if((updated=CheckSettings())<0){ return 1; } CancelAllTimersOnStartUp(); // Message of the taskbar recreating - Special thanks to Mr.Inuya g_WM_TaskbarCreated = RegisterWindowMessage("TaskbarCreated"); // register a window class wndclass.style = 0; wndclass.lpfnWndProc = WndProc; wndclass.cbClsExtra = 0; wndclass.cbWndExtra = 0; wndclass.hInstance = g_instance; wndclass.hIcon = g_hIconTClock; wndclass.hCursor = LoadCursor(NULL, IDC_ARROW); wndclass.hbrBackground = (HBRUSH)(intptr_t)(COLOR_WINDOW+1); wndclass.lpszMenuName = NULL; wndclass.lpszClassName = g_szClassName; g_atomTClock = RegisterClass(&wndclass); if(api.OS >= TOS_VISTA) { // allow non elevated processes to send control messages (eg, App with admin rights, explorer without) #define MSGFLT_ADD 1 #define MSGFLT_REMOVE 2 typedef BOOL (WINAPI* ChangeWindowMessageFilter_t)(UINT message,DWORD dwFlag); ChangeWindowMessageFilter_t ChangeWindowMessageFilter=(ChangeWindowMessageFilter_t)GetProcAddress(GetModuleHandle("user32"), "ChangeWindowMessageFilter"); if(ChangeWindowMessageFilter){ int msgid; ChangeWindowMessageFilter(g_WM_TaskbarCreated,MSGFLT_ADD); ChangeWindowMessageFilter(WM_COMMAND,MSGFLT_ADD); for(msgid=WM_MOUSEFIRST; msgid<=WM_MOUSELAST; ++msgid) ChangeWindowMessageFilter(msgid,MSGFLT_ADD); for(msgid=MAINMFIRST; msgid<=MAINMLAST; ++msgid) ChangeWindowMessageFilter(msgid,MSGFLT_ADD); } } // create a hidden window g_hwndTClockMain = hwndMain = CreateWindowEx(WS_EX_NOACTIVATE, MAKEINTATOM(g_atomTClock),NULL, 0, 0,0,0,0, NULL,NULL,g_instance,NULL); // This Checks for First Instance Startup Options ProcessCommandLine(hwndMain,lpCmdLine); GetHotKeyInfo(hwndMain); if(api.OS > TOS_2000) { if(api.GetInt("Desktop", "MonOffOnLock", 0)) RegisterSession(hwndMain); } if(updated==1){ PostMessage(hwndMain,WM_COMMAND,IDM_SHOWPROP,0); } while(GetMessage(&msg, NULL, 0, 0)) { if(!(g_hwndSheet && IsWindow(g_hwndSheet) && PropSheet_IsDialogMessage(g_hwndSheet,&msg)) && !(g_hDlgTimer && IsWindow(g_hDlgTimer) && IsDialogMessage(g_hDlgTimer,&msg)) && !(g_hDlgTimerWatch && IsWindow(g_hDlgTimerWatch) && IsDialogMessage(g_hDlgTimerWatch,&msg)) && !(g_hDlgStopWatch && IsWindow(g_hDlgStopWatch) && IsDialogStopWatchMessage(g_hDlgStopWatch,&msg))){ TranslateMessage(&msg); DispatchMessage(&msg); } } UnregisterHotKey(hwndMain, HOT_TIMER); UnregisterHotKey(hwndMain, HOT_WATCH); UnregisterHotKey(hwndMain, HOT_STOPW); UnregisterHotKey(hwndMain, HOT_PROPR); UnregisterHotKey(hwndMain, HOT_CALEN); UnregisterHotKey(hwndMain, HOT_TSYNC); UnregisterSession(hwndMain); EndNewAPI(NULL); return (int)msg.wParam;}
开发者ID:andrejtm,项目名称:T-Clock,代码行数:101,
示例13: LoadAcceleratorsWPARAM CFidgetApp::Run(void){ HACCEL hAccelTable = LoadAccelerators(m_hInstance, (LPCTSTR)IDC_FIDGET); // Main message loop: // WPARAM iReturn = 0; bool bFinished = false; while (!bFinished) { CLinearTimeAbsolute ltaCurrent; ltaCurrent.GetUTC(); // Execute background tasks at specifically scheduled times. // scheduler.RunTasks(ltaCurrent); CLinearTimeAbsolute ltaWakeUp; if (!scheduler.WhenNext(<aWakeUp)) { ltaWakeUp = ltaCurrent + time_30m; } else if (ltaWakeUp < ltaCurrent) { // This is necessary to deal with computer time jumping backwards // which can happen when someone sets or resets the computer clock. // ltaWakeUp = ltaCurrent; } CLinearTimeDelta ltdTimeOut = ltaWakeUp - ltaCurrent; DWORD dwTimeout = ltdTimeOut.ReturnMilliseconds(); DWORD nHandles = 0; DWORD dwObject = MsgWaitForMultipleObjectsEx(nHandles, NULL, dwTimeout, QS_ALLINPUT, 0); if (WAIT_OBJECT_0 + nHandles == dwObject) { for (; !bFinished;) { // There is at least one new message waiting to be processed. // MSG msg; BOOL bGM = GetMessage(&msg, NULL, 0, 0); if (0 == bGM) { // WM_QUIT message was received. It is time to terminate // ourselves. // iReturn = msg.wParam; bFinished = true; } else if (-1 == bGM) { // An unexpected problem occured. // bFinished = true; } else { // Translate and dispatch message to Windows Procedure. // if ( ( NULL == m_hwndNewSession || !IsDialogMessage(m_hwndNewSession, &msg)) && ( NULL == m_hwndAbout || !IsDialogMessage(m_hwndAbout, &msg)) && !TranslateMDISysAccel(g_theApp.m_pMainFrame->m_pMDIControl->m_hwnd, &msg) && !TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) { TranslateMessage(&msg); DispatchMessage(&msg); } } // We must process all messages in the queue before making // another MsgWaitForMultipleObjectsEx() call. // if (!PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE|PM_NOYIELD)) { break; } } } else if (WAIT_TIMEOUT != dwObject) { // An unexpected event occured. // bFinished = true; } // It's time to perform some background task. // } DestroyAcceleratorTable(hAccelTable); return iReturn;}
开发者ID:sanjayui,项目名称:tinymux,代码行数:94,
示例14: PhMainMessageLoopLONG PhMainMessageLoop( VOID){ BOOL result; MSG message; HACCEL acceleratorTable; acceleratorTable = LoadAccelerators(PhInstanceHandle, MAKEINTRESOURCE(IDR_MAINWND_ACCEL)); while (result = GetMessage(&message, NULL, 0, 0)) { BOOLEAN processed = FALSE; ULONG i; if (result == -1) return 1; if (FilterList) { for (i = 0; i < FilterList->Count; i++) { PPH_MESSAGE_LOOP_FILTER_ENTRY entry = FilterList->Items[i]; if (entry->Filter(&message, entry->Context)) { processed = TRUE; break; } } } if (!processed) { if ( message.hwnd == PhMainWndHandle || IsChild(PhMainWndHandle, message.hwnd) ) { if (TranslateAccelerator(PhMainWndHandle, acceleratorTable, &message)) processed = TRUE; } if (DialogList) { for (i = 0; i < DialogList->Count; i++) { if (IsDialogMessage((HWND)DialogList->Items[i], &message)) { processed = TRUE; break; } } } } if (!processed) { TranslateMessage(&message); DispatchMessage(&message); } PhDrainAutoPool(&BaseAutoPool); } return (LONG)message.wParam;}
开发者ID:ventsislav-georgiev,项目名称:processhacker2,代码行数:67,
示例15: startwin_idleint32_t startwin_idle(void *v){ if (!startupdlg || !IsWindow(startupdlg)) return 0; if (IsDialogMessage(startupdlg, (MSG*)v)) return 1; return 0;}
开发者ID:Daedolon,项目名称:erampage,代码行数:6,
示例16: _tWinMainint WINAPI _tWinMain(HINSTANCE hinstExe, HINSTANCE, PTSTR pszCmdLine, int) { // Counter fiber execution context PVOID pFiberCounter = NULL; // Convert this thread to a fiber. /* Converts the current thread into a fiber. * You must convert a thread into a fiber * before you can schedule other fibers. */ g_FiberInfo.pFiberUI = ConvertThreadToFiber(NULL); /* Allocates a fiber local storage (FLS) index. * Any fiber in the process can subsequently use this index * to store and retrieve values that are local to the fiber. */ g_dwSlot = FlsAlloc(LogMessage); FlsSetValue(g_dwSlot, TEXT("UI fiber")); // Create the application's UI window. g_FiberInfo.hwnd = CreateDialog(hinstExe, MAKEINTRESOURCE(IDD_COUNTER), NULL, Dlg_Proc); // Update the window showing which fiber is executing. SetDlgItemText(g_FiberInfo.hwnd, IDC_FIBER, TEXT("User interface")); // Initially, there is no background processing to be done. g_FiberInfo.bps = BPS_DONE; // While the UI window still exists... BOOL fQuit = FALSE; while (!fQuit) { // UI messages are higher priority than background processing. MSG msg; /* Dispatches incoming sent messages, checks * the thread message queue for a posted message, * and retrieves the message (if any exist). * PM_REMOVE 0x0001 * Messages are removed from the queue after processing by PeekMessage. */ if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) { // If a message exists in the queue, process it. /* Determines whether a message is intended * for the specified dialog box and, * if it is, processes the message. * hDlg [in] Type: HWND A handle to the dialog box. * lpMsg [in] Type: LPMSG A pointer to an MSG structure * that contains the message to be checked. */ if (!IsDialogMessage(g_FiberInfo.hwnd, &msg)) { /* Translates virtual-key messages into character messages. * The character messages are posted to the calling thread's message queue, * to be read the next time the thread calls the GetMessage or PeekMessage function */ TranslateMessage(&msg); /* Dispatches a message to a window procedure. * It is typically used to dispatch a message retrieved by the GetMessage function. */ DispatchMessage(&msg); } fQuit = (msg.message == WM_QUIT); if (fQuit) { // Release FLS slot FlsFree(g_dwSlot); // The background processing must be stopped. if (pFiberCounter != NULL) { // A recalculation fiber exists; delete it DeleteFiber(pFiberCounter); pFiberCounter = NULL; } // Quit the fiber mode and return to simple thread mode ConvertFiberToThread(); g_FiberInfo.pFiberUI = NULL; } } else { // No UI msgs exist; check the state of the background processing. switch (g_FiberInfo.bps) { case BPS_DONE: // No background processing to do; wait for a UI event. /* Yields control to other threads when a thread has no other messages * in its message queue. * The WaitMessage function suspends the thread * and does not return until a new message * is placed in the thread's message queue. */ WaitMessage(); break; case BPS_STARTOVER: // User changed the count; // cancel the current background processing. if (pFiberCounter != NULL) { // A recalculation fiber exists; delete it so that//.........这里部分代码省略.........
开发者ID:melvinvarkey,项目名称:ANCI_C_Training,代码行数:101,
示例17: WinMain//.........这里部分代码省略......... if(*pszCmdline == '/"') { GetArg(pszCmdline, arg, MAX_PATH); pszCmdline = arg; } if(!TouchFile(pszCmdline)) { HexWinErrorBox(GetLastError(), 0); return 1; } return 0; } else { pszCmdline = GetArg(pszCmdline, arg, MAX_PATH); } } { INITCOMMONCONTROLSEX icex = { sizeof(icex), -1 }; InitCommonControlsEx(&icex); } /*g_Config = OpenConfig(TEXT("mapsize.exe.129082349834.bookmarks")); smeg(g_Config, TEXT("bookmarks.bookmark."), TEXT("mapsize.exe")); SaveConfig(TEXT("oof.config"), g_Config);*/ LoadSettings(); RegisterTabView(); InitMainWnd(); CreateMainWnd(); // open file specified on commmand line? if(pszCmdline && *pszCmdline) { // check to see if it's a quoted filename if(*pszCmdline == '/"') { GetArg(pszCmdline, arg, MAX_PATH); pszCmdline = arg; } if(!HexeditOpenFile(g_hwndMain, pszCmdline, DefaultFileMode()))//HVOF_DEFAULT)) { SendMessage(g_hwndMain, WM_COMMAND, IDM_FILE_NEW, 0); } } // automatically create new document if none specified else { SendMessage(g_hwndMain, WM_COMMAND, IDM_FILE_NEW, 0); } InitDockingBars(g_hwndMain); if(g_fRestoreWinPos) nShowCmd = SW_SHOW; ShowWindow(g_hwndMain, nShowCmd); // force any floating popups (i.e. the DOCKWNDs) to // become visible at the same time //ShowOwnedPopups(g_hwndMain, TRUE); DockWnd_ShowDeferredPopups(g_hwndMain); // // load keyboard accelerator table // hAccel = LoadAccelerators(GetModuleHandle(0)/*g_hResourceModule*/, MAKEINTRESOURCE(IDR_ACCELERATOR1)); // // message-pump // while(GetMessage(&msg, 0, 0, 0) > 0) { if(!TranslateAccelerator(g_hwndMain, hAccel, &msg)) { if( !IsDialogMessage(g_hwndSearch, &msg) && !IsDialogMessage(g_hwndGoto, &msg) && !DockWnd_IsDialogMessage(g_hwndMain, DWID_TYPEVIEW, &msg) && !DockWnd_IsDialogMessage(g_hwndMain, DWID_SEARCHBAR, &msg) && !DockWnd_IsDialogMessage(g_hwndMain, DWID_HIGHLIGHT, &msg) ) { TranslateMessage(&msg); DispatchMessage(&msg); } } } SaveSettings(); // Shutdown COM OleUninitialize(); return 0;}
开发者ID:rajeshpillai,项目名称:HexEdit,代码行数:101,
示例18: WinMain//.........这里部分代码省略......... MSG msg ; WNDCLASSEX wndclass ; HWND hDummyWnd; int NTVersion; int len = 256; HANDLE hToken; SYSTEM_CACHE_INFORMATION newCacheSize; ULONG minSize, maxSize; // save instance hInst = hInstance; // init common controls InitCommonControls(); // get NT version NTVersion = GetVersion(); if( NTVersion >= 0x80000000 ) { Abort( NULL, TEXT("Not running on Windows NT")); return TRUE; } // Enable increase quota privilege if(!OpenProcessToken( GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken )) { printf("You do not have the necessary privilege to run this program/n"); return -1; } // Enable SeDebugPrivilege if(!SetPrivilege(hToken, SE_INCREASE_QUOTA_NAME, TRUE)) { Abort(NULL, TEXT("You must have the INCREASE_QUOTA privilege to run CacheSet")); CloseHandle(hToken); return -1; } CloseHandle( hToken ); // locate the calls we need in NTDLL LocateNTDLLCalls(); // If there are command line arguments, set the cache size if( lpCmdLine && (sscanf( lpCmdLine," %d %d", &minSize, &maxSize ) == 2) ) { // set the cache size newCacheSize.MinimumWorkingSet = minSize * 1024; newCacheSize.MaximumWorkingSet = maxSize * 1024; NtSetSystemInformation( SYSTEMCACHEINFORMATION, &newCacheSize, sizeof(newCacheSize) ); return 0; } // create a dummy class and window that will hide the task tray icon for us wndclass.cbSize = sizeof( WNDCLASSEX ); wndclass.style = 0 ; wndclass.lpfnWndProc = (WNDPROC) DummyProc ; wndclass.cbClsExtra = 0 ; wndclass.cbWndExtra = 0 ; wndclass.hInstance = hInstance ; wndclass.hIcon = LoadIcon (hInstance, "APPICON") ; wndclass.hIconSm = LoadIcon (hInstance, "APPICON"); wndclass.hCursor = LoadCursor (NULL, IDC_ARROW) ; wndclass.hbrBackground = (HBRUSH) (COLOR_BTNFACE+1); wndclass.lpszMenuName = NULL ; wndclass.lpszClassName = "Dummy" ; RegisterClassEx (&wndclass) ; hDummyWnd = CreateWindowEx( WS_EX_TOOLWINDOW, "Dummy", "", 0, -1, -1, 0, 0, 0, 0, hInstance, 0 ); // create the main window class wndclass.cbSize = sizeof( WNDCLASSEX ); wndclass.style = CS_HREDRAW | CS_VREDRAW ; wndclass.lpfnWndProc = (WNDPROC) MainDialog ; wndclass.cbClsExtra = 0 ; wndclass.cbWndExtra = DLGWINDOWEXTRA ; wndclass.hInstance = hInstance ; wndclass.hIcon = LoadIcon (hInstance, "APPICON") ; wndclass.hIconSm = LoadIcon (hInstance, "APPICON"); wndclass.hCursor = LoadCursor (NULL, IDC_ARROW) ; wndclass.hbrBackground = (HBRUSH) (COLOR_BTNFACE+1); wndclass.lpszMenuName = NULL ; wndclass.lpszClassName = szAppName ; RegisterClassEx (&wndclass) ; // create the dialog hMainDlg = CreateDialog( hInstance, "CACHESET", hDummyWnd, (DLGPROC)MainDialog) ; ShowWindow( hMainDlg, nCmdShow) ; while (GetMessage (&msg, NULL, 0, 0)) { if( !IsDialogMessage( hMainDlg, &msg )) { TranslateMessage (&msg) ; DispatchMessage (&msg) ; } } return msg.wParam ;}
开发者ID:caidongyun,项目名称:libs,代码行数:101,
示例19: ProcessCommandLine//========================================================================================// /exit exit T-Clock 2010// /prop show T-Clock 2010 properties// /SyncOpt SNTP options// /Sync synchronize the system clock with an NTP server// /start start the Stopwatch (open as needed)// /stop stop (pause really) the Stopwatch// /reset reset Stopwatch to 0 (stop as needed)// /lap record a (the current) lap time//================================================================================================//---------------------------------------------//---------------+++--> T-Clock Command Line Option:void ProcessCommandLine(HWND hwndMain,const char* cmdline) //-----------------------------+++-->{ int justElevated = 0; const char* p = cmdline; if(g_hwndTClockMain != hwndMain){ g_hwndTClockMain = CreateWindow("STATIC",NULL,0,0,0,0,0,HWND_MESSAGE_nowarn,0,0,0); SubclassWindow(g_hwndTClockMain, MsgOnlyProc); } while(*p != '/0') { if(*p == '/') { ++p; if(strncasecmp(p, "prop", 4) == 0) { SendMessage(hwndMain, WM_COMMAND, IDM_SHOWPROP, 0); p += 4; } else if(strncasecmp(p, "exit", 4) == 0) { SendMessage(hwndMain, MAINM_EXIT, 0, 0); p += 4; } else if(strncasecmp(p, "start", 5) == 0) { SendMessage(hwndMain, WM_COMMAND, IDM_STOPWATCH_START, 0); p += 5; } else if(strncasecmp(p, "stop", 4) == 0) { SendMessage(hwndMain, WM_COMMAND, IDM_STOPWATCH_STOP, 0); p += 4; } else if(strncasecmp(p, "reset", 5) == 0) { SendMessage(hwndMain, WM_COMMAND, IDM_STOPWATCH_RESET, 0); p += 5; } else if(strncasecmp(p, "pause", 5) == 0) { SendMessage(hwndMain, WM_COMMAND, IDM_STOPWATCH_PAUSE, 0); p += 5; } else if(strncasecmp(p, "resume", 6) == 0) { SendMessage(hwndMain, WM_COMMAND, IDM_STOPWATCH_RESUME, 0); p += 6; } else if(strncasecmp(p, "lap", 3) == 0) { SendMessage(hwndMain, WM_COMMAND, IDM_STOPWATCH_LAP, 0); p += 3; } else if(strncasecmp(p, "SyncOpt", 7) == 0) { if(HaveSetTimePermissions()){ if(!SendMessage(hwndMain, WM_COMMAND, MAKEWPARAM(IDM_SNTP,1), 0)){ NetTimeConfigDialog(justElevated); } }else{ SendMessage(hwndMain, WM_COMMAND, IDM_SNTP, 0); } p += 7; } else if(strncasecmp(p, "Sync", 4) == 0) { p += 4; SendMessage(hwndMain, WM_COMMAND, MAKEWPARAM(IDM_SNTP_SYNC,justElevated), 0); if(g_hwndTClockMain == hwndMain) SendMessage(hwndMain, MAINM_EXIT, 0, 0); } else if(strncmp(p, "Wc", 2) == 0) { // Win10 calendar "restore" if(p[2] == '1') // restore to previous api.SetSystemInt(HKEY_LOCAL_MACHINE, kSectionImmersiveShell, kKeyWin32Tray, 1); else // use the slow (new) one api.DelSystemValue(HKEY_LOCAL_MACHINE, kSectionImmersiveShell, kKeyWin32Tray); p += 2; } else if(strncmp(p, "UAC", 3) == 0) { justElevated = 1; p += 3; } continue; } ++p; } if(g_hwndTClockMain != hwndMain){ const DWORD kTimeout = 10000; const DWORD kStartTicks = GetTickCount(); DWORD timeout; MSG msg; msg.message = 0; for(;;){ int have_ui = IsWindow(g_hwndSheet) || IsWindow(g_hDlgTimer) || IsWindow(g_hDlgTimerWatch) || IsWindow(g_hDlgSNTP) || IsWindow(g_hDlgStopWatch); if(have_ui) timeout = INFINITE; else if(IsPlaying()) timeout = 200; else break; MsgWaitForMultipleObjectsEx(0, NULL, timeout, QS_ALLEVENTS, MWMO_INPUTAVAILABLE); while(PeekMessage(&msg,NULL,0,0,PM_REMOVE)){ if(msg.message == WM_QUIT) break; if(!(g_hwndSheet && IsWindow(g_hwndSheet) && PropSheet_IsDialogMessage(g_hwndSheet,&msg)) && !(g_hDlgTimer && IsWindow(g_hDlgTimer) && IsDialogMessage(g_hDlgTimer,&msg)) && !(g_hDlgTimerWatch && IsWindow(g_hDlgTimerWatch) && IsDialogMessage(g_hDlgTimerWatch,&msg)) && !(g_hDlgSNTP && IsWindow(g_hDlgSNTP) && IsDialogMessage(g_hDlgSNTP,&msg)) && !(g_hDlgStopWatch && IsWindow(g_hDlgStopWatch) && IsDialogStopWatchMessage(g_hDlgStopWatch,&msg))){ TranslateMessage(&msg);//.........这里部分代码省略.........
开发者ID:dubepaul,项目名称:T-Clock,代码行数:101,
示例20: mswin_display_splash_window//.........这里部分代码省略......... /* Fill the text control */ Sprintf(buf, "%s/r/n%s/r/n%s/r/n%s/r/n/r/n", COPYRIGHT_BANNER_A, COPYRIGHT_BANNER_B, COPYRIGHT_BANNER_C, COPYRIGHT_BANNER_D); strsize = strlen(buf); if (show_ver) { /* Show complete version information */ dlb *f; char verbuf[BUFSZ]; int verstrsize = 0; getversionstring(verbuf); verstrsize = strlen(verbuf); if (verstrsize + strlen("/r/n/r/n") + 1 < BUFSZ - 1) strcat(verbuf, "/r/n/r/n"); verstrsize = strlen(verbuf); if (strsize + verstrsize + 1 > bufsize) { bufsize += BUFSZ; buf = realloc(buf, bufsize); if (buf == NULL) panic("out of memory"); } strcat(buf, verbuf); strsize = strlen(buf); /* Add compile options */ f = dlb_fopen(OPTIONS_USED, RDTMODE); if (f) { char line[LLEN + 1]; while (dlb_fgets(line, LLEN, f)) { size_t len; len = strlen(line); if (len > 0 && line[len - 1] == '/n') { line[len - 1] = '/r'; line[len] = '/n'; line[len + 1] = '/0'; len++; } if (strsize + (int) len + 1 > bufsize) { bufsize += BUFSZ; buf = realloc(buf, bufsize); if (buf == NULL) panic("out of memory"); } strcat(buf, line); strsize += len; } (void) dlb_fclose(f); } } else { /* Show news, if any */ if (iflags.news) { FILE *nf; iflags.news = 0; /* prevent newgame() from re-displaying news */ nf = fopen(NEWS, "r"); if (nf != NULL) { char line[LLEN + 1]; while (fgets(line, LLEN, nf)) { size_t len; len = strlen(line); if (len > 0 && line[len - 1] == '/n') { line[len - 1] = '/r'; line[len] = '/n'; line[len + 1] = '/0'; len++; } if (strsize + (int) len + 1 > bufsize) { bufsize += BUFSZ; buf = realloc(buf, bufsize); if (buf == NULL) panic("out of memory"); } strcat(buf, line); strsize += len; } (void) fclose(nf); } else { strcat(buf, "No news."); } } } SetWindowText(GetDlgItem(hWnd, IDC_EXTRAINFO), buf); free(buf); ShowWindow(hWnd, SW_SHOW); while (IsWindow(hWnd) && GetMessage(&msg, NULL, 0, 0) != 0) { if (!IsDialogMessage(hWnd, &msg)) { TranslateMessage(&msg); DispatchMessage(&msg); } } GetNHApp()->hPopupWnd = NULL; mswin_destroy_splashfonts();}
开发者ID:MaddTheSane,项目名称:nh3d_OSX-j,代码行数:101,
示例21: WinMainint APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow){ MSG msg; int retval; if(InitApp(hInstance, lpCmdLine) == false) return 0; hWnd = BuildWindow(nCmdShow); if(hWnd == NULL) return 0; // build GUI if (!BuildControls(hWnd)) return 0; // Initialize all controls ApplySettings(); // show credits char buf[BUFLEN]; ZeroMemory(buf, BUFLEN); strncpy(buf, CREDITS, BUFLEN-1); SendMessage(g_statusTextControl, WM_SETTEXT, 0, (LPARAM)buf); while((retval = GetMessage(&msg,NULL,0,0)) != 0) { // capture key-def events if ((msg.hwnd == g_keySwitchLeftControl || msg.hwnd == g_keySwitchRightControl || msg.hwnd == g_keyResetControl || msg.hwnd == g_keyRandomControl || msg.hwnd == g_keyPrevControl || msg.hwnd == g_keyNextControl || msg.hwnd == g_keyPrevValControl || msg.hwnd == g_keyNextValControl || msg.hwnd == g_keyInfoPagePrevControl || msg.hwnd == g_keyInfoPageNextControl || msg.hwnd == g_keyAction1Control || msg.hwnd == g_keyAction2Control || msg.hwnd == g_keySwitch1Control || msg.hwnd == g_keySwitch2Control ) && ( msg.message == WM_KEYDOWN || msg.message == WM_SYSKEYDOWN )) { PostMessage(hWnd, WM_APP_KEYDEF, msg.wParam, (LPARAM)msg.hwnd); continue; } if(retval == -1) return 0; // an error occured while getting a message if (!IsDialogMessage(hWnd, &msg)) // need to call this to make WS_TABSTOP work { TranslateMessage(&msg); DispatchMessage(&msg); } } return 0;}
开发者ID:kitserver,项目名称:kitserver6,代码行数:65,
示例22: IsDialogMessageBOOL CMapDlg::PreTranslateMessage(MSG* pMsg){ return IsDialogMessage(pMsg);}
开发者ID:diz-vara,项目名称:ActiveD,代码行数:4,
示例23: _tWinMain/*********************************************************************** * * WinMain */int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE prev, LPTSTR cmdline, int show){ MSG msg; HACCEL hAccel; WNDCLASSEX wndclass; HMONITOR monitor; MONITORINFO info; INT x, y; static const TCHAR className[] = _T("NPClass"); static const TCHAR winName[] = _T("Notepad"); UNREFERENCED_PARAMETER(prev); aFINDMSGSTRING = (ATOM) RegisterWindowMessage(FINDMSGSTRING); ZeroMemory(&Globals, sizeof(Globals)); Globals.hInstance = hInstance; LoadSettings(); ZeroMemory(&wndclass, sizeof(wndclass)); wndclass.cbSize = sizeof(wndclass); wndclass.lpfnWndProc = NOTEPAD_WndProc; wndclass.hInstance = Globals.hInstance; wndclass.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_NPICON)); wndclass.hCursor = LoadCursor(0, IDC_ARROW); wndclass.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1); wndclass.lpszMenuName = MAKEINTRESOURCE(MAIN_MENU); wndclass.lpszClassName = className; wndclass.hIconSm = (HICON)LoadImage(hInstance, MAKEINTRESOURCE(IDI_NPICON), IMAGE_ICON, 16, 16, 0); if (!RegisterClassEx(&wndclass)) return FALSE; /* Setup windows */ monitor = MonitorFromRect( &Globals.main_rect, MONITOR_DEFAULTTOPRIMARY ); info.cbSize = sizeof(info); GetMonitorInfoW( monitor, &info ); x = Globals.main_rect.left; y = Globals.main_rect.top; if (Globals.main_rect.left >= info.rcWork.right || Globals.main_rect.top >= info.rcWork.bottom || Globals.main_rect.right < info.rcWork.left || Globals.main_rect.bottom < info.rcWork.top) x = y = CW_USEDEFAULT; Globals.hMainWnd = CreateWindow(className, winName, WS_OVERLAPPEDWINDOW, x, y, Globals.main_rect.right - Globals.main_rect.left, Globals.main_rect.bottom - Globals.main_rect.top, NULL, NULL, Globals.hInstance, NULL); if (!Globals.hMainWnd) { ShowLastError(); ExitProcess(1); } DoCreateEditWindow(); NOTEPAD_InitData(); DIALOG_FileNew(); ShowWindow(Globals.hMainWnd, show); UpdateWindow(Globals.hMainWnd); DragAcceptFiles(Globals.hMainWnd, TRUE); DIALOG_ViewStatusBar(); HandleCommandLine(cmdline); hAccel = LoadAccelerators( hInstance, MAKEINTRESOURCE(ID_ACCEL) ); while (GetMessage(&msg, 0, 0, 0)) { if (!IsDialogMessage(Globals.hFindReplaceDlg, &msg) && !TranslateAccelerator(Globals.hMainWnd, hAccel, &msg)) { TranslateMessage(&msg); DispatchMessage(&msg); } } return (int) msg.wParam;}
开发者ID:HBelusca,项目名称:NasuTek-Odyssey,代码行数:89,
示例24: WinMain//.........这里部分代码省略......... } // // Store application executable file path // err = GetModuleFileName(NULL, sAppPath, sizeof(sAppPath)); if (err == 0) { err = GetLastError(); VFDTRACE(0,("WinMain : GetModuleFileName() - %s", GetSystemMessage(err))); ShowErrorMessage(err, MSG_ERR_APP_INTERNAL); goto cleanup; } pAppBase = sAppPath + err; while (pAppBase > sAppPath && *(pAppBase - 1) != '//') { pAppBase--; } // // initialize ole and common controls // if (!SUCCEEDED(CoInitialize(NULL))) { err = GetLastError(); VFDTRACE(0,("WinMain : CoInitialize() - %s", GetSystemMessage(err))); ShowErrorMessage(err, MSG_ERR_APP_INTERNAL); goto cleanup; } InitCommonControls(); // // Create the main dialog window // hMainWnd = CreateDialog( hInstance, MAKEINTRESOURCE(IDD_MAIN), NULL, MainProc); if (hMainWnd == NULL) { err = GetLastError(); VFDTRACE(0,("WinMain : CreateDialog - %s", GetSystemMessage(err))); ShowErrorMessage(err, MSG_ERR_APP_INTERNAL); goto cleanup; } hAccel = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDR_ACCELERATOR)); if (hAccel == NULL) { VFDTRACE(0,("WinMain : LoadAccelerators - %s", GetSystemMessage(GetLastError()))); } // // Message loop // for (;;) { BOOL ret = GetMessage(&msg, NULL, 0, 0); if (ret == 0) { break; } else if (ret == -1) { err = GetLastError(); VFDTRACE(0,("WinMain: GetMessage - %s", GetSystemMessage(err))); ShowErrorMessage(err, MSG_ERR_APP_INTERNAL); break; } if (!TranslateAccelerator(hMainWnd, hAccel, &msg) && !IsDialogMessage(hMainWnd, &msg)) { TranslateMessage(&msg); DispatchMessage(&msg); } }cleanup: CoUninitialize(); return msg.wParam;}
开发者ID:layerfsd,项目名称:Work,代码行数:101,
示例25: IsDialogMessageBOOL CStreamEditorView::PreTranslateMessage(MSG* pMsg){ return IsDialogMessage(pMsg);}
开发者ID:GordonSmith,项目名称:eclide,代码行数:4,
示例26: WinMain//----------------------------------------------------------------------//// WinMain//// Initialize a dialog window class and pop the autologon dialog.////----------------------------------------------------------------------int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow ){ static TCHAR szAppName [] = TEXT("NOTMYFAULT") ; MSG msg ; HWND hMainDlg; WNDCLASSEX wndclass ; PWSTR *cmdLine; int numArgs, i; DWORD nb; cmdLine = CommandLineToArgvW( GetCommandLineW(), &numArgs ); for( i = 0; i < numArgs; i++ ) { if( cmdLine[i][0] == '/' || cmdLine[i][0] == '-' ) { if( !_wcsicmp( &cmdLine[i][1], L"crash" )) { if( StartMyFaultDriver( NULL )) { DeviceIoControl(SysHandle, IOCTL_IRQL, NULL, 0, NULL, 0, &nb, NULL ); } } else { MessageBox( NULL, "Usage: notmyfault [/crash]/n" "/crash Crashes the system.", "NotMyFault", MB_ICONERROR ); return -1; } } } // // Create the main window class // wndclass.cbSize = sizeof( WNDCLASSEX ); wndclass.style = CS_HREDRAW | CS_VREDRAW ; wndclass.lpfnWndProc = (WNDPROC) MainDialog ; wndclass.cbClsExtra = 0 ; wndclass.cbWndExtra = DLGWINDOWEXTRA ; wndclass.hInstance = hInstance ; wndclass.hIcon = LoadIcon (hInstance, "APPICON") ; wndclass.hIconSm = LoadIcon (hInstance, "APPICON"); wndclass.hCursor = LoadCursor (NULL, IDC_ARROW) ; wndclass.hbrBackground = (HBRUSH) (COLOR_BTNFACE+1); wndclass.lpszMenuName = NULL ; wndclass.lpszClassName = szAppName ; RegisterClassEx (&wndclass) ; // // Create the dialog // hMainDlg = CreateDialog( hInstance, "NOTMYFAULT", NULL, (DLGPROC)MainDialog) ; ShowWindow( hMainDlg, nCmdShow) ; while (GetMessage (&msg, NULL, 0, 0)) { if( !IsDialogMessage( hMainDlg, &msg )) { TranslateMessage (&msg) ; DispatchMessage (&msg) ; } } return (int) msg.wParam ;}
开发者ID:Ahmedobayah,项目名称:LabVIEW,代码行数:72,
示例27: ShowErrorPanevoid ShowErrorPane(const char *text){ if (Window == NULL || ConWindow == NULL) { if (text != NULL) { MessageBox (Window, text, GAMESIG " Fatal Error", MB_OK|MB_ICONSTOP|MB_TASKMODAL); } return; } if (StartScreen != NULL) // Ensure that the network pane is hidden. { StartScreen->NetDone(); } if (text != NULL) { char caption[100]; mysnprintf(caption, countof(caption), "Fatal Error - " GAMESIG " %s " X64 " (%s)", GetVersionString(), GetGitTime()); SetWindowText (Window, caption); ErrorIcon = CreateWindowEx (WS_EX_NOPARENTNOTIFY, "STATIC", NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | SS_OWNERDRAW, 0, 0, 0, 0, Window, NULL, g_hInst, NULL); if (ErrorIcon != NULL) { SetWindowLong (ErrorIcon, GWL_ID, IDC_ICONPIC); } } ErrorPane = CreateDialogParam (g_hInst, MAKEINTRESOURCE(IDD_ERRORPANE), Window, ErrorPaneProc, (LONG_PTR)NULL); if (text != NULL) { CHARRANGE end; CHARFORMAT2 oldformat, newformat; PARAFORMAT2 paraformat; // Append the error message to the log. end.cpMax = end.cpMin = GetWindowTextLength (ConWindow); SendMessage (ConWindow, EM_EXSETSEL, 0, (LPARAM)&end); // Remember current charformat. oldformat.cbSize = sizeof(oldformat); SendMessage (ConWindow, EM_GETCHARFORMAT, SCF_SELECTION, (LPARAM)&oldformat); // Use bigger font and standout colors. newformat.cbSize = sizeof(newformat); newformat.dwMask = CFM_BOLD | CFM_COLOR | CFM_SIZE; newformat.dwEffects = CFE_BOLD; newformat.yHeight = oldformat.yHeight * 5 / 4; newformat.crTextColor = RGB(255,170,170); SendMessage (ConWindow, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&newformat); // Indent the rest of the text to make the error message stand out a little more. paraformat.cbSize = sizeof(paraformat); paraformat.dwMask = PFM_STARTINDENT | PFM_OFFSETINDENT | PFM_RIGHTINDENT; paraformat.dxStartIndent = paraformat.dxOffset = paraformat.dxRightIndent = 120; SendMessage (ConWindow, EM_SETPARAFORMAT, 0, (LPARAM)¶format); SendMessage (ConWindow, EM_REPLACESEL, FALSE, (LPARAM)"/n"); // Find out where the error lines start for the error icon display control. SendMessage (ConWindow, EM_EXGETSEL, 0, (LPARAM)&end); ErrorIconChar = end.cpMax; // Now start adding the actual error message. SendMessage (ConWindow, EM_REPLACESEL, FALSE, (LPARAM)"Execution could not continue./n/n"); // Restore old charformat but with light yellow text. oldformat.crTextColor = RGB(255,255,170); SendMessage (ConWindow, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&oldformat); // Add the error text. SendMessage (ConWindow, EM_REPLACESEL, FALSE, (LPARAM)text); // Make sure the error text is not scrolled below the window. SendMessage (ConWindow, EM_LINESCROLL, 0, SendMessage (ConWindow, EM_GETLINECOUNT, 0, 0)); // The above line scrolled everything off the screen, so pretend to move the scroll // bar thumb, which clamps to not show any extra lines if it doesn't need to. SendMessage (ConWindow, EM_SCROLL, SB_PAGEDOWN, 0); } BOOL bRet; MSG msg; while ((bRet = GetMessage(&msg, NULL, 0, 0)) != 0) { if (bRet == -1) { MessageBox (Window, text, GAMESIG " Fatal Error", MB_OK|MB_ICONSTOP|MB_TASKMODAL); return; } else if (!IsDialogMessage (ErrorPane, &msg)) { TranslateMessage (&msg); DispatchMessage (&msg); } }}
开发者ID:floverdevel,项目名称:zdoom,代码行数:97,
示例28: ShowIoDialog//.........这里部分代码省略......... } } if(UartFunctionUsed() && Prog.mcu && ((Prog.mcu->pinInfo[i].pin == Prog.mcu->uartNeeds.rxPin) || (Prog.mcu->pinInfo[i].pin == Prog.mcu->uartNeeds.txPin))) { goto cant_use_this_io; } if(PwmFunctionUsed() && Prog.mcu->pinInfo[i].pin == Prog.mcu->pwmNeedsPin) { goto cant_use_this_io; } if(Prog.io.assignment[item].name[0] == 'A') { for(j = 0; j < Prog.mcu->adcCount; j++) { if(Prog.mcu->adcInfo[j].pin == Prog.mcu->pinInfo[i].pin) { // okay; we know how to connect it up to the ADC break; } } if(j == Prog.mcu->adcCount) { goto cant_use_this_io; } } char buf[40]; if(Prog.mcu->pinCount <= 21) { sprintf(buf, "%3d %c%c%d", Prog.mcu->pinInfo[i].pin, Prog.mcu->portPrefix, Prog.mcu->pinInfo[i].port, Prog.mcu->pinInfo[i].bit); } else { sprintf(buf, "%3d %c%c%d", Prog.mcu->pinInfo[i].pin, Prog.mcu->portPrefix, Prog.mcu->pinInfo[i].port, Prog.mcu->pinInfo[i].bit); } SendMessage(PinList, LB_ADDSTRING, 0, (LPARAM)buf);cant_use_this_io:; } EnableWindow(MainWindow, FALSE); ShowWindow(IoDialog, TRUE); SetFocus(PinList); MSG msg; DWORD ret; DialogDone = FALSE; DialogCancel = FALSE; while((ret = GetMessage(&msg, NULL, 0, 0)) && !DialogDone) { if(msg.message == WM_KEYDOWN) { if(msg.wParam == VK_RETURN) { DialogDone = TRUE; break; } else if(msg.wParam == VK_ESCAPE) { DialogDone = TRUE; DialogCancel = TRUE; break; } } if(IsDialogMessage(IoDialog, &msg)) continue; TranslateMessage(&msg); DispatchMessage(&msg); } if(!DialogCancel) { int sel = SendMessage(PinList, LB_GETCURSEL, 0, 0); char pin[16]; SendMessage(PinList, LB_GETTEXT, (WPARAM)sel, (LPARAM)pin); if(strcmp(pin, _("(no pin)"))==0) { int i; for(i = 0; i < IoSeenPreviouslyCount; i++) { if(strcmp(IoSeenPreviously[i].name, Prog.io.assignment[item].name)==0) { IoSeenPreviously[i].pin = NO_PIN_ASSIGNED; } } Prog.io.assignment[item].pin = NO_PIN_ASSIGNED; } else { Prog.io.assignment[item].pin = atoi(pin); // Only one name can be bound to each pin; make sure that there's // not another entry for this pin in the IoSeenPreviously list, // that might get used if the user creates a new pin with that // name. int i; for(i = 0; i < IoSeenPreviouslyCount; i++) { if(IoSeenPreviously[i].pin == atoi(pin)) { IoSeenPreviously[i].pin = NO_PIN_ASSIGNED; } } } } EnableWindow(MainWindow, TRUE); DestroyWindow(IoDialog); return;}
开发者ID:YuichiroTada,项目名称:ldmicro-jp,代码行数:101,
注:本文中的IsDialogMessage函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ IsDir函数代码示例 C++ IsDevicePathEnd函数代码示例 |