这篇教程C++ DefWindowProcW函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中DefWindowProcW函数的典型用法代码示例。如果您正苦于以下问题:C++ DefWindowProcW函数的具体用法?C++ DefWindowProcW怎么用?C++ DefWindowProcW使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了DefWindowProcW函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: UT_DefWindowProcLRESULT UT_DefWindowProc(HWND hWnd, UINT Msg, WPARAM wParam,LPARAM lParam){ return DefWindowProcW(hWnd, Msg, wParam, lParam); }
开发者ID:lokeshguddu,项目名称:AbiWord,代码行数:4,
示例2: GB_drawstatic void GB_draw(HTHEME theme, HWND hwnd, HDC hDC, ButtonState drawState, UINT dtFlags, BOOL focused)#endif{ static const int states[] = { GBS_NORMAL, GBS_NORMAL, GBS_NORMAL, GBS_DISABLED, GBS_NORMAL }; RECT bgRect, textRect, contentRect; int state = states[ drawState ]; WCHAR *text = get_button_text(hwnd); LOGFONTW lf; HFONT font, hPrevFont = NULL; BOOL created_font = FALSE;#ifdef __REACTOS__ /* r74406 */ HWND parent; HBRUSH hBrush; RECT clientRect;#endif HRESULT hr = GetThemeFont(theme, hDC, BP_GROUPBOX, state, TMT_FONT, &lf); if (SUCCEEDED(hr)) { font = CreateFontIndirectW(&lf); if (!font) TRACE("Failed to create font/n"); else { hPrevFont = SelectObject(hDC, font); created_font = TRUE; } } else {#ifdef __REACTOS__ /* r73885 */ font = get_button_font(hwnd);#else font = (HFONT)SendMessageW(hwnd, WM_GETFONT, 0, 0);#endif hPrevFont = SelectObject(hDC, font); } GetClientRect(hwnd, &bgRect); textRect = bgRect; if (text) { SIZE textExtent; GetTextExtentPoint32W(hDC, text, lstrlenW(text), &textExtent); bgRect.top += (textExtent.cy / 2); textRect.left += 10; textRect.bottom = textRect.top + textExtent.cy; textRect.right = textRect.left + textExtent.cx + 4; ExcludeClipRect(hDC, textRect.left, textRect.top, textRect.right, textRect.bottom); } GetThemeBackgroundContentRect(theme, hDC, BP_GROUPBOX, state, &bgRect, &contentRect); ExcludeClipRect(hDC, contentRect.left, contentRect.top, contentRect.right, contentRect.bottom);#ifdef __REACTOS__ /* r73885 & r74149 */ if (prfFlag == 0) { if (IsThemeBackgroundPartiallyTransparent(theme, BP_GROUPBOX, state)) DrawThemeParentBackground(hwnd, hDC, NULL); }#else if (IsThemeBackgroundPartiallyTransparent(theme, BP_GROUPBOX, state)) DrawThemeParentBackground(hwnd, hDC, NULL);#endif#ifdef __REACTOS__ /* r74406 */ parent = GetParent(hwnd); if (!parent) parent = hwnd; hBrush = (HBRUSH)SendMessageW(parent, WM_CTLCOLORSTATIC, (WPARAM)hDC, (LPARAM)hwnd); if (!hBrush) /* did the app forget to call defwindowproc ? */ hBrush = (HBRUSH)DefWindowProcW(parent, WM_CTLCOLORSTATIC, (WPARAM)hDC, (LPARAM)hwnd ); GetClientRect(hwnd, &clientRect); FillRect( hDC, &clientRect, hBrush );#endif DrawThemeBackground(theme, hDC, BP_GROUPBOX, state, &bgRect, NULL); SelectClipRgn(hDC, NULL); if (text) { InflateRect(&textRect, -2, 0); DrawThemeText(theme, hDC, BP_GROUPBOX, state, text, lstrlenW(text), 0, 0, &textRect); HeapFree(GetProcessHeap(), 0, text); } if (created_font) DeleteObject(font); if (hPrevFont) SelectObject(hDC, hPrevFont);}
开发者ID:Moteesh,项目名称:reactos,代码行数:90,
示例3: UpDownWindowProc/*********************************************************************** * UpDownWndProc */static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam){ UPDOWN_INFO *infoPtr = UPDOWN_GetInfoPtr (hwnd); static const WCHAR themeClass[] = {'S','p','i','n',0}; HTHEME theme; TRACE("hwnd=%p msg=%04x wparam=%08lx lparam=%08lx/n", hwnd, message, wParam, lParam); if (!infoPtr && (message != WM_CREATE)) return DefWindowProcW (hwnd, message, wParam, lParam); switch(message) { case WM_CREATE: infoPtr = Alloc (sizeof(UPDOWN_INFO)); SetWindowLongPtrW (hwnd, 0, (DWORD_PTR)infoPtr); /* initialize the info struct */ infoPtr->Self = hwnd; infoPtr->Notify = ((LPCREATESTRUCTW)lParam)->hwndParent; infoPtr->dwStyle = ((LPCREATESTRUCTW)lParam)->style; infoPtr->AccelCount = 0; infoPtr->AccelVect = 0; infoPtr->AccelIndex = -1; infoPtr->CurVal = 0; infoPtr->MinVal = 100; infoPtr->MaxVal = 0; infoPtr->Base = 10; /* Default to base 10 */ infoPtr->Buddy = 0; /* No buddy window yet */ infoPtr->Flags = 0; /* And no flags */ SetWindowLongW (hwnd, GWL_STYLE, infoPtr->dwStyle & ~WS_BORDER); /* Do we pick the buddy win ourselves? */ if (infoPtr->dwStyle & UDS_AUTOBUDDY) UPDOWN_SetBuddy (infoPtr, GetWindow (hwnd, GW_HWNDPREV)); OpenThemeData (hwnd, themeClass); TRACE("UpDown Ctrl creation, hwnd=%p/n", hwnd); break; case WM_DESTROY: Free (infoPtr->AccelVect); if(infoPtr->Buddy) RemovePropW(infoPtr->Buddy, BUDDY_UPDOWN_HWND); Free (infoPtr); SetWindowLongPtrW (hwnd, 0, 0); theme = GetWindowTheme (hwnd); CloseThemeData (theme); TRACE("UpDown Ctrl destruction, hwnd=%p/n", hwnd); break; case WM_ENABLE: if (wParam) { infoPtr->dwStyle &= ~WS_DISABLED; } else { infoPtr->dwStyle |= WS_DISABLED; UPDOWN_CancelMode (infoPtr); } InvalidateRect (infoPtr->Self, NULL, FALSE); break; case WM_STYLECHANGED: if (wParam == GWL_STYLE) { infoPtr->dwStyle = ((LPSTYLESTRUCT)lParam)->styleNew; InvalidateRect (infoPtr->Self, NULL, FALSE); } break; case WM_THEMECHANGED: theme = GetWindowTheme (hwnd); CloseThemeData (theme); OpenThemeData (hwnd, themeClass); InvalidateRect (hwnd, NULL, FALSE); break; case WM_TIMER: /* is this the auto-press timer? */ if(wParam == TIMER_AUTOPRESS) { KillTimer(hwnd, TIMER_AUTOPRESS); infoPtr->Flags &= ~(FLAG_PRESSED | FLAG_ARROW); InvalidateRect(infoPtr->Self, NULL, FALSE); } /* if initial timer, kill it and start the repeat timer */ if(wParam == TIMER_AUTOREPEAT) { int temp; KillTimer(hwnd, TIMER_AUTOREPEAT); /* if no accel info given, used default timer */ if(infoPtr->AccelCount==0 || infoPtr->AccelVect==0) { infoPtr->AccelIndex = -1; temp = REPEAT_DELAY; } else { infoPtr->AccelIndex = 0; /* otherwise, use it *///.........这里部分代码省略.........
开发者ID:devyn,项目名称:wine,代码行数:101,
示例4: HostWndProcW//.........这里部分代码省略......... case WM_MOUSEMOVE: recordMouseEvent(lastMessage); break; case WM_LBUTTONDOWN: case WM_RBUTTONDOWN: case WM_MBUTTONDOWN: if(GetFocus() != hwnd) SetFocus(hwnd); SetCapture(hwnd); /* capture mouse input */ recordMouseEvent(lastMessage); break; case WM_LBUTTONUP: case WM_RBUTTONUP: case WM_MBUTTONUP: if(GetFocus() != hwnd) SetFocus(hwnd); ReleaseCapture(); /* release mouse capture */ recordMouseEvent(lastMessage); break; /*keyboard events*/ case WM_KEYDOWN: case WM_SYSKEYDOWN: case WM_KEYUP: case WM_SYSKEYUP: case WM_CHAR: case WM_SYSCHAR: recordKeyboardEvent(lastMessage); break; /*window events*/ case WM_MOVE: case WM_SIZE: if ((GetWindowRect(hwnd, &boundingRect)) != 0){ sqWindowEvent *windowevent = (sqWindowEvent*) sqNextEventPut(); windowevent->type = EventTypeWindow; windowevent->timeStamp = lastMessage ? lastMessage->time : GetTickCount(); windowevent->action = WindowEventMetricChange; windowevent->value1 = boundingRect.left ; windowevent->value2 = boundingRect.top; windowevent->value3 = boundingRect.right; windowevent->value4 = boundingRect.bottom; windowevent->windowIndex =(int) hwnd; } break; case WM_PAINT: if ((GetWindowRect(hwnd, &boundingRect)) != 0){ sqWindowEvent *windowevent = (sqWindowEvent*) sqNextEventPut(); windowevent->type = EventTypeWindow; windowevent->timeStamp = lastMessage ? lastMessage->time : GetTickCount(); windowevent->action = WindowEventPaint; windowevent->value1 = boundingRect.left ; windowevent->value2 = boundingRect.top; windowevent->value3 = boundingRect.right; windowevent->value4 = boundingRect.bottom; windowevent->windowIndex =(int) hwnd; } break; case WM_CLOSE: { sqWindowEvent *windowevent = (sqWindowEvent*) sqNextEventPut(); windowevent->type = EventTypeWindow; windowevent->timeStamp = lastMessage ? lastMessage->time : GetTickCount(); windowevent->action = WindowEventClose; windowevent->windowIndex =(int) hwnd; } break; case WM_ACTIVATE: { sqWindowEvent *windowevent = (sqWindowEvent*) sqNextEventPut(); windowevent->type = EventTypeWindow; windowevent->timeStamp = lastMessage ? lastMessage->time : GetTickCount(); if (wParam == WA_INACTIVE) windowevent->action = WindowEventIconise; else windowevent->action = WindowEventActivated; windowevent->windowIndex =(int) hwnd; } break; case WM_GETMINMAXINFO: { sqWindowEvent *windowevent = (sqWindowEvent*) sqNextEventPut(); windowevent->type = EventTypeWindow; windowevent->timeStamp = lastMessage ? lastMessage->time : GetTickCount(); if (IsIconic(hwnd) != 0)windowevent->action = WindowEventIconise; else windowevent->action = WindowEventActivated; windowevent->windowIndex =(int) hwnd; } break; } return DefWindowProcW(hwnd,message,wParam,lParam);}
开发者ID:JeanBaptisteArnaud,项目名称:RaspLocalDebug,代码行数:101,
示例5: PAGER_WindowProcstatic LRESULT WINAPIPAGER_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam){ PAGER_INFO *infoPtr = (PAGER_INFO *)GetWindowLongPtrW(hwnd, 0); if (!infoPtr && (uMsg != WM_CREATE)) return DefWindowProcW (hwnd, uMsg, wParam, lParam); switch (uMsg) { case EM_FMTLINES: return PAGER_FmtLines(infoPtr); case PGM_FORWARDMOUSE: return PAGER_ForwardMouse (infoPtr, (BOOL)wParam); case PGM_GETBKCOLOR: return PAGER_GetBkColor(infoPtr); case PGM_GETBORDER: return PAGER_GetBorder(infoPtr); case PGM_GETBUTTONSIZE: return PAGER_GetButtonSize(infoPtr); case PGM_GETPOS: return PAGER_GetPos(infoPtr); case PGM_GETBUTTONSTATE: return PAGER_GetButtonState (infoPtr, (INT)lParam); /* case PGM_GETDROPTARGET: */ case PGM_RECALCSIZE: return PAGER_RecalcSize(infoPtr); case PGM_SETBKCOLOR: return PAGER_SetBkColor (infoPtr, (COLORREF)lParam); case PGM_SETBORDER: return PAGER_SetBorder (infoPtr, (INT)lParam); case PGM_SETBUTTONSIZE: return PAGER_SetButtonSize (infoPtr, (INT)lParam); case PGM_SETCHILD: return PAGER_SetChild (infoPtr, (HWND)lParam); case PGM_SETPOS: return PAGER_SetPos(infoPtr, (INT)lParam, FALSE); case WM_CREATE: return PAGER_Create (hwnd, (LPCREATESTRUCTW)lParam); case WM_DESTROY: return PAGER_Destroy (infoPtr); case WM_SIZE: return PAGER_Size (infoPtr, (INT)wParam, (short)LOWORD(lParam), (short)HIWORD(lParam)); case WM_NCPAINT: return PAGER_NCPaint (infoPtr, (HRGN)wParam); case WM_WINDOWPOSCHANGING: return PAGER_WindowPosChanging (infoPtr, (WINDOWPOS*)lParam); case WM_STYLECHANGED: return PAGER_StyleChanged(infoPtr, wParam, (LPSTYLESTRUCT)lParam); case WM_NCCALCSIZE: return PAGER_NCCalcSize (infoPtr, wParam, (LPRECT)lParam); case WM_NCHITTEST: return PAGER_NCHitTest (infoPtr, (short)LOWORD(lParam), (short)HIWORD(lParam)); case WM_MOUSEMOVE: if (infoPtr->bForward && infoPtr->hwndChild) PostMessageW(infoPtr->hwndChild, WM_MOUSEMOVE, wParam, lParam); return PAGER_MouseMove (infoPtr, (INT)wParam, (short)LOWORD(lParam), (short)HIWORD(lParam)); case WM_LBUTTONDOWN: return PAGER_LButtonDown (infoPtr, (INT)wParam, (short)LOWORD(lParam), (short)HIWORD(lParam)); case WM_LBUTTONUP: return PAGER_LButtonUp (infoPtr, (INT)wParam, (short)LOWORD(lParam), (short)HIWORD(lParam)); case WM_ERASEBKGND: return PAGER_EraseBackground (infoPtr, (HDC)wParam); case WM_TIMER: return PAGER_Timer (infoPtr, (INT)wParam); case WM_NOTIFY: case WM_COMMAND: return SendMessageW (infoPtr->hwndNotify, uMsg, wParam, lParam); default: return DefWindowProcW (hwnd, uMsg, wParam, lParam); }}
开发者ID:howard5888,项目名称:wineT,代码行数:100,
示例6: Child_WndProcstatic LRESULT CALLBACK Child_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam){ switch (message) { case WM_PAINT: return Child_OnPaint(hWnd); case WM_SIZE: return Child_OnSize(hWnd); case WM_NOTIFY: { HHInfo *info = (HHInfo*)GetWindowLongPtrW(hWnd, GWLP_USERDATA); NMHDR *nmhdr = (NMHDR*)lParam; switch(nmhdr->code) { case TCN_SELCHANGE: return OnTabChange(hWnd); case TVN_SELCHANGEDW: return OnTopicChange(info, (void*)((NMTREEVIEWW *)lParam)->itemNew.lParam); case NM_DBLCLK: if(!info) return 0; switch(info->current_tab) { case TAB_INDEX: return OnTopicChange(info, (void*)((NMITEMACTIVATE *)lParam)->lParam); case TAB_SEARCH: return OnTopicChange(info, (void*)((NMITEMACTIVATE *)lParam)->lParam); } break; case NM_RETURN: if(!info) return 0; switch(info->current_tab) { case TAB_INDEX: { HWND hwndList = info->tabs[TAB_INDEX].hwnd; LVITEMW lvItem; lvItem.iItem = (int) SendMessageW(hwndList, LVM_GETSELECTIONMARK, 0, 0); lvItem.mask = TVIF_PARAM; SendMessageW(hwndList, LVM_GETITEMW, 0, (LPARAM)&lvItem); OnTopicChange(info, (void*) lvItem.lParam); return 0; } case TAB_SEARCH: { if(nmhdr->hwndFrom == info->search.hwndEdit) { char needle[100]; DWORD i, len; len = GetWindowTextA(info->search.hwndEdit, needle, sizeof(needle)); if(!len) { FIXME("Unable to get search text./n"); return 0; } /* Convert the requested text for comparison later against the * lower case version of HTML file contents. */ for(i=0;i<len;i++) needle[i] = tolower(needle[i]); InitSearch(info, needle); return 0; }else if(nmhdr->hwndFrom == info->search.hwndList) { HWND hwndList = info->search.hwndList; LVITEMW lvItem; lvItem.iItem = (int) SendMessageW(hwndList, LVM_GETSELECTIONMARK, 0, 0); lvItem.mask = TVIF_PARAM; SendMessageW(hwndList, LVM_GETITEMW, 0, (LPARAM)&lvItem); OnTopicChange(info, (void*) lvItem.lParam); return 0; } break; } } break; } break; } default: return DefWindowProcW(hWnd, message, wParam, lParam); } return 0;}
开发者ID:YokoZar,项目名称:wine,代码行数:83,
示例7: IME_WindowProc//.........这里部分代码省略......... return 0L; default: break; } } switch(msg) { case WM_CREATE: { LPIMEPRIVATE myPrivate; LPINPUTCONTEXT lpIMC; SetWindowTextA(hwnd,"Wine Ime Active"); lpIMC = LockRealIMC(hIMC); if (lpIMC) { myPrivate = ImmLockIMCC(lpIMC->hPrivate); myPrivate->hwndDefault = hwnd; ImmUnlockIMCC(lpIMC->hPrivate); } UnlockRealIMC(hIMC); return TRUE; } case WM_PAINT: PaintDefaultIMEWnd(hIMC, hwnd); return FALSE; case WM_NCCREATE: return TRUE; case WM_SETFOCUS: if (wParam) SetFocus((HWND)wParam); else FIXME("Received focus, should never have focus/n"); break; case WM_IME_COMPOSITION: DefaultIMEComposition(hIMC, hwnd, lParam); break; case WM_IME_STARTCOMPOSITION: DefaultIMEStartComposition(hIMC, hwnd); break; case WM_IME_ENDCOMPOSITION: TRACE("IME message %s, 0x%lx, 0x%lx/n", "WM_IME_ENDCOMPOSITION", wParam, lParam); ShowWindow(hwnd,SW_HIDE); break; case WM_IME_SELECT: TRACE("IME message %s, 0x%lx, 0x%lx/n","WM_IME_SELECT", wParam, lParam); break; case WM_IME_CONTROL: TRACE("IME message %s, 0x%lx, 0x%lx/n","WM_IME_CONTROL", wParam, lParam); rc = 1; break; case WM_IME_NOTIFY: rc = ImeHandleNotify(hIMC,hwnd,msg,wParam,lParam); break; default: TRACE("Non-standard message 0x%x/n",msg); } /* check the MSIME messages */ if (msg == WM_MSIME_SERVICE) { TRACE("IME message %s, 0x%lx, 0x%lx/n","WM_MSIME_SERVICE", wParam, lParam); rc = FALSE; } else if (msg == WM_MSIME_RECONVERTOPTIONS) { TRACE("IME message %s, 0x%lx, 0x%lx/n","WM_MSIME_RECONVERTOPTIONS", wParam, lParam); } else if (msg == WM_MSIME_MOUSE) { TRACE("IME message %s, 0x%lx, 0x%lx/n","WM_MSIME_MOUSE", wParam, lParam); } else if (msg == WM_MSIME_RECONVERTREQUEST) { TRACE("IME message %s, 0x%lx, 0x%lx/n","WM_MSIME_RECONVERTREQUEST", wParam, lParam); } else if (msg == WM_MSIME_RECONVERT) { TRACE("IME message %s, 0x%lx, 0x%lx/n","WM_MSIME_RECONVERT", wParam, lParam); } else if (msg == WM_MSIME_QUERYPOSITION) { TRACE("IME message %s, 0x%lx, 0x%lx/n","WM_MSIME_QUERYPOSITION", wParam, lParam); } else if (msg == WM_MSIME_DOCUMENTFEED) { TRACE("IME message %s, 0x%lx, 0x%lx/n","WM_MSIME_DOCUMENTFEED", wParam, lParam); } /* DefWndProc if not an IME message */ if (!rc && !((msg >= WM_IME_STARTCOMPOSITION && msg <= WM_IME_KEYLAST) || (msg >= WM_IME_SETCONTEXT && msg <= WM_IME_KEYUP))) rc = DefWindowProcW(hwnd,msg,wParam,lParam); return rc;}
开发者ID:AmesianX,项目名称:wine,代码行数:101,
示例8: TaskManagerWndProc//.........这里部分代码省略......... TaskManager_OnRestoreMainWindow(); break; } break; case WM_NOTIFY: pnmh = (LPNMHDR)lParam; if ((pnmh->hwndFrom == hTabWnd) && (pnmh->idFrom == IDC_TAB) && (pnmh->code == TCN_SELCHANGE)) { TaskManager_OnTabWndSelChange(); } break; case WM_NCPAINT: hdc = GetDC(hDlg); GetClientRect(hDlg, &rc); Draw3dRect(hdc, rc.left, rc.top, rc.right, rc.top + 2, GetSysColor(COLOR_3DSHADOW), GetSysColor(COLOR_3DHILIGHT)); ReleaseDC(hDlg, hdc); break; case WM_PAINT: hdc = BeginPaint(hDlg, &ps); GetClientRect(hDlg, &rc); Draw3dRect(hdc, rc.left, rc.top, rc.right, rc.top + 2, GetSysColor(COLOR_3DSHADOW), GetSysColor(COLOR_3DHILIGHT)); EndPaint(hDlg, &ps); break; case WM_SIZING: /* Make sure the user is sizing the dialog */ /* in an acceptable range */ pRC = (LPRECT)lParam; if ((wParam == WMSZ_LEFT) || (wParam == WMSZ_TOPLEFT) || (wParam == WMSZ_BOTTOMLEFT)) { /* If the width is too small enlarge it to the minimum */ if (nMinimumWidth > (pRC->right - pRC->left)) pRC->left = pRC->right - nMinimumWidth; } else { /* If the width is too small enlarge it to the minimum */ if (nMinimumWidth > (pRC->right - pRC->left)) pRC->right = pRC->left + nMinimumWidth; } if ((wParam == WMSZ_TOP) || (wParam == WMSZ_TOPLEFT) || (wParam == WMSZ_TOPRIGHT)) { /* If the height is too small enlarge it to the minimum */ if (nMinimumHeight > (pRC->bottom - pRC->top)) pRC->top = pRC->bottom - nMinimumHeight; } else { /* If the height is too small enlarge it to the minimum */ if (nMinimumHeight > (pRC->bottom - pRC->top)) pRC->bottom = pRC->top + nMinimumHeight; } return TRUE; case WM_SIZE: /* Handle the window sizing in it's own function */ OnSize(wParam, LOWORD(lParam), HIWORD(lParam)); break; case WM_MOVE: /* Handle the window moving in it's own function */ OnMove(wParam, LOWORD(lParam), HIWORD(lParam)); break; case WM_DESTROY: ShowWindow(hDlg, SW_HIDE); TrayIcon_ShellRemoveTrayIcon(); wp.length = sizeof(WINDOWPLACEMENT); GetWindowPlacement(hDlg, &wp); TaskManagerSettings.Left = wp.rcNormalPosition.left; TaskManagerSettings.Top = wp.rcNormalPosition.top; TaskManagerSettings.Right = wp.rcNormalPosition.right; TaskManagerSettings.Bottom = wp.rcNormalPosition.bottom; if (IsZoomed(hDlg) || (wp.flags & WPF_RESTORETOMAXIMIZED)) TaskManagerSettings.Maximized = TRUE; else TaskManagerSettings.Maximized = FALSE; return DefWindowProcW(hDlg, message, wParam, lParam); case WM_TIMER: /* Refresh the performance data */ PerfDataRefresh(); RefreshApplicationPage(); RefreshProcessPage(); RefreshPerformancePage(); TrayIcon_ShellUpdateTrayIcon(); break; case WM_ENTERMENULOOP: TaskManager_OnEnterMenuLoop(hDlg); break; case WM_EXITMENULOOP: TaskManager_OnExitMenuLoop(hDlg); break; case WM_MENUSELECT: TaskManager_OnMenuSelect(hDlg, LOWORD(wParam), HIWORD(wParam), (HMENU)lParam); break; } return 0;}
开发者ID:Sunmonds,项目名称:wine,代码行数:101,
示例9: handleMessage LRESULT handleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam) override { switch (uMsg) { // If the user tries to destroy the window case WM_DESTROY: // Send a quit message with value of false to exit the loop PostQuitMessage(false); return 0; // If the user clicks the window case WM_LBUTTONDOWN: { // Pointer for the file dialog CComPtr<IFileOpenDialog> fileDialog; // Try to create the dialog HRESULT hr = fileDialog.CoCreateInstance(__uuidof(FileOpenDialog)); // If it failed to create the file dialog if (FAILED(hr)) { displayError(L"Could not open file selection dialog!"); return 0; } // Ask the user to select a file hr = fileDialog->Show(nullptr); // If the user chose Cancel if (FAILED(hr)) { displayError(L"No file selected!"); return 0; } // The selected file CComPtr<IShellItem> item; // Get the selected file hr = fileDialog->GetResult(&item); if (FAILED(hr)) { displayError(L"File selection failed!"); return 0; } PWSTR filePath; // Get the absolute name of the chosen file hr = item->GetDisplayName(SIGDN_FILESYSPATH, &filePath); if (FAILED(hr)) { displayError(L"Could not get file path!"); return 0; } // Display the absolute file path MessageBox(hWnd, filePath, L"File selected", MB_OK); // Release memory from the string CoTaskMemFree(filePath); return 0; } // If Windows wants to repaint the app case WM_PAINT: { PAINTSTRUCT ps; // Fill in the paint structure with info from the area to repaint HDC hDC = BeginPaint(hWnd, &ps); // Create a new solid brush for the background HBRUSH color{ CreateSolidBrush(RGB(120, 120, 120)) }; // Paint the window FillRect(hDC, &ps.rcPaint, color); // Stop painting EndPaint(hWnd, &ps); // Delete the brush to save memory DeleteObject(color); } return 0; default: // If we don't handle the message, use the default window process return DefWindowProcW(hWnd, uMsg, wParam, lParam); } }
开发者ID:GuildMasterInfinite,项目名称:Win32-Experiments,代码行数:91,
示例10: switch//.........这里部分代码省略......... flags |= WKE_RBUTTON; if (wkeFireMouseEvent(this, message, x, y, flags)) return 0; } break; case WM_CONTEXTMENU: { POINT pt; pt.x = LOWORD(lParam); pt.y = HIWORD(lParam); if (pt.x != -1 && pt.y != -1) ScreenToClient(hwnd, &pt); unsigned int flags = 0; if (wParam & MK_CONTROL) flags |= WKE_CONTROL; if (wParam & MK_SHIFT) flags |= WKE_SHIFT; if (wParam & MK_LBUTTON) flags |= WKE_LBUTTON; if (wParam & MK_MBUTTON) flags |= WKE_MBUTTON; if (wParam & MK_RBUTTON) flags |= WKE_RBUTTON; if (wkeFireContextMenuEvent(this, pt.x, pt.y, flags)) return 0; } break; case WM_MOUSEWHEEL: { POINT pt; pt.x = LOWORD(lParam); pt.y = HIWORD(lParam); ScreenToClient(hwnd, &pt); int delta = GET_WHEEL_DELTA_WPARAM(wParam); unsigned int flags = 0; if (wParam & MK_CONTROL) flags |= WKE_CONTROL; if (wParam & MK_SHIFT) flags |= WKE_SHIFT; if (wParam & MK_LBUTTON) flags |= WKE_LBUTTON; if (wParam & MK_MBUTTON) flags |= WKE_MBUTTON; if (wParam & MK_RBUTTON) flags |= WKE_RBUTTON; if (wkeFireMouseWheelEvent(this, pt.x, pt.y, delta, flags)) return 0; } break; case WM_SETFOCUS: wkeSetFocus(this); return 0; case WM_KILLFOCUS: wkeKillFocus(this); return 0; case WM_IME_STARTCOMPOSITION: { wkeRect caret = wkeGetCaretRect(this); CANDIDATEFORM form; form.dwIndex = 0; form.dwStyle = CFS_EXCLUDE; form.ptCurrentPos.x = caret.x; form.ptCurrentPos.y = caret.y + caret.h; form.rcArea.top = caret.y; form.rcArea.bottom = caret.y + caret.h; form.rcArea.left = caret.x; form.rcArea.right = caret.x + caret.w; COMPOSITIONFORM compForm; compForm.ptCurrentPos = form.ptCurrentPos; compForm.rcArea = form.rcArea; compForm.dwStyle = CFS_POINT; HIMC hIMC = ImmGetContext(hwnd); ImmSetCandidateWindow(hIMC, &form); ImmSetCompositionWindow(hIMC, &compForm); ImmReleaseContext(hwnd, hIMC); } return 0; } return DefWindowProcW(hwnd, message, wParam, lParam);}
开发者ID:kertL,项目名称:wke,代码行数:101,
示例11: tableWndProcstatic LRESULT CALLBACK tableWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam){ struct table *t; HDC dc; PAINTSTRUCT ps; NMHDR *nmhdr = (NMHDR *) lParam; NMHEADERW *nm = (NMHEADERW *) lParam; t = (struct table *) GetWindowLongPtrW(hwnd, GWLP_USERDATA); if (t == NULL) { // we have to do things this way because creating the header control will fail mysteriously if we create it first thing // (which is fine; we can get the parent hInstance this way too) if (uMsg == WM_NCCREATE) { CREATESTRUCTW *cs = (CREATESTRUCTW *) lParam; t = (struct table *) malloc(sizeof (struct table)); if (t == NULL) abort(); ZeroMemory(t, sizeof (struct table)); t->hwnd = hwnd; // TODO this should be a global t->defaultFont = (HFONT) GetStockObject(SYSTEM_FONT); if (t->defaultFont == NULL) abort(); t->font = t->defaultFont;t->selected = 5;t->count=100;//TODO t->header = CreateWindowExW(0, WC_HEADERW, L"", // TODO is HOTTRACK needed? WS_CHILD | HDS_FULLDRAG | HDS_HORZ | HDS_HOTTRACK, 0, 0, 0, 0, t->hwnd, (HMENU) 100, cs->hInstance, NULL); if (t->header == NULL) abort();{t->imagelist = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR32, 1, 1);if(t->imagelist==NULL)abort();{HICON icon;int unused;icon = LoadIconW(NULL, IDI_ERROR);if(icon == NULL)abort();if (ImageList_AddIcon(t->imagelist, icon) == -1)abort();if (ImageList_GetIconSize(t->imagelist, &unused, &(t->imagelistHeight)) == 0)abort();}} t->checkboxes = makeCheckboxImageList(t->hwnd, &(t->theme), &(t->checkboxWidth), &(t->checkboxHeight)); t->focusedColumn = -1; SetWindowLongPtrW(hwnd, GWLP_USERDATA, (LONG_PTR) t); } // even if we did the above, fall through return DefWindowProcW(hwnd, uMsg, wParam, lParam); } switch (uMsg) { case WM_PAINT: dc = BeginPaint(hwnd, &ps); if (dc == NULL) abort(); drawItems(t, dc, ps.rcPaint); EndPaint(hwnd, &ps); return 0; case WM_SETFONT: t->font = (HFONT) wParam; if (t->font == NULL) t->font = t->defaultFont; // also set the header font SendMessageW(t->header, WM_SETFONT, wParam, lParam); if (LOWORD(lParam) != FALSE) { // the scrollbar page size will change so redraw that too // also recalculate the header height // TODO do that when this is FALSE too somehow resize(t); redrawAll(t); } return 0; case WM_GETFONT: return (LRESULT) t->font; case WM_VSCROLL: vscroll(t, wParam); return 0; case WM_MOUSEWHEEL: wheelscroll(t, wParam); return 0; case WM_HSCROLL: hscroll(t, wParam); return 0; case WM_SIZE: resize(t); return 0; case WM_LBUTTONDOWN: selectItem(t, wParam, lParam); return 0; case WM_SETFOCUS: case WM_KILLFOCUS: // all we need to do here is redraw the highlight // TODO ensure giving focus works right redrawRow(t, t->selected); return 0; case WM_KEYDOWN: keySelect(t, wParam, lParam); return 0;//.........这里部分代码省略.........
开发者ID:yhcflyy,项目名称:ui,代码行数:101,
示例12: WndProcstatic LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam){ if (message == WM_NCCREATE) { CREATESTRUCT *cs = (void*)lParam; SetWindowLongPtrW(hWnd, GWLP_USERDATA, (LONG_PTR)cs->lpCreateParams); } struct vo *vo = (void*)GetWindowLongPtrW(hWnd, GWLP_USERDATA); // message before WM_NCCREATE, pray to Raymond Chen that it's not important if (!vo) return DefWindowProcW(hWnd, message, wParam, lParam); struct vo_w32_state *w32 = vo->w32; int mouse_button = 0; switch (message) { case WM_ERASEBKGND: // no need to erase background seperately return 1; case WM_PAINT: w32->event_flags |= VO_EVENT_EXPOSE; break; case WM_MOVE: { POINT p = {0}; ClientToScreen(w32->window, &p); w32->window_x = p.x; w32->window_y = p.y; MP_VERBOSE(vo, "move window: %d:%d/n", w32->window_x, w32->window_y); break; } case WM_SIZE: { w32->event_flags |= VO_EVENT_RESIZE; RECT r; GetClientRect(w32->window, &r); vo->dwidth = r.right; vo->dheight = r.bottom; MP_VERBOSE(vo, "resize window: %d:%d/n", vo->dwidth, vo->dheight); break; } case WM_SIZING: if (vo->opts->keepaspect && !vo->opts->fullscreen && vo->opts->WinID < 0) { RECT *rc = (RECT*)lParam; // get client area of the windows if it had the rect rc // (subtracting the window borders) RECT r = *rc; subtract_window_borders(w32->window, &r); int c_w = r.right - r.left, c_h = r.bottom - r.top; float aspect = w32->o_dwidth / (float) MPMAX(w32->o_dheight, 1); int d_w = c_h * aspect - c_w; int d_h = c_w / aspect - c_h; int d_corners[4] = { d_w, d_h, -d_w, -d_h }; int corners[4] = { rc->left, rc->top, rc->right, rc->bottom }; int corner = get_resize_border(wParam); if (corner >= 0) corners[corner] -= d_corners[corner]; *rc = (RECT) { corners[0], corners[1], corners[2], corners[3] }; return TRUE; } break; case WM_CLOSE: mp_input_put_key(vo->input_ctx, MP_KEY_CLOSE_WIN); break; case WM_SYSCOMMAND: switch (wParam) { case SC_SCREENSAVE: case SC_MONITORPOWER: if (w32->disable_screensaver) { MP_VERBOSE(vo, "win32: killing screensaver/n"); return 0; } break; } break; case WM_KEYDOWN: case WM_SYSKEYDOWN: { int mpkey = lookup_keymap_table(vk_map, wParam); if (mpkey) mp_input_put_key(vo->input_ctx, mpkey | mod_state(vo)); if (wParam == VK_F10) return 0; break; } case WM_CHAR: case WM_SYSCHAR: { int mods = mod_state(vo); int code = wParam; // Windows enables Ctrl+Alt when AltGr (VK_RMENU) is pressed. // E.g. AltGr+9 on a German keyboard would yield Ctrl+Alt+[ // Warning: wine handles this differently. Don't test this on wine! if (key_state(vo, VK_RMENU) && mp_input_use_alt_gr(vo->input_ctx)) mods &= ~(MP_KEY_MODIFIER_CTRL | MP_KEY_MODIFIER_ALT); // Apparently Ctrl+A to Ctrl+Z is special cased, and produces // character codes from 1-26. Work it around. // Also, enter/return (including the keypad variant) and CTRL+J both // map to wParam==10. As a workaround, check VK_RETURN to // distinguish these two key combinations. if ((mods & MP_KEY_MODIFIER_CTRL) && code >= 1 && code <= 26 && !key_state(vo, VK_RETURN))//.........这里部分代码省略.........
开发者ID:agiz,项目名称:mpv,代码行数:101,
示例13: mainWindowProc//.........这里部分代码省略......... break; case ID_EDIT_SELECTROW: trackView->selectRow(trackView->getEditRow()); break; case ID_FILE_REMOTEEXPORT: document.sendSaveCommand(); break; case ID_RECENTFILES_FILE1: case ID_RECENTFILES_FILE2: case ID_RECENTFILES_FILE3: case ID_RECENTFILES_FILE4: case ID_RECENTFILES_FILE5: { int index = LOWORD(wParam) - ID_RECENTFILES_FILE1; std::wstring fileName; if (mruFileList.getEntry(index, fileName)) { loadDocument(fileName); } } break; case ID_FILE_EXIT: attemptQuit(); break; case ID_EDIT_UNDO: SendMessage(trackViewWin, WM_UNDO, 0, 0); break; case ID_EDIT_REDO: SendMessage(trackViewWin, WM_REDO, 0, 0); break; case ID_EDIT_COPY: SendMessage(trackViewWin, WM_COPY, 0, 0); break; case ID_EDIT_CUT: SendMessage(trackViewWin, WM_CUT, 0, 0); break; case ID_EDIT_PASTE: SendMessage(trackViewWin, WM_PASTE, 0, 0); break; case ID_EDIT_SETROWS: { int rows = int(trackView->getRows()); INT_PTR result = DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_SETROWS), hwnd, (DLGPROC)setRowsDialogProc, (LPARAM)&rows); if (FAILED(result)) error("unable to create dialog box"); } break; case ID_EDIT_BIAS: { int initialBias = 0; INT_PTR result = DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_BIASSELECTION), hwnd, (DLGPROC)biasSelectionDialogProc, (LPARAM)&initialBias); if (FAILED(result)) error("unable to create dialog box"); } break; } break; case WM_ROWCHANGED: { char temp[256]; snprintf(temp, 256, "%d", lParam ); SendMessage(statusBarWin, SB_SETTEXT, 1, (LPARAM)temp); } break; case WM_TRACKCHANGED: { char temp[256]; snprintf(temp, 256, "%d", lParam); SendMessage(statusBarWin, SB_SETTEXT, 2, (LPARAM)temp); } break; case WM_CURRVALDIRTY: { char temp[256]; if (document.num_tracks > 0) { const sync_track *t = document.tracks[document.getTrackIndexFromPos(trackView->getEditTrack())]; int row = trackView->getEditRow(); int idx = key_idx_floor(t, row); snprintf(temp, 256, "%f", sync_get_val(t, row)); const char *str = "---"; if (idx >= 0) { switch (t->keys[idx].type) { case KEY_STEP: str = "step"; break; case KEY_LINEAR: str = "linear"; break; case KEY_SMOOTH: str = "smooth"; break; case KEY_RAMP: str = "ramp"; break; } } SendMessage(statusBarWin, SB_SETTEXT, 4, (LPARAM)str); } else snprintf(temp, 256, "---"); SendMessage(statusBarWin, SB_SETTEXT, 3, (LPARAM)temp); } break; default: return DefWindowProcW(hwnd, msg, wParam, lParam); } return 0;}
开发者ID:visualizersdotnl,项目名称:hot-stuff-src,代码行数:101,
示例14: WndProcLRESULT CALLBACK WndProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam){ switch (uMsg) { case WM_ACTIVATE: { Active=(!HIWORD(wParam)); return 0; } case WM_SYSCOMMAND: { switch (wParam) { case SC_SCREENSAVE: case SC_MONITORPOWER: return 0; } break; } case WM_CLOSE: { Done = true; return 0; } case WM_KEYDOWN: { Keys[wParam] = true; return 0; } case WM_KEYUP: { Keys[wParam] = false; if (wParam==VK_SNAPSHOT) { ScreenSave(); return DefWindowProcW(hWnd,uMsg,wParam,lParam); } return 0; }#ifdef MINIMALTWEAKER case WM_MOUSEMOVE: { POINT ap; GetCursorPos(&ap); ScreenToClient(hWnd,&ap); mx=ap.x; my=ap.y; return 0; } case WM_LBUTTONDOWN: { LeftButton=true; POINT ap; GetCursorPos(&ap); LeftShift=(wParam & MK_SHIFT)==0; LeftCtrl=(wParam & MK_CONTROL)==0; ScreenToClient(hWnd,&ap); lx=ap.x; ly=ap.y; return 0; } case WM_LBUTTONUP: { LeftButton=false; LeftButtonReleased=true; return 0; } case WM_RBUTTONDOWN: { RightButton=true; POINT ap; GetCursorPos(&ap); RightShift=(wParam & MK_SHIFT)==0; RightCtrl=(wParam & MK_CONTROL)==0; ScreenToClient(hWnd,&ap); rx=ap.x; ry=ap.y; return 0; } case WM_RBUTTONUP: { RightButton=false; RightButtonReleased=true; return 0; } case WM_MBUTTONDOWN: { MiddleButton=true; POINT ap;//.........这里部分代码省略.........
开发者ID:ConspiracyHu,项目名称:2012SourcePack,代码行数:101,
示例15: VDDualDefWindowProcW32LRESULT VDDualDefWindowProcW32(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { return IsWindowUnicode(hwnd) ? DefWindowProcW(hwnd, msg, wParam, lParam) : DefWindowProcA(hwnd, msg, wParam, lParam);}
开发者ID:Fluffiest,项目名称:mpc-hc,代码行数:3,
示例16: IPADDRESS_WindowProcstatic LRESULT WINAPIIPADDRESS_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam){ IPADDRESS_INFO *infoPtr = (IPADDRESS_INFO *)GetWindowLongPtrW (hwnd, 0); TRACE("(hwnd=%p msg=0x%x wparam=0x%x lparam=0x%lx)/n", hwnd, uMsg, wParam, lParam); if (!infoPtr && (uMsg != WM_CREATE)) return DefWindowProcW (hwnd, uMsg, wParam, lParam); switch (uMsg) { case WM_CREATE: return IPADDRESS_Create (hwnd, (LPCREATESTRUCTA)lParam); case WM_DESTROY: return IPADDRESS_Destroy (infoPtr); case WM_ENABLE: return IPADDRESS_Enable (infoPtr, (BOOL)wParam); break; case WM_PAINT: return IPADDRESS_Paint (infoPtr, (HDC)wParam); case WM_COMMAND: switch(wParam >> 16) { case EN_CHANGE: IPADDRESS_Notify(infoPtr, EN_CHANGE); break; case EN_KILLFOCUS: IPADDRESS_ConstrainField(infoPtr, IPADDRESS_GetPartIndex(infoPtr, (HWND)lParam)); break; } break; case IPM_CLEARADDRESS: IPADDRESS_ClearAddress (infoPtr); break; case IPM_SETADDRESS: return IPADDRESS_SetAddress (infoPtr, (DWORD)lParam); case IPM_GETADDRESS: return IPADDRESS_GetAddress (infoPtr, (LPDWORD)lParam); case IPM_SETRANGE: return IPADDRESS_SetRange (infoPtr, (int)wParam, (WORD)lParam); case IPM_SETFOCUS: IPADDRESS_SetFocusToField (infoPtr, (int)wParam); break; case IPM_ISBLANK: return IPADDRESS_IsBlank (infoPtr); default: if ((uMsg >= WM_USER) && (uMsg < WM_APP)) ERR("unknown msg %04x wp=%08x lp=%08lx/n", uMsg, wParam, lParam); return DefWindowProcW (hwnd, uMsg, wParam, lParam); } return 0;}
开发者ID:howard5888,项目名称:wineT,代码行数:63,
示例17: desktop_wnd_proc/* window procedure for the desktop window */static LRESULT WINAPI desktop_wnd_proc( HWND hwnd, UINT message, WPARAM wp, LPARAM lp ){ WINE_TRACE( "got msg %04x wp %lx lp %lx/n", message, wp, lp ); switch(message) { case WM_SYSCOMMAND: switch(wp & 0xfff0) { case SC_CLOSE: ExitWindows( 0, 0 ); break; case SC_SCREENSAVE: return start_screensaver(); } return 0; case WM_CLOSE: PostQuitMessage(0); return 0; case WM_SETCURSOR: return (LRESULT)SetCursor( LoadCursorA( 0, (LPSTR)IDC_ARROW ) ); case WM_NCHITTEST: return HTCLIENT; case WM_ERASEBKGND: if (!using_root) PaintDesktop( (HDC)wp ); return TRUE; case WM_SETTINGCHANGE: if (wp == SPI_SETDESKWALLPAPER) SystemParametersInfoW( SPI_SETDESKWALLPAPER, 0, NULL, FALSE ); return 0; case WM_LBUTTONDBLCLK: if (!using_root) { const struct launcher *launcher = launcher_from_point( (short)LOWORD(lp), (short)HIWORD(lp) ); if (launcher) do_launch( launcher ); } return 0; case WM_PAINT: { PAINTSTRUCT ps; BeginPaint( hwnd, &ps ); if (!using_root) { if (ps.fErase) PaintDesktop( ps.hdc ); draw_launchers( ps.hdc, ps.rcPaint ); } EndPaint( hwnd, &ps ); } return 0; default: return DefWindowProcW( hwnd, message, wp, lp ); }}
开发者ID:AmineKhaldi,项目名称:mbedtls-cleanup,代码行数:62,
示例18: WndProc//.........这里部分代码省略......... } switch (LOWORD(lParam)) { case WM_LBUTTONUP: case WM_LBUTTONDBLCLK: event->button = 0; break; case WM_MBUTTONUP: case WM_MBUTTONDBLCLK: event->button = 1; break; case WM_RBUTTONUP: case WM_RBUTTONDBLCLK: case WM_CONTEXTMENU: case NIN_KEYSELECT: event->button = 2; break; } if (event->clickCount) { POINT wpt; if (GetCursorPos(&wpt) == TRUE) { event->x = wpt.x; event->y = wpt.y; event->keys = 0; if (::GetKeyState(VK_CONTROL) & 0x8000) { event->keys += (1<<0); } if (::GetKeyState(VK_MENU) & 0x8000) { event->keys += (1<<1); } if (::GetKeyState(VK_SHIFT) & 0x8000) { event->keys += (1<<2); } PostMessage(hwnd, WM_TRAYCALLBACK, 1, (LPARAM)event); } else { delete event; } } return 0; } // Window title changed else if (uMsg == WM_SETTEXT) { NOTIFYICONDATAW *iconData = reinterpret_cast<NOTIFYICONDATAW*>(GetPropW(hwnd, kIconData)); if (iconData == 0) { goto WndProcEnd; } // First, let the original wndproc process this message, // so that we may query the thing afterwards ;) // this is required because we cannot know the encoding of this message for sure ;) LRESULT rv; WNDPROC oldWindowProc = reinterpret_cast<WNDPROC>(::GetPropW(hwnd, kOldProc)); if (oldWindowProc != 0) { rv = CallWindowProcW(oldWindowProc, hwnd, uMsg, wParam, lParam); } else { rv = DefWindowProcW(hwnd, uMsg, wParam, lParam); } if (::GetWindowTextW(hwnd, iconData->szTip, 127) != 0) { iconData->szTip[128] = '/0'; Shell_NotifyIconW(NIM_MODIFY, iconData); } return rv; } } // Need to handle this in or own message or crash! // See https://bugzilla.mozilla.org/show_bug.cgi?id=671266 if (uMsg == WM_TRAYCALLBACK) { if (wParam == 0) { minimize_callback_t callback = reinterpret_cast<minimize_callback_t>(::GetPropW(hwnd, kWatchMinimizeProc)); if (callback) { callback(hwnd, (int)lParam); } } else if (wParam == 1) { mouseevent_t *event = reinterpret_cast<mouseevent_t*>(lParam); mouseevent_callback_t callback = reinterpret_cast<mouseevent_callback_t>(::GetPropW(hwnd, kIconMouseEventProc)); if (event && callback) { // SFW/PM is a win32 hack, so that the context menu is hidden when loosing focus. ::SetForegroundWindow(hwnd); callback(hwnd, event); ::PostMessage(hwnd, WM_NULL, 0, 0L); } delete event; } return 0; }WndProcEnd: // Call the old WNDPROC or at lest DefWindowProc WNDPROC oldProc = reinterpret_cast<WNDPROC>(::GetPropW(hwnd, kOldProc)); if (oldProc != 0) { return ::CallWindowProcW(oldProc, hwnd, uMsg, wParam, lParam); } return ::DefWindowProcW(hwnd, uMsg, wParam, lParam);}
开发者ID:jjk-jacky,项目名称:mintrayr,代码行数:101,
示例19: windowProc// Window callback function (handles window messages)//static LRESULT CALLBACK windowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam){ _GLFWwindow* window = (_GLFWwindow*) GetWindowLongPtrW(hWnd, 0); if (!window) { switch (uMsg) { case WM_NCCREATE: { CREATESTRUCTW* cs = (CREATESTRUCTW*) lParam; SetWindowLongPtrW(hWnd, 0, (LONG_PTR) cs->lpCreateParams); break; } case WM_DEVICECHANGE: { if (wParam == DBT_DEVNODES_CHANGED) { _glfwInputMonitorChange(); return TRUE; } break; } } return DefWindowProcW(hWnd, uMsg, wParam, lParam); } switch (uMsg) { case WM_SETFOCUS: { if (window->cursorMode == GLFW_CURSOR_DISABLED) _glfwPlatformSetCursorMode(window, GLFW_CURSOR_DISABLED); _glfwInputWindowFocus(window, GLFW_TRUE); return 0; } case WM_KILLFOCUS: { if (window->cursorMode == GLFW_CURSOR_DISABLED) _glfwPlatformSetCursorMode(window, GLFW_CURSOR_NORMAL); if (window->monitor && window->autoIconify) _glfwPlatformIconifyWindow(window); _glfwInputWindowFocus(window, GLFW_FALSE); return 0; } case WM_SYSCOMMAND: { switch (wParam & 0xfff0) { case SC_SCREENSAVE: case SC_MONITORPOWER: { if (window->monitor) { // We are running in full screen mode, so disallow // screen saver and screen blanking return 0; } else break; } // User trying to access application menu using ALT? case SC_KEYMENU: return 0; } break; } case WM_CLOSE: { _glfwInputWindowCloseRequest(window); return 0; } case WM_CHAR: case WM_SYSCHAR: case WM_UNICHAR: { const GLFWbool plain = (uMsg != WM_SYSCHAR); if (uMsg == WM_UNICHAR && wParam == UNICODE_NOCHAR) { // WM_UNICHAR is not sent by Windows, but is sent by some // third-party input method engine // Returning TRUE here announces support for this message return TRUE; } _glfwInputChar(window, (unsigned int) wParam, getKeyMods(), plain);//.........这里部分代码省略.........
开发者ID:timur-losev,项目名称:glfw,代码行数:101,
示例20: switch//.........这里部分代码省略......... const bool bRepeat = (lParam & (1 << 30)) != 0; // Send character to input event system UGameInput::Get().OnKeyDown(key, CharCode, bRepeat); // TEMP: ESC quits the game if (key == VK_ESCAPE) { PostQuitMessage(0); } break; } case WM_KEYUP: { // For key events (i.e. game input) const UINT key = static_cast<UINT>(wParam); const UINT CharCode = MapVirtualKeyW(key, MAPVK_VK_TO_CHAR); const bool bRepeat = (lParam & (1 << 30)) != 0; // Send character to input event system UGameInput::Get().OnKeyUp(key, CharCode, bRepeat); break; } case WM_MOUSEWHEEL: { const short wheelRotation = GET_WHEEL_DELTA_WPARAM(wParam); const int numClicks = wheelRotation / WHEEL_DELTA; // Send numClicks to input mouse system break; } case WM_LBUTTONDOWN: { return 0; break; } case WM_MBUTTONDOWN: { return 0; break; } case WM_RBUTTONDOWN: { return 0; break; } case WM_LBUTTONUP: { return 0; break; } case WM_MBUTTONUP: { return 0; break; } case WM_RBUTTONUP: { return 0; break; } case WM_SIZE: { //NOTE: You NEVER want to put a breakpoint here or you'll have to restart your computer. if (gEngine) { gEngine->GetRenderer()->OnScreenSizeChanged(); } break; } case WM_ACTIVATE: { auto activeStatus = LOWORD(wParam); if (activeStatus == WA_ACTIVE || activeStatus == WA_CLICKACTIVE) { UGameInput::Get().OnFocusChanged(true); } else if (activeStatus == WA_INACTIVE) { UGameInput::Get().OnFocusChanged(false); } break; } default: return DefWindowProcW(hWnd, message, wParam, lParam); } return 0; }
开发者ID:steventr,项目名称:MADEngine,代码行数:101,
示例21: WinProc// Window event handler - Use as less as possibleLRESULT CALLBACK WinProc(HWND _hwnd, UINT _id, WPARAM wParam, LPARAM lParam){ WindowsDesc* gCurrentWindow = NULL; tinystl::unordered_hash_node<void*, WindowsDesc*>* pNode = gHWNDMap.find(_hwnd).node; if (pNode) gCurrentWindow = pNode->second; else return DefWindowProcW(_hwnd, _id, wParam, lParam); switch (_id) { case WM_ACTIVATE: if (LOWORD(wParam) == WA_INACTIVE) { captureMouse(_hwnd, false); } break; case WM_DISPLAYCHANGE: { if (gCurrentWindow) { if (gCurrentWindow->fullScreen) { adjustWindow(gCurrentWindow); } else { adjustWindow(gCurrentWindow); } } break; } case WM_SIZE: if (gCurrentWindow) { RectDesc rect = { 0 }; if (gCurrentWindow->fullScreen) { gCurrentWindow->fullscreenRect = { 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN) }; rect = gCurrentWindow->fullscreenRect; } else { if (IsIconic(_hwnd)) return 0; RECT windowRect; GetClientRect(_hwnd, &windowRect); rect = { (int)windowRect.left, (int)windowRect.top, (int)windowRect.right, (int)windowRect.bottom }; gCurrentWindow->windowedRect = rect; } WindowResizeEventData eventData = { rect, gCurrentWindow }; PlatformEvents::onWindowResize(&eventData); } break; case WM_CLOSE: case WM_QUIT: gAppRunning = false; break; case WM_CHAR: { KeyboardCharEventData eventData; eventData.unicode = (unsigned)wParam; PlatformEvents::onKeyboardChar(&eventData); break; } case WM_MOUSEMOVE: { static int lastX = 0, lastY = 0; int x, y; x = GETX(lParam); y = GETY(lParam); MouseMoveEventData eventData; eventData.x = x; eventData.y = y; eventData.deltaX = x - lastX; eventData.deltaY = y - lastY; eventData.captured = isCaptured; PlatformEvents::onMouseMove(&eventData); lastX = x; lastY = y; break; } case WM_INPUT: { UINT dwSize; static BYTE lpb[128] = {}; GetRawInputData((HRAWINPUT)lParam, RID_INPUT, lpb, &dwSize, sizeof(RAWINPUTHEADER)); RAWINPUT* raw = (RAWINPUT*)lpb;//.........这里部分代码省略.........
开发者ID:VladSerhiienko,项目名称:The-Forge,代码行数:101,
示例22: ANIMATE_WindowProcstatic LRESULT WINAPI ANIMATE_WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam){ ANIMATE_INFO *infoPtr = (ANIMATE_INFO *)GetWindowLongPtrW(hWnd, 0); TRACE("hwnd=%p msg=%x wparam=%lx lparam=%lx/n", hWnd, uMsg, wParam, lParam); if (!infoPtr && (uMsg != WM_NCCREATE)) return DefWindowProcW(hWnd, uMsg, wParam, lParam); switch (uMsg) { case ACM_OPENA: return ANIMATE_OpenA(infoPtr, (HINSTANCE)wParam, (LPSTR)lParam); case ACM_OPENW: return ANIMATE_OpenW(infoPtr, (HINSTANCE)wParam, (LPWSTR)lParam); case ACM_PLAY: return ANIMATE_Play(infoPtr, (INT)wParam, LOWORD(lParam), HIWORD(lParam)); case ACM_STOP: return ANIMATE_Stop(infoPtr); case WM_CLOSE: ANIMATE_Free(infoPtr); return 0; case WM_NCCREATE: return ANIMATE_Create(hWnd, (LPCREATESTRUCTW)lParam); case WM_NCHITTEST: return HTTRANSPARENT; case WM_DESTROY: return ANIMATE_Destroy(infoPtr); case WM_ERASEBKGND: return ANIMATE_EraseBackground(infoPtr, (HDC)wParam); case WM_STYLECHANGED: return ANIMATE_StyleChanged(infoPtr, wParam, (LPSTYLESTRUCT)lParam); case WM_TIMER: return ANIMATE_Timer(infoPtr); case WM_PRINTCLIENT: case WM_PAINT: { /* the animation has not decompressed * (and displayed) the first frame yet, don't paint */ if (!infoPtr->hbmPrevFrame) { /* default paint handling */ return DefWindowProcW(hWnd, uMsg, wParam, lParam); } if (wParam) { EnterCriticalSection(&infoPtr->cs); ANIMATE_PaintFrame(infoPtr, (HDC)wParam); LeaveCriticalSection(&infoPtr->cs); } else { PAINTSTRUCT ps; HDC hDC = BeginPaint(infoPtr->hwndSelf, &ps); EnterCriticalSection(&infoPtr->cs); ANIMATE_PaintFrame(infoPtr, hDC); LeaveCriticalSection(&infoPtr->cs); EndPaint(infoPtr->hwndSelf, &ps); } } break; case WM_SIZE: if (infoPtr->dwStyle & ACS_CENTER) InvalidateRect(infoPtr->hwndSelf, NULL, TRUE); return DefWindowProcW(hWnd, uMsg, wParam, lParam); default: if ((uMsg >= WM_USER) && (uMsg < WM_APP) && !COMCTL32_IsReflectedMessage(uMsg)) ERR("unknown msg %04x wp=%08lx lp=%08lx/n", uMsg, wParam, lParam); return DefWindowProcW(hWnd, uMsg, wParam, lParam); } return 0;}
开发者ID:AndreRH,项目名称:wine,代码行数:88,
示例23: CB_drawstatic void CB_draw(HTHEME theme, HWND hwnd, HDC hDC, ButtonState drawState, UINT dtFlags, BOOL focused, LPARAM prfFlag){ static const int cb_states[3][5] = { { CBS_UNCHECKEDNORMAL, CBS_UNCHECKEDHOT, CBS_UNCHECKEDPRESSED, CBS_UNCHECKEDDISABLED, CBS_UNCHECKEDNORMAL }, { CBS_CHECKEDNORMAL, CBS_CHECKEDHOT, CBS_CHECKEDPRESSED, CBS_CHECKEDDISABLED, CBS_CHECKEDNORMAL }, { CBS_MIXEDNORMAL, CBS_MIXEDHOT, CBS_MIXEDPRESSED, CBS_MIXEDDISABLED, CBS_MIXEDNORMAL } }; static const int rb_states[2][5] = { { RBS_UNCHECKEDNORMAL, RBS_UNCHECKEDHOT, RBS_UNCHECKEDPRESSED, RBS_UNCHECKEDDISABLED, RBS_UNCHECKEDNORMAL }, { RBS_CHECKEDNORMAL, RBS_CHECKEDHOT, RBS_CHECKEDPRESSED, RBS_CHECKEDDISABLED, RBS_CHECKEDNORMAL } }; SIZE sz; RECT bgRect, textRect; HFONT font, hPrevFont = NULL; LRESULT checkState = get_button_state(hwnd) & 3; DWORD dwStyle = GetWindowLongW(hwnd, GWL_STYLE); int part = ((dwStyle & BUTTON_TYPE) == BS_RADIOBUTTON) || ((dwStyle & BUTTON_TYPE) == BS_AUTORADIOBUTTON) ? BP_RADIOBUTTON : BP_CHECKBOX; int state = (part == BP_CHECKBOX) ? cb_states[ checkState ][ drawState ] : rb_states[ checkState ][ drawState ]; WCHAR *text; LOGFONTW lf; BOOL created_font = FALSE; HWND parent; HBRUSH hBrush; DWORD cdrf; HRESULT hr = GetThemeFont(theme, hDC, part, state, TMT_FONT, &lf); if (SUCCEEDED(hr)) { font = CreateFontIndirectW(&lf); if (!font) TRACE("Failed to create font/n"); else { TRACE("font = %s/n", debugstr_w(lf.lfFaceName)); hPrevFont = SelectObject(hDC, font); created_font = TRUE; } } else { font = get_button_font(hwnd); hPrevFont = SelectObject(hDC, font); } if (FAILED(GetThemePartSize(theme, hDC, part, state, NULL, TS_DRAW, &sz))) sz.cx = sz.cy = 13; GetClientRect(hwnd, &bgRect); if (prfFlag == 0) { DrawThemeParentBackground(hwnd, hDC, NULL); } parent = GetParent(hwnd); if (!parent) parent = hwnd; hBrush = (HBRUSH)SendMessageW(parent, WM_CTLCOLORSTATIC, (WPARAM)hDC, (LPARAM)hwnd); if (!hBrush) /* did the app forget to call defwindowproc ? */ hBrush = (HBRUSH)DefWindowProcW(parent, WM_CTLCOLORSTATIC, (WPARAM)hDC, (LPARAM)hwnd ); FillRect( hDC, &bgRect, hBrush ); cdrf = BUTTON_SendCustomDraw(hwnd, hDC, CDDS_PREERASE, &bgRect); if (cdrf == CDRF_SKIPDEFAULT) goto cleanup; GetThemeBackgroundContentRect(theme, hDC, part, state, &bgRect, &textRect); if (dtFlags & DT_SINGLELINE) /* Center the checkbox / radio button to the text. */ bgRect.top = bgRect.top + (textRect.bottom - textRect.top - sz.cy) / 2; /* adjust for the check/radio marker */ bgRect.bottom = bgRect.top + sz.cy; bgRect.right = bgRect.left + sz.cx; textRect.left = bgRect.right + 6; DrawThemeBackground(theme, hDC, part, state, &bgRect, NULL); if (cdrf == CDRF_NOTIFYPOSTERASE) BUTTON_SendCustomDraw(hwnd, hDC, CDDS_POSTERASE, &bgRect); cdrf = BUTTON_SendCustomDraw(hwnd, hDC, CDDS_PREPAINT, &bgRect); if (cdrf == CDRF_SKIPDEFAULT) goto cleanup; text = get_button_text(hwnd); if (text) { DrawThemeText(theme, hDC, part, state, text, lstrlenW(text), dtFlags, 0, &textRect); if (focused) { RECT focusRect; focusRect = textRect;//.........这里部分代码省略.........
开发者ID:Moteesh,项目名称:reactos,代码行数:101,
示例24: ChildWndProc//.........这里部分代码省略......... RECT rc; hti.hItem = TreeView_GetSelection(g_pChildWnd->hTreeWnd); if (hti.hItem != NULL) { TreeView_GetItemRect(g_pChildWnd->hTreeWnd, hti.hItem, &rc, TRUE); pt.x = rc.left + 8; pt.y = rc.top + 8; ClientToScreen(g_pChildWnd->hTreeWnd, &pt); hti.flags = TVHT_ONITEM; } else hti.flags = 0; } else { hti.pt.x = pt.x; hti.pt.y = pt.y; ScreenToClient(g_pChildWnd->hTreeWnd, &hti.pt); (void)TreeView_HitTest(g_pChildWnd->hTreeWnd, &hti); } if (hti.flags & TVHT_ONITEM) { hContextMenu = GetSubMenu(hPopupMenus, PM_TREECONTEXT); (void)TreeView_SelectItem(g_pChildWnd->hTreeWnd, hti.hItem); memset(&item, 0, sizeof(item)); item.mask = TVIF_STATE | TVIF_CHILDREN; item.hItem = hti.hItem; (void)TreeView_GetItem(g_pChildWnd->hTreeWnd, &item); /* Set the Expand/Collapse menu item appropriately */ LoadStringW(hInst, (item.state & TVIS_EXPANDED) ? IDS_COLLAPSE : IDS_EXPAND, buffer, COUNT_OF(buffer)); memset(&mii, 0, sizeof(mii)); mii.cbSize = sizeof(mii); mii.fMask = MIIM_STRING | MIIM_STATE | MIIM_ID; mii.fState = (item.cChildren > 0) ? MFS_DEFAULT : MFS_GRAYED; mii.wID = (item.state & TVIS_EXPANDED) ? ID_TREE_COLLAPSEBRANCH : ID_TREE_EXPANDBRANCH; mii.dwTypeData = (LPWSTR) buffer; SetMenuItemInfo(hContextMenu, 0, TRUE, &mii); /* Remove any existing suggestions */ memset(&mii, 0, sizeof(mii)); mii.cbSize = sizeof(mii); mii.fMask = MIIM_ID; GetMenuItemInfo(hContextMenu, GetMenuItemCount(hContextMenu) - 1, TRUE, &mii); if ((mii.wID >= ID_TREE_SUGGESTION_MIN) && (mii.wID <= ID_TREE_SUGGESTION_MAX)) { do { iLastPos = GetMenuItemCount(hContextMenu) - 1; GetMenuItemInfo(hContextMenu, iLastPos, TRUE, &mii); RemoveMenu(hContextMenu, iLastPos, MF_BYPOSITION); } while((mii.wID >= ID_TREE_SUGGESTION_MIN) && (mii.wID <= ID_TREE_SUGGESTION_MAX)); } /* Come up with suggestions */ keyPath = GetItemPath(g_pChildWnd->hTreeWnd, NULL, &hRootKey); SuggestKeys(hRootKey, keyPath, Suggestions, COUNT_OF(Suggestions)); if (Suggestions[0]) { AppendMenu(hContextMenu, MF_SEPARATOR, 0, NULL); LoadStringW(hInst, IDS_GOTO_SUGGESTED_KEY, resource, COUNT_OF(resource)); s = Suggestions; wID = ID_TREE_SUGGESTION_MIN; while(*s && (wID <= ID_TREE_SUGGESTION_MAX)) { _snwprintf(buffer, COUNT_OF(buffer), resource, s); memset(&mii, 0, sizeof(mii)); mii.cbSize = sizeof(mii); mii.fMask = MIIM_STRING | MIIM_ID; mii.wID = wID++; mii.dwTypeData = buffer; InsertMenuItem(hContextMenu, GetMenuItemCount(hContextMenu), TRUE, &mii); s += wcslen(s) + 1; } } TrackPopupMenu(hContextMenu, TPM_RIGHTBUTTON, pt.x, pt.y, 0, g_pChildWnd->hWnd, NULL); } } break; } case WM_SIZE: if (wParam != SIZE_MINIMIZED && g_pChildWnd != NULL) { ResizeWnd(LOWORD(lParam), HIWORD(lParam)); } /* fall through */ default:def: return DefWindowProcW(hWnd, message, wParam, lParam); } return 0;}
开发者ID:RareHare,项目名称:reactos,代码行数:101,
示例25: MonitorSelWndProc//.........这里部分代码省略......... MAKEWPARAM(UIS_INITIALIZE, 0), 0); break; } } Ret |= DLGC_WANTARROWS; if (infoPtr->ControlExStyle & MSLM_EX_SELECTBYNUMKEY) Ret |= DLGC_WANTCHARS; break; } case WM_SETFOCUS: { infoPtr->HasFocus = TRUE; MonSelRepaintSelected(infoPtr); break; } case WM_KILLFOCUS: { infoPtr->HasFocus = FALSE; MonSelCancelDragging(infoPtr); MonSelRepaintSelected(infoPtr); break; } case WM_UPDATEUISTATE: { DWORD OldUIState; Ret = DefWindowProcW(hwnd, uMsg, wParam, lParam); OldUIState = infoPtr->UIState; switch (LOWORD(wParam)) { case UIS_SET: infoPtr->UIState |= HIWORD(wParam); break; case UIS_CLEAR: infoPtr->UIState &= ~HIWORD(wParam); break; } if (infoPtr->UIState != OldUIState) MonSelRepaintSelected(infoPtr); break; } case WM_SETFONT: { Ret = (LRESULT)MonSelChangeFont(infoPtr, (HFONT)wParam, (BOOL)LOWORD(lParam)); break; } case WM_SIZE: { infoPtr->ClientSize.cx = LOWORD(lParam);
开发者ID:Strongc,项目名称:reactos,代码行数:67,
示例26: MyProc//.........这里部分代码省略......... } exit(11); } break; case WM_USER + 10://Repeat图标更新 { bool bReady = g_pDlg->IsIpodConnect(); if(g_pDlg != NULL && bReady) { g_pDlg->UpdataRepeatIcon(ipodctlREPEAT(wParam)); } } break; case WM_USER + 11://Shffle图标跟新 { bool bReady = g_pDlg->IsIpodConnect(); if(g_pDlg != NULL && bReady) { g_pDlg->UpdataShuffleIcon(ipodctlSHUFFLE(wParam)); } } break; case WM_USER + 12: { bool bReady = g_pDlg->IsIpodConnect(); if(g_pDlg != NULL && bReady) { sPlayTime *pPlayTime = (sPlayTime*)(wParam); if(pPlayTime != NULL) { g_pDlg->UpdataPlayingTime(pPlayTime->nPostionTime,pPlayTime->nTotalTime); SAFE_DELETE(pPlayTime); } } } break; case WM_USER + 13: { bool bReady = g_pDlg->IsIpodConnect(); if(g_pDlg != NULL && bReady) { g_pDlg->UpdataSongInfo(wParam); } } break; case WM_USER + 14: { bool bReady = g_pDlg->IsIpodConnect(); if(g_pDlg != NULL && bReady) { g_pDlg->UpdataPlayPauseIcon((ipodctlPLAYSTATUS)wParam); } } break; case WM_USER +15: { IPODDEBEGINFO(L"ShowLoadDataFailed!!!!"); bool bReady = g_pDlg->IsIpodConnect(); if(g_pDlg != NULL && bReady) { g_pDlg->HideIpodPopUP(); } } break; case WM_USER + 16: { IPODDEBEGINFO(L"ShowLoadDataFailed!!!!"); if(g_pDlg != NULL) { g_pDlg->ShowLoadDataFailed(); } } break; case WM_USER + 17: { IPODDEBEGINFO(L"Updata songInfo!!!!"); bool bReady = g_pDlg->IsIpodConnect(); if(g_pDlg != NULL && bReady) { if(wParam != NULL) { sSongInfo *p = (sSongInfo*)wParam; if(p != NULL && s_pSong != NULL) { memcpy(s_pSong,p,sizeof(sSongInfo)); g_pDlg->UpdataTrackInfo(s_pSong); } } } } break; default: { UI_TranslateMsg(message, wParam, lParam, false); } break; } return DefWindowProcW(hWnd, message, wParam, lParam);}
开发者ID:hupeng0605,项目名称:t22,代码行数:101,
示例27: StatusWindowProcstatic LRESULT WINAPIStatusWindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam){ STATUS_INFO *infoPtr = (STATUS_INFO *)GetWindowLongPtrW (hwnd, 0); INT nPart = ((INT) wParam) & 0x00ff; LRESULT res; TRACE("hwnd=%p msg=%x wparam=%lx lparam=%lx/n", hwnd, msg, wParam, lParam); if (!infoPtr && msg != WM_CREATE) return DefWindowProcW (hwnd, msg, wParam, lParam); switch (msg) { case SB_GETBORDERS: return STATUSBAR_GetBorders (infoPtr, (INT *)lParam); case SB_GETICON: return (LRESULT)STATUSBAR_GetIcon (infoPtr, nPart); case SB_GETPARTS: return STATUSBAR_GetParts (infoPtr, (INT)wParam, (INT *)lParam); case SB_GETRECT: return STATUSBAR_GetRect (infoPtr, nPart, (LPRECT)lParam); case SB_GETTEXTA: return STATUSBAR_GetTextA (infoPtr, nPart, (LPSTR)lParam); case SB_GETTEXTW: return STATUSBAR_GetTextW (infoPtr, nPart, (LPWSTR)lParam); case SB_GETTEXTLENGTHA: case SB_GETTEXTLENGTHW: return STATUSBAR_GetTextLength (infoPtr, nPart); case SB_GETTIPTEXTA: return STATUSBAR_GetTipTextA (infoPtr, LOWORD(wParam), (LPSTR)lParam, HIWORD(wParam)); case SB_GETTIPTEXTW: return STATUSBAR_GetTipTextW (infoPtr, LOWORD(wParam), (LPWSTR)lParam, HIWORD(wParam)); case SB_GETUNICODEFORMAT: return infoPtr->bUnicode; case SB_ISSIMPLE: return infoPtr->simple; case SB_SETBORDERS: return STATUSBAR_SetBorders (infoPtr, (INT *)lParam); case SB_SETBKCOLOR: return STATUSBAR_SetBkColor (infoPtr, (COLORREF)lParam); case SB_SETICON: return STATUSBAR_SetIcon (infoPtr, nPart, (HICON)lParam); case SB_SETMINHEIGHT: return STATUSBAR_SetMinHeight (infoPtr, (INT)wParam); case SB_SETPARTS: return STATUSBAR_SetParts (infoPtr, (INT)wParam, (LPINT)lParam); case SB_SETTEXTA: return STATUSBAR_SetTextT (infoPtr, nPart, wParam & 0xff00, (LPWSTR)lParam, FALSE); case SB_SETTEXTW: return STATUSBAR_SetTextT (infoPtr, nPart, wParam & 0xff00, (LPWSTR)lParam, TRUE); case SB_SETTIPTEXTA: return STATUSBAR_SetTipTextA (infoPtr, (INT)wParam, (LPSTR)lParam); case SB_SETTIPTEXTW: return STATUSBAR_SetTipTextW (infoPtr, (INT)wParam, (LPWSTR)lParam); case SB_SETUNICODEFORMAT: return STATUSBAR_SetUnicodeFormat (infoPtr, (BOOL)wParam); case SB_SIMPLE: return STATUSBAR_Simple (infoPtr, (BOOL)wParam); case WM_CREATE: return STATUSBAR_WMCreate (hwnd, (LPCREATESTRUCTA)lParam); case WM_DESTROY: return STATUSBAR_WMDestroy (infoPtr); case WM_GETFONT: return (LRESULT)(infoPtr->hFont? infoPtr->hFont : infoPtr->hDefaultFont); case WM_GETTEXT: return STATUSBAR_WMGetText (infoPtr, (INT)wParam, (LPWSTR)lParam); case WM_GETTEXTLENGTH: return LOWORD(STATUSBAR_GetTextLength (infoPtr, 0)); case WM_LBUTTONDBLCLK: return STATUSBAR_SendMouseNotify(infoPtr, NM_DBLCLK, msg, wParam, lParam); case WM_LBUTTONUP: return STATUSBAR_SendMouseNotify(infoPtr, NM_CLICK, msg, wParam, lParam);//.........这里部分代码省略.........
开发者ID:ccpgames,项目名称:wine,代码行数:101,
示例28: GraphicsWindow_WndProc//.........这里部分代码省略......... * because that's where most other apps seem to do it. */ if( g_bHasFocus && !bHadFocus ) { ChangeDisplaySettings( &g_FullScreenDevMode, CDS_FULLSCREEN ); ShowWindow( g_hWndMain, SW_SHOWNORMAL ); } else if( !g_bHasFocus && bHadFocus ) { ChangeDisplaySettings( NULL, 0 ); } } return 0; } case WM_KILLFOCUS: if( !g_bD3D && !g_CurrentParams.windowed && !g_bRecreatingVideoMode ) ShowWindow( g_hWndMain, SW_SHOWMINNOACTIVE ); break; /* Is there any reason we should care what size the user resizes * the window to? (who? -aj) * Short answer: yes. -aj */ // case WM_GETMINMAXINFO: case WM_SETCURSOR: if( !g_CurrentParams.windowed ) { SetCursor( NULL ); return 1; } break; case WM_SYSCOMMAND: switch( wParam&0xFFF0 ) { case SC_MONITORPOWER: case SC_SCREENSAVE: return 0; } break; case WM_PAINT: { PAINTSTRUCT ps; BeginPaint( hWnd, &ps ); EndPaint( hWnd, &ps ); break; } case WM_KEYDOWN: case WM_KEYUP: case WM_SYSKEYDOWN: case WM_SYSKEYUP: case WM_MOUSEWHEEL: // might want to use this for GET_WHEEL_DELTA_WPARAM(wParam) -aj // We handle all input ourself, via DirectInput. return 0; case WM_CLOSE: LOG->Trace("WM_CLOSE: shutting down"); ArchHooks::SetUserQuit(); return 0; case WM_WINDOWPOSCHANGED: { /* If we're fullscreen and don't have focus, our window is hidden, * so GetClientRect isn't meaningful. */ if( !g_CurrentParams.windowed && !g_bHasFocus ) break; RECT rect; GetClientRect( hWnd, &rect ); int iWidth = rect.right - rect.left; int iHeight = rect.bottom - rect.top; if( g_CurrentParams.width != iWidth || g_CurrentParams.height != iHeight ) { g_CurrentParams.width = iWidth; g_CurrentParams.height = iHeight; g_bResolutionChanged = true; } break; } case WM_COPYDATA: { PCOPYDATASTRUCT pMyCDS = (PCOPYDATASTRUCT) lParam; RString sCommandLine( (char*)pMyCDS->lpData, pMyCDS->cbData ); CommandLineActions::CommandLineArgs args; split( sCommandLine, "|", args.argv, false ); CommandLineActions::ToProcess.push_back( args ); break; } } CHECKPOINT_M( ssprintf("%p, %u, %08x, %08x", hWnd, msg, wParam, lParam) ); if( m_bWideWindowClass ) return DefWindowProcW( hWnd, msg, wParam, lParam ); else return DefWindowProcA( hWnd, msg, wParam, lParam );}
开发者ID:AratnitY,项目名称:stepmania,代码行数:101,
注:本文中的DefWindowProcW函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ Default函数代码示例 C++ DefWindowProcA函数代码示例 |