CPreferencesDlg::CPreferencesDlg(CShortcutManager* pShortcutMgr, const CContentMgr* pContentMgr, const CImportExportMgr* pExportMgr, const CUIExtensionMgr* pMgrUIExt, CWnd* pParent /*=NULL*/) : CPreferencesDlgBase(IDD_PREFERENCES, pParent), m_pageShortcuts(pShortcutMgr), m_pageUI(pContentMgr, pMgrUIExt), m_pageFile2(pExportMgr), m_sizeCurrent(-1, -1) { CPreferencesDlgBase::AddPage(&m_pageGen); CPreferencesDlgBase::AddPage(&m_pageMultiUser); CPreferencesDlgBase::AddPage(&m_pageFile); CPreferencesDlgBase::AddPage(&m_pageFile2); CPreferencesDlgBase::AddPage(&m_pageUI); CPreferencesDlgBase::AddPage(&m_pageUIVisibility); CPreferencesDlgBase::AddPage(&m_pageUITasklist); CPreferencesDlgBase::AddPage(&m_pageUITasklistColors); CPreferencesDlgBase::AddPage(&m_pageTask); CPreferencesDlgBase::AddPage(&m_pageTaskCalc); CPreferencesDlgBase::AddPage(&m_pageTaskDef); CPreferencesDlgBase::AddPage(&m_pageExport); CPreferencesDlgBase::AddPage(&m_pageTool); CPreferencesDlgBase::AddPage(&m_pageShortcuts); ForwardMessage(WM_PUITCP_ATTRIBCHANGE); ForwardMessage(WM_PTP_TESTTOOL); ForwardMessage(WM_PGP_CLEARMRU); ForwardMessage(WM_PGP_CLEANUPDICTIONARY); ForwardMessage(WM_PPB_CTRLCHANGE); LoadPreferences(); }
// /// Responds to a WM_CHANGECBCHAIN message. hWndRemoved is a handle to the window /// that's being removed. hWndNext is the window following the removed window. // void TClipboardViewer::EvChangeCBChain(THandle hWndRemoved, THandle hWndNext) { if (hWndRemoved == hWndNext) HWndNext = hWndNext; else ForwardMessage(HWndNext); }
//-------------------------------------------------------------------------------------- // Forwards a given message to all currently active manoeuvres of the team AI. // Param1: A pointer to the message to forward. //-------------------------------------------------------------------------------------- void TeamAI::ForwardMessageToActiveManoeuvers(Message* pMessage) { for(std::unordered_map<TeamManoeuvreType, TeamManoeuvre*>::iterator it = m_manoeuvres.begin(); it != m_manoeuvres.end(); ++it) { if(it->second->IsActive()) { // Forward the message ForwardMessage(it->second, pMessage); } } }
/// Environ::Warn void Environ::Warn(const class Exception &exc) { m_WarnRoot.m_Exception = exc; // // Is the user warned about this exception already? If so, // do not do this again. if (!m_bSuppressMultiple || !isWarned(exc)) { // Deliver this message to the exception hook ForwardMessage(m_pWarningHook,m_WarningTags,m_WarnRoot.m_Exception); // // On debugging, print out the warning immediately PrintWarning(); } }
void OutgoingResourceLimiter::DoForwarding() { CLocationIterator<> message_scanner; int64_t time_elapsed, time_to_sleep, started_handling; uint160 hash; Priority priority; while (running) { message_scanner = msgdata.LocationIterator("forwarding"); message_scanner.SeekEnd(); while (message_scanner.GetPreviousObjectAndLocation(hash, priority)) { started_handling = GetTimeMicros(); string_t type = msgdata[hash]["type"]; log_ << "DoForwarding(): found " << hash << " with type " << type << "\n"; if (!msgdata[hash]["forwarded"]) { ForwardMessage(type, hash); msgdata[hash]["forwarded"] = true; } msgdata.RemoveFromLocation("forwarding", priority); message_scanner = msgdata.LocationIterator("forwarding"); message_scanner.SeekEnd(); time_elapsed = GetTimeMicros() - started_handling; time_to_sleep = (1000000 / MAX_MESSAGE_RATE) - time_elapsed; if (time_to_sleep > 0) SleepMilliseconds(time_to_sleep / 1000); } SleepMilliseconds(100); if (fRequestShutdown) running = false; } }
/// Environ::PostLastWarning // Deliver the last warning again over the warning hook void Environ::PostLastWarning(void) { ForwardMessage(m_pWarningHook,m_WarningTags, m_WarnRoot.m_Exception); }
/// Environ::PostLastError // Deliver the last error again over the exception hook void Environ::PostLastError(void) { ForwardMessage(m_pExceptionHook,m_ExceptionTags, m_Root.m_Exception); }
INT_PTR CALLBACK CBaseDialog::BaseDialogProc(HWND hDlg,UINT uMsg, WPARAM wParam,LPARAM lParam) { switch(uMsg) { case WM_INITDIALOG: m_hDlg = hDlg; if(m_bResizable) { RECT rcMain; GetWindowRect(m_hDlg,&rcMain); /* Assume that the current width and height of the dialog are the minimum width and height. Note that at this point, the dialog has NOT been initialized in any way, so it will not have had a chance to be resized yet. */ m_iMinWidth = GetRectWidth(&rcMain); m_iMinHeight = GetRectHeight(&rcMain); std::list<CResizableDialog::Control_t> ControlList; m_dsc = DIALOG_SIZE_CONSTRAINT_NONE; GetResizableControlInformation(m_dsc,ControlList); m_prd = new CResizableDialog(m_hDlg,ControlList); } break; case WM_GETMINMAXINFO: if(m_bResizable) { LPMINMAXINFO pmmi = reinterpret_cast<LPMINMAXINFO>(lParam); pmmi->ptMinTrackSize.x = m_iMinWidth; pmmi->ptMinTrackSize.y = m_iMinHeight; if(m_dsc == DIALOG_SIZE_CONSTRAINT_X) { pmmi->ptMaxTrackSize.y = m_iMinHeight; } if(m_dsc == DIALOG_SIZE_CONSTRAINT_Y) { pmmi->ptMaxTrackSize.x = m_iMinWidth; } return 0; } break; case WM_NOTIFY: switch(reinterpret_cast<NMHDR *>(lParam)->code) { case LVN_ENDSCROLL: { OSVERSIONINFO VersionInfo; VersionInfo.dwOSVersionInfoSize = sizeof(VersionInfo); GetVersionEx(&VersionInfo); /* Automatic fix for KB813791 (gridlines draw incorrectly on Windows XP). */ if(VersionInfo.dwMajorVersion == WINDOWS_XP_MAJORVERSION) { InvalidateRect(reinterpret_cast<NMHDR *>(lParam)->hwndFrom,NULL,TRUE); UpdateWindow(reinterpret_cast<NMHDR *>(lParam)->hwndFrom); } } break; } break; case WM_SIZE: if(m_bResizable) { m_prd->UpdateControls(LOWORD(lParam),HIWORD(lParam)); return 0; } break; case WM_DESTROY: { /* If this is a modeless dialog, notify the caller that the dialog is been destroyed. */ if(m_bShowingModelessDialog) { if(m_pmdn != NULL) { m_pmdn->OnModelessDialogDestroy(m_iResource); m_pmdn->Release(); } } INT_PTR Res = OnDestroy(); /* Within WM_DESTROY, all child windows still exist. */ SaveState(); return Res; } break; case WM_NCDESTROY: g_WindowMap.erase(g_WindowMap.find(hDlg)); break; } return ForwardMessage(hDlg,uMsg,wParam,lParam); }
void CMainFrame::OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags) { ForwardMessage(); }
void CMainFrame::OnLButtonUp(UINT , CPoint ) { ForwardMessage(); }
void CMainFrame::OnKeyUp(UINT , UINT , UINT ) { ForwardMessage(); }
void CMainFrame::OnChar(UINT , UINT , UINT ) { ForwardMessage(); }
void CMainFrame::OnSysKeyDown(UINT , UINT , UINT ) { ForwardMessage(); }