static LRESULT CALLBACK WindowProc1(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { auto w = reinterpret_cast<Derived*>(::GetWindowLongPtrW(hwnd, 0)); if(w == nullptr) return ::DefWindowProcW(hwnd, msg, wParam, lParam); return w->WindowProc(hwnd, msg, wParam, lParam); }
void CTabCtrl::OnCreate(void) { // Change WndProc to our multi purpose one. WindowProc(PopupWndProc); // Get window dimensions. m_rcArea = ClientRect(); // Calculate tab page position. CRect rcPage(2, m_iTabHeight, m_rcArea.right-3, m_rcArea.bottom-3); // Create the page dialogs. for (int i = 0; i < m_iNumPages; i++) { // Create the page, hide and centre in control. m_pPageTable[i].pPage->Parent(*this); m_pPageTable[i].pPage->RunModeless(); m_pPageTable[i].pPage->Show(SW_HIDE); m_pPageTable[i].pPage->Move(rcPage); } //Activate first page, if one. if (m_iNumPages) ActivatePage(0); }
LRESULT CXTPTaskDialogFrame::OnDialogClickButton(WPARAM wParam, LPARAM /*lParam*/) { CWnd* pWnd = GetDlgItem((UINT)wParam); if (!pWnd) return FALSE; WindowProc(WM_COMMAND, MAKEWPARAM((UINT)wParam, BN_CLICKED), (LPARAM)pWnd->GetSafeHwnd()); return TRUE; }
void AppDelegate::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) { auto glview = (MFCGLView*)Director::getInstance()->getOpenGLView(); if (glview) { if (cocosInited) { glview->WindowProc(message, wParam, lParam); } } }
// // FUNCTION: WndProc(HWND, UINT, WPARAM, LPARAM) // // PURPOSE: Processes messages for the main window. // // WM_COMMAND - process the application menu // WM_PAINT - Paint the main window // WM_DESTROY - post a quit message and return // // LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { int wmId, wmEvent; PAINTSTRUCT ps; HDC hdc; switch (message) { case WM_COMMAND: wmId = LOWORD(wParam); wmEvent = HIWORD(wParam); // Parse the menu selections: switch (wmId) { case IDM_ABOUT: DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, About); break; case IDM_EXIT: DestroyWindow(hWnd); break; default: //return DefWindowProc(hWnd, message, wParam, lParam); goto L_Default_Case; } break; case WM_PAINT: hdc = BeginPaint(hWnd, &ps); // TODO: Add any drawing code here... EndPaint(hWnd, &ps); break; case WM_DESTROY: PostQuitMessage(0); break; L_Default_Case: default: if( g_pMainWindow != nil ) { return WindowProc( g_pMainWindow, message, wParam, lParam ); } else { return DefWindowProc(hWnd, message, wParam, lParam); } } return 0; }
void CTargetWnd::OnNcDestroy() { WindowProc(WM_NCDESTROY,0,0); // For WaitForWindow() CString name; name.SetBase(32); name << "WFWE" << (ULONGLONG)this; HANDLE hEvent=OpenEvent(EVENT_MODIFY_STATE,FALSE,name); DebugOpenHandle(dhtEvent,hEvent,name); SetEvent(hEvent); CloseHandle(hEvent); DebugCloseHandle(dhtEvent,hEvent,name); // No more messages to this class ::SetWindowLongPtr(m_hWnd,GWLP_USERDATA,0); }
LRESULT CViewGame::WindowProc(UINT message, WPARAM wParam, LPARAM lParam) { BOOL Send=false; S_MESSAGE Msg; Msg.Msg=message; Msg.lParam=lParam; Msg.wParam=wParam; Message.SendMessage(&Msg); switch (message) { case WM_DESTROY: { Send=true; Msg.Msg=UM_GAME_STOP; Message.SendMessage(&Msg); DestroyFullScreen(); break; } case WM_SETFOCUS: { return 0; } case WM_ERASEBKGND: { return 1; } case WM_PAINT: { ThreadRenderScene(); //CPaintDC dc(this); return 0; } case WM_LBUTTONDOWN: { //DestroyWindow(); break; } } return WindowProc(message, wParam, lParam); }
BOOL CBCGPBreadcrumb::PreTranslateMessage (MSG* pMsg) { if (m_pInplaceEdit == NULL && pMsg->message == WM_KEYDOWN) { if (IsCharAlphaNumeric((TCHAR)pMsg->wParam) || pMsg->wParam == VK_SPACE) { WindowProc (pMsg->message, pMsg->wParam, pMsg->lParam); return TRUE; } } if (m_pInplaceEdit != NULL && pMsg->hwnd == m_pInplaceEdit->GetSafeHwnd () && pMsg->message == WM_KEYDOWN) { switch (pMsg->wParam) { case VK_RETURN: { CString strPath; m_pInplaceEdit->GetWindowText (strPath); if (!ValidateInplaceEdit (strPath)) { // Continue editing return TRUE; } CancelInplaceEditor (); SelectPath (strPath); return TRUE; } case VK_ESCAPE: CancelInplaceEditor (); return TRUE; } } return CEdit::PreTranslateMessage (pMsg); }
void CTargetWnd::OnPaint() { WindowProc(WM_PAINT,0,0); }
BOOL CTargetWnd::OnNotify(int idCtrl,LPNMHDR pnmh) { return (BOOL)WindowProc(WM_NOTIFY,idCtrl,(LPARAM)pnmh); }
void CTargetWnd::OnHelp(LPHELPINFO lphi) { WindowProc(WM_HELP,0,(LPARAM)lphi); }
void CTargetWnd::OnInitMenuPopup(HMENU hPopupMenu,UINT nIndex,BOOL bSysMenu) { WindowProc(WM_INITMENUPOPUP,(WPARAM)hPopupMenu,MAKELPARAM(nIndex,bSysMenu)); }
void CTargetWnd::OnWindowPosChanging(LPWINDOWPOS lpWndPos) { WindowProc(WM_WINDOWPOSCHANGING,0,(LPARAM)lpWndPos); }
void CTargetWnd::OnTimer(DWORD wTimerID) { WindowProc(WM_TIMER,wTimerID,NULL); }
BOOL CTargetWnd::OnSizing(UINT nSide,LPRECT lpRect) { return (BOOL)WindowProc(WM_SIZING,(WPARAM)nSide,(LPARAM)lpRect); }
int CTargetWnd::OnMouseActivate(HWND hDesktopWnd,UINT nHitTest,UINT message) { return(int) WindowProc(WM_MOUSEACTIVATE,(WPARAM)hDesktopWnd,MAKELPARAM(nHitTest,message)); }
void CTargetWnd::OnMenuSelect(UINT uItem,UINT fuFlags,HMENU hmenu) { WindowProc(WM_MENUSELECT,MAKEWPARAM(uItem,fuFlags),(LPARAM)hmenu); }
LRESULT CTargetWnd::OnMenuChar(UINT nChar,UINT nFlags,HMENU hMenu) { return WindowProc(WM_MENUCHAR,(WPARAM)MAKELONG(nChar,nFlags),(LPARAM)hMenu); }
void CTargetWnd::OnMeasureItem(int nIDCtl,LPMEASUREITEMSTRUCT lpMeasureItemStruct) { WindowProc(WM_MEASUREITEM,nIDCtl,(LPARAM)lpMeasureItemStruct); }
void CTargetWnd::OnKillFocus(HWND hwndGetFocus) { WindowProc(WM_KILLFOCUS,(WPARAM)hwndGetFocus,0); }
void CTargetWnd::OnKeyUp(int nVirtKey,LONG lKeyData) { WindowProc(WM_KEYUP,(WPARAM)nVirtKey,(LPARAM)lKeyData); }
void CTargetWnd::OnPaintClipboard(HWND hClipAppWnd,HGLOBAL hPaintStruct) { WindowProc(WM_PAINTCLIPBOARD,(WPARAM)hClipAppWnd,(LPARAM)hPaintStruct); }
void CTargetWnd::OnSize(UINT nType, int cx, int cy) { WindowProc(WM_SIZE,(WPARAM)nType,(LPARAM)MAKELONG(cx,cy)); }
void CTargetWnd::OnMove(int x, int y) { WindowProc(WM_MOVE,0,(LPARAM)MAKELONG(x,y)); }
void CTargetWnd::OnSysCommand(UINT nID,LPARAM lParam) { WindowProc(WM_SYSCOMMAND,(WPARAM)nID,lParam); }
BOOL CTargetWnd::OnNcActivate(BOOL bActive) { return (BOOL)WindowProc(WM_NCACTIVATE,(WPARAM)bActive,0); }
void CTargetWnd::OnVScroll(UINT nSBCode,UINT nPos,HWND hScrollBar) { WindowProc(WM_VSCROLL,MAKEWPARAM(nSBCode,nPos),(LPARAM)hScrollBar); }
BOOL CTargetWnd::OnNcCreate(LPCREATESTRUCT lpCreateStruct) { return (BOOL)WindowProc(WM_NCCREATE,0,(LPARAM)lpCreateStruct); }
void CTargetWnd::OnMouseMove(UINT fwKeys,WORD xPos,WORD yPos) { WindowProc(WM_MOUSEMOVE,(WPARAM)fwKeys,(LPARAM)MAKELONG(xPos,yPos)); }
void CTargetWnd::OnInitMenu(HMENU hMenu) { WindowProc(WM_INITMENU,(WPARAM)hMenu,0); }