这篇教程C++ GetMessageTime函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中GetMessageTime函数的典型用法代码示例。如果您正苦于以下问题:C++ GetMessageTime函数的具体用法?C++ GetMessageTime怎么用?C++ GetMessageTime使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了GetMessageTime函数的27个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: GetWnd// Left buttonvoid CMouse::InternalOnLButtonDown(UINT nFlags, const CPoint& point){ GetWnd().SetFocus(); m_bLeftDown = false; SetCursor(nFlags, point); if (MVRDown(nFlags, point)) { return; } bool bIsOnFS = IsOnFullscreenWindow(); if ((!m_bD3DFS || !bIsOnFS) && (abs(GetMessageTime() - m_popupMenuUninitTime) < 2)) { return; } if (m_pMainFrame->GetLoadState() == MLS::LOADED && m_pMainFrame->GetPlaybackMode() == PM_DVD && (m_pMainFrame->IsD3DFullScreenMode() ^ m_bD3DFS) == 0 && (m_pMainFrame->m_pDVDC->ActivateAtPosition(GetVideoPoint(point)) == S_OK)) { return; } if (m_bD3DFS && bIsOnFS && m_pMainFrame->m_OSD.OnLButtonDown(nFlags, point)) { return; } m_bLeftDown = true; bool bDouble = false; if (m_bLeftDoubleStarted && GetMessageTime() - m_leftDoubleStartTime < (int)GetDoubleClickTime() && CMouse::PointEqualsImprecise(m_leftDoubleStartPoint, point)) { m_bLeftDoubleStarted = false; bDouble = true; } else { m_bLeftDoubleStarted = true; m_leftDoubleStartTime = GetMessageTime(); m_leftDoubleStartPoint = point; } auto onButton = [&]() { GetWnd().SetCapture(); bool ret = false; if (bIsOnFS || !m_pMainFrame->IsCaptionHidden()) { ret = OnButton(wmcmd::LDOWN, point, bIsOnFS); } if (bDouble) { ret = OnButton(wmcmd::LDBLCLK, point, bIsOnFS) || ret; } if (!ret) { ReleaseCapture(); } return ret; }; m_drag = (!onButton() && !bIsOnFS) ? Drag::BEGIN_DRAG : Drag::NO_DRAG; if (m_drag == Drag::BEGIN_DRAG) { GetWnd().SetCapture(); m_beginDragPoint = point; GetWnd().ClientToScreen(&m_beginDragPoint); }}
开发者ID:Armada651,项目名称:mpc-hc,代码行数:54,
示例2: process_button_releasedstatic void process_button_released(MSLLHOOKSTRUCT *mshook, uint16_t button) { // Populate mouse released event. event.time = GetMessageTime(); event.reserved = 0x00; event.type = EVENT_MOUSE_RELEASED; event.mask = get_modifiers(); event.data.mouse.button = button; event.data.mouse.clicks = click_count; event.data.mouse.x = mshook->pt.x; event.data.mouse.y = mshook->pt.y; logger(LOG_LEVEL_INFO, "%s [%u]: Button %u released %u time(s). (%u, %u)/n", __FUNCTION__, __LINE__, event.data.mouse.button, event.data.mouse.clicks, event.data.mouse.x, event.data.mouse.y); // Fire mouse released event. dispatch_event(&event); // If the pressed event was not consumed... if (event.reserved ^ 0x01 && last_click.x == mshook->pt.x && last_click.y == mshook->pt.y) { // Populate mouse clicked event. event.time = GetMessageTime(); event.reserved = 0x00; event.type = EVENT_MOUSE_CLICKED; event.mask = get_modifiers(); event.data.mouse.button = button; event.data.mouse.clicks = click_count; event.data.mouse.x = mshook->pt.x; event.data.mouse.y = mshook->pt.y; logger(LOG_LEVEL_INFO, "%s [%u]: Button %u clicked %u time(s). (%u, %u)/n", __FUNCTION__, __LINE__, event.data.mouse.button, event.data.mouse.clicks, event.data.mouse.x, event.data.mouse.y); // Fire mouse clicked event. dispatch_event(&event); } // Reset the number of clicks. if (button == click_button && (long int) (event.time - click_time) > hook_get_multi_click_time()) { // Reset the click count. click_count = 0; }}
开发者ID:InspectorWidget,项目名称:libuiohook,代码行数:50,
示例3: VERIFYvoid CMouse::EventCallback(MpcEvent ev){ CPoint screenPoint; VERIFY(GetCursorPos(&screenPoint)); switch (ev) { case MpcEvent::SWITCHED_TO_FULLSCREEN: case MpcEvent::SWITCHED_TO_FULLSCREEN_D3D: m_switchingToFullscreen.first = false; break; case MpcEvent::SWITCHING_TO_FULLSCREEN: case MpcEvent::SWITCHING_TO_FULLSCREEN_D3D: m_switchingToFullscreen = std::make_pair(true, screenPoint); // no break case MpcEvent::MEDIA_LOADED: if (CursorOnWindow(screenPoint, GetWnd())) { SetCursor(screenPoint); } break; case MpcEvent::CONTEXT_MENU_POPUP_UNINITIALIZED: m_popupMenuUninitTime = GetMessageTime(); break; case MpcEvent::SYSTEM_MENU_POPUP_INITIALIZED: if (!GetCapture() && CursorOnWindow(screenPoint, GetWnd())) { ::SetCursor(m_cursors[Cursor::ARROW]); } break; default: ASSERT(FALSE); }}
开发者ID:Armada651,项目名称:mpc-hc,代码行数:30,
示例4: win_mouse_clickvoidwin_mouse_click(mouse_button b, LPARAM lp){ static mouse_button last_button; static uint last_time, count; static pos last_click_pos; win_show_mouse(); if (tab_bar_click(lp)) return; mod_keys mods = get_mods(); pos p = get_mouse_pos(lp); uint t = GetMessageTime(); if (b != last_button || p.x != last_click_pos.x || p.y != last_click_pos.y || t - last_time > GetDoubleClickTime() || ++count > 3) count = 1; term_mouse_click(win_active_terminal(), b, mods, p, count); last_pos = (pos){INT_MIN, INT_MIN}; last_click_pos = p; last_time = t; last_button = b; if (alt_state > ALT_NONE) alt_state = ALT_CANCELLED;}
开发者ID:panos--,项目名称:fatty,代码行数:26,
示例5: win_mouse_clickvoidwin_mouse_click(mouse_button b, LPARAM lp){ static mouse_button last_button; static uint last_time, count; static pos last_click_pos; win_show_mouse(); mod_keys mods = get_mods(); pos p = get_mouse_pos(lp); uint t = GetMessageTime(); if (b != last_button || p.x != last_click_pos.x || p.y != last_click_pos.y || t - last_time > GetDoubleClickTime() || ++count > 3) count = 1; SetFocus(wnd); // in case focus was in search bar term_mouse_click(b, mods, p, count); last_pos = (pos){INT_MIN, INT_MIN}; last_click_pos = p; last_time = t; last_button = b; if (alt_state > ALT_NONE) alt_state = ALT_CANCELLED;}
开发者ID:Jactry,项目名称:mintty,代码行数:26,
示例6: GetMessageTimebool WinAltGrMonitor::isCurrentEventDefinitelyFake(unsigned iDownScanCode, bool fKeyDown, bool fExtendedKey) const{ MSG peekMsg; LONG messageTime = GetMessageTime(); if ( iDownScanCode != 0x1d /* scan code: Control */ || fExtendedKey) return false; if (!PeekMessage(&peekMsg, NULL, WM_KEYFIRST, WM_KEYLAST, PM_NOREMOVE)) return false; if (messageTime != peekMsg.time) return false; if ( fKeyDown && (peekMsg.message != WM_KEYDOWN && peekMsg.message != WM_SYSKEYDOWN)) return false; if ( !fKeyDown && (peekMsg.message != WM_KEYUP && peekMsg.message != WM_SYSKEYUP)) return false; if ( ((RT_HIWORD(peekMsg.lParam) & 0xFF) != 0x38 /* scan code: Alt */) || !(RT_HIWORD(peekMsg.lParam) & KF_EXTENDED)) return false; if (!doesCurrentLayoutHaveAltGr()) return false; return true;}
开发者ID:bayasist,项目名称:vbox,代码行数:27,
示例7: BytesRandomDdouble BytesRandomD(){ BYTE Buffer[0x464]; SHA_CTX Context; int idx; idx = 0; memcpy(Buffer, RandomSeed, SHA_DIGEST_LENGTH); idx += sizeof(RandomSeed); GlobalMemoryStatus((LPMEMORYSTATUS)&Buffer[idx]); idx += sizeof(MEMORYSTATUS); UuidCreate((UUID *)&Buffer[idx]); idx += sizeof(UUID); GetCursorPos((LPPOINT)&Buffer[idx]); idx += sizeof(POINT); *(DWORD *)(Buffer + idx) = GetTickCount(); *(DWORD *)(Buffer + idx + 4) = GetMessageTime(); *(DWORD *)(Buffer + idx + 8) = GetCurrentThreadId(); *(DWORD *)(Buffer + idx + 12) = GetCurrentProcessId(); idx += 16; QueryPerformanceCounter((LARGE_INTEGER *)&Buffer[idx]); SHA1_Init(&Context); SHA1_Update(&Context, Buffer, 0x464); SHA1_Update(&Context, "additional salt...", 0x13); SHA1_Final(RandomSeed, &Context); return BytesSHA1d(Buffer, 0x464);}
开发者ID:DaemonOverlord,项目名称:Skype,代码行数:27,
示例8: GetMessageTimeWebKeyboardEvent WebInputEventFactory::keyboardEvent(HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam){ WebKeyboardEvent result; // TODO(pkasting): http://b/1117926 Are we guaranteed that the message that // GetMessageTime() refers to is the same one that we're passed in? Perhaps // one of the construction parameters should be the time passed by the // caller, who would know for sure. result.timeStampSeconds = GetMessageTime() / 1000.0; result.windowsKeyCode = result.nativeKeyCode = static_cast<int>(wparam); switch (message) { case WM_SYSKEYDOWN: result.isSystemKey = true; case WM_KEYDOWN: result.type = WebInputEvent::RawKeyDown; break; case WM_SYSKEYUP: result.isSystemKey = true; case WM_KEYUP: result.type = WebInputEvent::KeyUp; break; case WM_IME_CHAR: result.type = WebInputEvent::Char; break; case WM_SYSCHAR: result.isSystemKey = true; result.type = WebInputEvent::Char; case WM_CHAR: result.type = WebInputEvent::Char; break; default: ASSERT_NOT_REACHED(); } if (result.type == WebInputEvent::Char || result.type == WebInputEvent::RawKeyDown) { result.text[0] = result.windowsKeyCode; result.unmodifiedText[0] = result.windowsKeyCode; } if (result.type != WebInputEvent::Char) result.setKeyIdentifierFromWindowsKeyCode(); if (GetKeyState(VK_SHIFT) & 0x8000) result.modifiers |= WebInputEvent::ShiftKey; if (GetKeyState(VK_CONTROL) & 0x8000) result.modifiers |= WebInputEvent::ControlKey; if (GetKeyState(VK_MENU) & 0x8000) result.modifiers |= WebInputEvent::AltKey; // NOTE: There doesn't seem to be a way to query the mouse button state in // this case. if (LOWORD(lparam) > 1) result.modifiers |= WebInputEvent::IsAutoRepeat; if (isKeyPad(wparam, lparam)) result.modifiers |= WebInputEvent::IsKeyPad; return result;}
开发者ID:325116067,项目名称:semc-qsd8x50,代码行数:60,
示例9: MDIWndProc/* MDIWndProc*/LRESULT CALLBACK MDIWndProc( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam){ HANDLE hInfo; PINFO pInfo; MSG msg; EventRecord macEvent; LONG thePoints = GetMessagePos(); PAINTSTRUCT ps; msg.hwnd = hwnd; msg.message = message; msg.wParam = wParam; msg.lParam = lParam; msg.time = GetMessageTime(); msg.pt.x = LOWORD(thePoints); msg.pt.y = HIWORD(thePoints); WinEventToMacEvent(&msg, &macEvent); switch (message) { case WM_CREATE: case WM_MDICREATE: break; case WM_DESTROY: hInfo = (HANDLE)GetWindowLong(hwnd, GWL_USERDATA); if (hInfo) { if ((pInfo = (PINFO)LocalLock(hInfo)) != NULL){ if (pInfo->gi) // close the graphic import component CloseComponent(pInfo->gi); // Destroy our port association DestroyPortAssociation((CGrafPort *)GetHWNDPort(pInfo->hwndChildWindow)); } LocalUnlock(hInfo); } break; // Draw our graphic case WM_PAINT: BeginPaint(hwnd, &ps); hInfo = (HANDLE)GetWindowLong(hwnd, GWL_USERDATA); if (hInfo) { if ((pInfo = (PINFO)LocalLock(hInfo)) != NULL) GraphicsImportDraw(pInfo->gi); LocalUnlock(hInfo); } EndPaint(hwnd, &ps); break; default: return DefMDIChildProc(hwnd, message, wParam, lParam); } return DefMDIChildProc(hwnd, message, wParam, lParam);}
开发者ID:fruitsamples,项目名称:graphicimporter.win,代码行数:62,
示例10: GetMessageTimevoid MsgBubbleItem::SetShowTime(bool show){ if(show) { std::wstring tm = GetMessageTime(msg_.timetag_, false); msg_time_->SetText(tm); } msg_time_->SetVisible(show);}
开发者ID:binson001,项目名称:NIM_PC_UIKit,代码行数:9,
示例11: translate_posstatic postranslate_pos(int x, int y){ return (pos){ .x = floorf((x - PADDING) / (float)font_width ), .y = floorf((y - PADDING) / (float)font_height), };}static posget_mouse_pos(LPARAM lp){ return translate_pos(GET_X_LPARAM(lp), GET_Y_LPARAM(lp)); }static mouse_button clicked_button;static pos last_pos;voidwin_mouse_click(mouse_button b, LPARAM lp){ static mouse_button last_button; static uint last_time, count; static pos last_click_pos; win_show_mouse(); mod_keys mods = get_mods(); pos p = get_mouse_pos(lp); if (clicked_button) { term_mouse_release(b, mods, p); clicked_button = 0; } uint t = GetMessageTime(); if (b != last_button || p.x != last_click_pos.x || p.y != last_click_pos.y || t - last_time > GetDoubleClickTime() || ++count > 3) count = 1; term_mouse_click(b, mods, p, count); last_pos = last_click_pos = p; last_time = t; clicked_button = last_button = b; if (alt_state > ALT_NONE) alt_state = ALT_CANCELLED;}voidwin_mouse_release(mouse_button b, LPARAM lp){ win_show_mouse(); if (b == clicked_button) { term_mouse_release(b, get_mods(), get_mouse_pos(lp)); clicked_button = 0; ReleaseCapture(); }}
开发者ID:B-Rich,项目名称:mintty,代码行数:57,
示例12: fastPollvoid fastPoll( void ) { RANDOM_STATE randomState; BYTE buffer[ RANDOM_BUFSIZE ]; SYSHEAPINFO sysHeapInfo; MEMMANINFO memManInfo; TIMERINFO timerInfo; POINT point; initRandomData( randomState, buffer, RANDOM_BUFSIZE ); /* Get various basic pieces of system information: Handle of the window with mouse capture, handle of window with input focus, amount of space in global heap, whether system queue has any events, cursor position for last message, 55 ms time for last message, number of active tasks, 55 ms time since Windows started, current mouse cursor position, current caret position */ addRandomValue( randomState, GetCapture() ); addRandomValue( randomState, GetFocus() ); addRandomValue( randomState, GetFreeSpace( 0 ) ); addRandomValue( randomState, GetInputState() ); addRandomValue( randomState, GetMessagePos() ); addRandomValue( randomState, GetMessageTime() ); addRandomValue( randomState, GetNumTasks() ); addRandomValue( randomState, GetTickCount() ); GetCursorPos( &point ); addRandomData( randomState, &point, sizeof( POINT ) ); GetCaretPos( &point ); addRandomData( randomState, &point, sizeof( POINT ) ); /* Get the largest free memory block, number of lockable pages, number of unlocked pages, number of free and used pages, and number of swapped pages */ memManInfo.dwSize = sizeof( MEMMANINFO ); MemManInfo( &memManInfo ); addRandomData( randomState, &memManInfo, sizeof( MEMMANINFO ) ); /* Get the execution times of the current task and VM to approximately 1ms resolution */ timerInfo.dwSize = sizeof( TIMERINFO ); TimerCount( &timerInfo ); addRandomData( randomState, &timerInfo, sizeof( TIMERINFO ) ); /* Get the percentage free and segment of the user and GDI heap */ sysHeapInfo.dwSize = sizeof( SYSHEAPINFO ); SystemHeapInfo( &sysHeapInfo ); addRandomData( randomState, &sysHeapInfo, sizeof( SYSHEAPINFO ) ); /* Flush any remaining data through */ endRandomData( randomState, 25 ); }
开发者ID:VlaBst6,项目名称:cryptlib-history,代码行数:51,
示例13: hook_stop_procvoid hook_stop_proc() { // Get the local system time in UNIX epoch form. uint64_t timestamp = GetMessageTime(); // Populate the hook stop event. event.time = timestamp; event.reserved = 0x00; event.type = EVENT_HOOK_DISABLED; event.mask = 0x00; // Fire the hook stop event. dispatch_event(&event);}
开发者ID:InspectorWidget,项目名称:libuiohook,代码行数:14,
示例14: RelayEventLRESULT RelayEvent(HWND hwnd, UINT uMsg, int x, int y){ MSG msg; DWORD pos = GetMessagePos(); msg.hwnd = hwnd; msg.message = uMsg; msg.time = GetMessageTime(); msg.wParam = 0; msg.lParam = MAKELPARAM(x, y);//GetMessagePos(); msg.pt.x = x;//(short)LOWORD(pos);//msg.lParam); msg.pt.y = y;//(short)HIWORD(pos);//msg.lParam); return SendMessage(hwnd, TTM_RELAYEVENT, 0, (LPARAM)&msg);}
开发者ID:4aiman,项目名称:HexEdit,代码行数:15,
示例15: process_button_pressedstatic void process_button_pressed(MSLLHOOKSTRUCT *mshook, uint16_t button) { uint64_t timestamp = GetMessageTime(); // Track the number of clicks, the button must match the previous button. if (button == click_button && (long int) (timestamp - click_time) <= hook_get_multi_click_time()) { if (click_count < USHRT_MAX) { click_count++; } else { logger(LOG_LEVEL_WARN, "%s [%u]: Click count overflow detected!/n", __FUNCTION__, __LINE__); } } else { // Reset the click count. click_count = 1; // Set the previous button. click_button = button; } // Save this events time to calculate the click_count. click_time = timestamp; // Store the last click point. last_click.x = mshook->pt.x; last_click.y = mshook->pt.y; // Populate mouse pressed event. event.time = timestamp; event.reserved = 0x00; event.type = EVENT_MOUSE_PRESSED; event.mask = get_modifiers(); event.data.mouse.button = button; event.data.mouse.clicks = click_count; event.data.mouse.x = mshook->pt.x; event.data.mouse.y = mshook->pt.y; logger(LOG_LEVEL_INFO, "%s [%u]: Button %u pressed %u time(s). (%u, %u)/n", __FUNCTION__, __LINE__, event.data.mouse.button, event.data.mouse.clicks, event.data.mouse.x, event.data.mouse.y); // Fire mouse pressed event. dispatch_event(&event);}
开发者ID:InspectorWidget,项目名称:libuiohook,代码行数:48,
示例16: translateKey// Translates a Windows key to the corresponding GLFW key//static int translateKey(WPARAM wParam, LPARAM lParam){ if (wParam == VK_CONTROL) { // The CTRL keys require special handling MSG next; DWORD time; // Is this an extended key (i.e. right key)? if (lParam & 0x01000000) return GLFW_KEY_RIGHT_CONTROL; // Here is a trick: "Alt Gr" sends LCTRL, then RALT. We only // want the RALT message, so we try to see if the next message // is a RALT message. In that case, this is a false LCTRL! time = GetMessageTime(); if (PeekMessageW(&next, NULL, 0, 0, PM_NOREMOVE)) { if (next.message == WM_KEYDOWN || next.message == WM_SYSKEYDOWN || next.message == WM_KEYUP || next.message == WM_SYSKEYUP) { if (next.wParam == VK_MENU && (next.lParam & 0x01000000) && next.time == time) { // Next message is a RALT down message, which // means that this is not a proper LCTRL message return _GLFW_KEY_INVALID; } } } return GLFW_KEY_LEFT_CONTROL; } if (wParam == VK_PROCESSKEY) { // IME notifies that keys have been filtered by setting the virtual // key-code to VK_PROCESSKEY return _GLFW_KEY_INVALID; } return _glfw.win32.keycodes[HIWORD(lParam) & 0x1FF];}
开发者ID:kypp,项目名称:glfw,代码行数:50,
示例17: CommonCtorCMessage::CMessage(HWND hwndIn, UINT msg, WPARAM wParamIn, LPARAM lParamIn){ CommonCtor(); hwnd = hwndIn; message = msg; wParam = wParamIn; lParam = lParamIn; htc = HTC_YES; time = GetMessageTime(); DWORD dw = GetMessagePos(); MSG::pt.x = (short)LOWORD(dw); MSG::pt.y = (short)HIWORD(dw); Assert(!fEventsFired); Assert(!fSelectionHMCalled);}
开发者ID:hufuman,项目名称:xindows,代码行数:16,
示例18: processMouseEventstatic voidprocessMouseEvent(PuglView* view, int button, bool press, LPARAM lParam){ view->event_timestamp_ms = GetMessageTime(); if (press) { SetCapture(view->impl->hwnd); } else { ReleaseCapture(); } if (view->mouseFunc) { view->mouseFunc(view, button, press, GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)); }}
开发者ID:EQ4,项目名称:openAV-Fabla2,代码行数:16,
示例19: STATUSBAR_Relay2Tipstatic LRESULTSTATUSBAR_Relay2Tip (const STATUS_INFO *infoPtr, UINT uMsg, WPARAM wParam, LPARAM lParam){ MSG msg; msg.hwnd = infoPtr->Self; msg.message = uMsg; msg.wParam = wParam; msg.lParam = lParam; msg.time = GetMessageTime (); msg.pt.x = (short)LOWORD(GetMessagePos ()); msg.pt.y = (short)HIWORD(GetMessagePos ()); return SendMessageW (infoPtr->hwndToolTip, TTM_RELAYEVENT, 0, (LPARAM)&msg);}
开发者ID:ccpgames,项目名称:wine,代码行数:16,
示例20: _clutter_stage_win32_window_procLRESULT CALLBACK_clutter_stage_win32_window_proc (HWND hwnd, UINT umsg, WPARAM wparam, LPARAM lparam){ ClutterStageWin32 *stage_win32 = (ClutterStageWin32 *) GetWindowLongPtrW (hwnd, 0); gboolean call_def_window_proc = TRUE; /* Ignore any messages before SetWindowLongPtr has been called to set the stage */ if (stage_win32 != NULL) { ClutterBackendWin32 *backend_win32 = stage_win32->backend; MSG msg; ClutterEvent *event; ClutterMainContext *clutter_context; DWORD message_pos = GetMessagePos (); clutter_context = clutter_context_get_default (); msg.hwnd = hwnd; msg.message = umsg; msg.wParam = wparam; msg.lParam = lparam; msg.time = GetMessageTime (); /* Neither MAKE_POINTS nor GET_[XY]_LPARAM is defined in MinGW headers so we need to convert to a signed type explicitly */ msg.pt.x = (SHORT) LOWORD (message_pos); msg.pt.y = (SHORT) HIWORD (message_pos); event = clutter_event_new (CLUTTER_NOTHING); if (message_translate (CLUTTER_BACKEND (backend_win32), event, &msg, &call_def_window_proc)) /* push directly here to avoid copy of queue_put */ g_queue_push_head (clutter_context->events_queue, event); else clutter_event_free (event); } if (call_def_window_proc) return DefWindowProcW (hwnd, umsg, wparam, lparam); else return 0;}
开发者ID:archlinuxarm-n900,项目名称:clutter08,代码行数:45,
示例21: html_key_msgstatic voidhtml_key_msg(html_t* html, UINT msg, WPARAM wp, LPARAM lp){ DWORD pos; MSG message; IWebBrowser2* browser_iface; IOleInPlaceActiveObject* active_iface; HRESULT hr; pos = GetMessagePos(); /* Setup the message structure */ message.hwnd = html->ie_win; message.message = msg; message.wParam = wp; message.lParam = lp; message.time = GetMessageTime(); message.pt.x = GET_X_LPARAM(pos); message.pt.y = GET_Y_LPARAM(pos); /* ->TranslateAccelerator() */ hr = html->browser_obj->lpVtbl->QueryInterface(html->browser_obj, &IID_IWebBrowser2, (void**)&browser_iface); if(MC_ERR(hr != S_OK || browser_iface == NULL)) { MC_TRACE("html_key_msg: " "QueryInterface(IID_IWebBrowser2) failed [0x%lx]", hr); goto err_browser; } hr = browser_iface->lpVtbl->QueryInterface(browser_iface, &IID_IOleInPlaceActiveObject, (void**)&active_iface); if(MC_ERR(hr != S_OK || active_iface == NULL)) { MC_TRACE("html_key_msg: " "QueryInterface(IID_IOleInPlaceActiveObject) failed [0x%lx]", hr); goto err_active; } active_iface->lpVtbl->TranslateAccelerator(active_iface, &message); /* Cleanup */ active_iface->lpVtbl->Release(active_iface);err_active: browser_iface->lpVtbl->Release(browser_iface);err_browser: ; /* noop */}
开发者ID:ArmstrongJ,项目名称:mctrl,代码行数:44,
示例22: TooltipOnMouseEventvoid TooltipOnMouseEvent(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam){ MSG msg; switch(dwTooltipTypeCur) { case TOOLTIPTYPE_NORMAL: case TOOLTIPTYPE_BALLOON: msg.hwnd = hwnd; msg.message = message; msg.wParam = wParam; msg.lParam = lParam; msg.time = GetMessageTime(); msg.pt.x = GET_X_LPARAM(GetMessagePos()); msg.pt.y = GET_Y_LPARAM(GetMessagePos()); if(hwndTooltip) SendMessage(hwndTooltip, TTM_RELAYEVENT, 0, (LPARAM)&msg); break; }}
开发者ID:h16o2u9u,项目名称:rtoss,代码行数:19,
示例23: TranslateKeystatic sht::PublicKey TranslateKey(WPARAM wParam, LPARAM lParam){ if (wParam == VK_CONTROL) { // The CTRL keys require special handling MSG next; DWORD time; // Is this an extended key (i.e. right key)? if (lParam & 0x01000000) return sht::PublicKey::kRightControl; // Here is a trick: "Alt Gr" sends LCTRL, then RALT. We only // want the RALT message, so we try to see if the next message // is a RALT message. In that case, this is a false LCTRL! time = GetMessageTime(); if (PeekMessageW(&next, NULL, 0, 0, PM_NOREMOVE)) { if (next.message == WM_KEYDOWN || next.message == WM_SYSKEYDOWN || next.message == WM_KEYUP || next.message == WM_SYSKEYUP) { if (next.wParam == VK_MENU && (next.lParam & 0x01000000) && next.time == time) { // Next message is a RALT down message, which // means that this is not a proper LCTRL message return sht::PublicKey::kUnknown; } } } return sht::PublicKey::kLeftControl; } sht::Application * app = sht::Application::GetInstance(); return app->keys().table(HIWORD(lParam) & 0x1FF);}
开发者ID:Shtille,项目名称:ShtilleEngine,代码行数:42,
示例24: lwjglWindowProc/* * WindowProc for the GL window. */static LRESULT CALLBACK lwjglWindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam){ jclass display_class; jclass display_class_global; jmethodID handleMessage_method; LONG message_time; JNIEnv *env = getThreadEnv(); if (env != NULL && !(*env)->ExceptionOccurred(env)) { /* * We'll cache a global reference to the WindowsDisplay class in the window's user data. * This is not so much to avoid lookup overhead as it is to avoid problems * with AWT. Specifically, awt code can indirectly call this message handler * when it does a SendMessage on the main thread to the currently focused window, * which could be a LWJGL window. The FindClass will then fail because the calling * internal awt class is using the system class loader, not the application loader * where lwjgl is found. * * The very first message sent to this handler is sent when * a window is created, where we are sure that the calling class' classloader has * LWJGL classes in it. */ display_class_global = (jclass)(LONG_PTR)GetWindowLongPtr(hWnd, GWLP_USERDATA); if (display_class_global == NULL) { display_class = (*env)->FindClass(env, "org/lwjgl/opengl/WindowsDisplay"); if (display_class != NULL) { display_class_global = (*env)->NewGlobalRef(env, display_class); if (display_class_global != NULL) SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG_PTR)display_class_global); } } if (display_class_global != NULL) { message_time = GetMessageTime(); handleMessage_method = (*env)->GetStaticMethodID(env, display_class_global, "handleMessage", "(JIJJJ)I"); if (handleMessage_method != NULL) return (*env)->CallStaticIntMethod(env, display_class_global, handleMessage_method, (jlong)(intptr_t)hWnd, (jint)msg, (jlong)wParam, (jlong)lParam, (jlong)message_time); } } return DefWindowProc(hWnd, msg, wParam, lParam);}
开发者ID:CobaltBlues,项目名称:lwjgl,代码行数:45,
示例25: process_mouse_movedstatic void process_mouse_moved(MSLLHOOKSTRUCT *mshook) { uint64_t timestamp = GetMessageTime(); // We received a mouse move event with the mouse actually moving. // This verifies that the mouse was moved after being depressed. if (last_click.x != mshook->pt.x || last_click.y != mshook->pt.y) { // Reset the click count. if (click_count != 0 && (long) (timestamp - click_time) > hook_get_multi_click_time()) { click_count = 0; } // Populate mouse move event. event.time = timestamp; event.reserved = 0x00; event.mask = get_modifiers(); // Check the modifier mask range for MASK_BUTTON1 - 5. bool mouse_dragged = event.mask & (MASK_BUTTON1 | MASK_BUTTON2 | MASK_BUTTON3 | MASK_BUTTON4 | MASK_BUTTON5); if (mouse_dragged) { // Create Mouse Dragged event. event.type = EVENT_MOUSE_DRAGGED; } else { // Create a Mouse Moved event. event.type = EVENT_MOUSE_MOVED; } event.data.mouse.button = MOUSE_NOBUTTON; event.data.mouse.clicks = click_count; event.data.mouse.x = mshook->pt.x; event.data.mouse.y = mshook->pt.y; logger(LOG_LEVEL_INFO, "%s [%u]: Mouse %s to %u, %u./n", __FUNCTION__, __LINE__, mouse_dragged ? "dragged" : "moved", event.data.mouse.x, event.data.mouse.y); // Fire mouse move event. dispatch_event(&event); }}
开发者ID:InspectorWidget,项目名称:libuiohook,代码行数:41,
示例26: process_mouse_wheelstatic void process_mouse_wheel(MSLLHOOKSTRUCT *mshook, uint8_t direction) { // Track the number of clicks. // Reset the click count and previous button. click_count = 1; click_button = MOUSE_NOBUTTON; // Populate mouse wheel event. event.time = GetMessageTime(); event.reserved = 0x00; event.type = EVENT_MOUSE_WHEEL; event.mask = get_modifiers(); event.data.wheel.clicks = click_count; event.data.wheel.x = mshook->pt.x; event.data.wheel.y = mshook->pt.y; event.data.wheel.type = get_scroll_wheel_type(); event.data.wheel.amount = get_scroll_wheel_amount(); /* Delta HIWORD(mshook->mouseData) * A positive value indicates that the wheel was rotated * forward, away from the user; a negative value indicates that * the wheel was rotated backward, toward the user. One wheel * click is defined as WHEEL_DELTA, which is 120. */ event.data.wheel.rotation = ((int16_t) HIWORD(mshook->mouseData) / WHEEL_DELTA) * -1; // Set the direction based on what event was received. event.data.wheel.direction = direction; logger(LOG_LEVEL_INFO, "%s [%u]: Mouse wheel type %u, rotated %i units in the %u direction at %u, %u./n", __FUNCTION__, __LINE__, event.data.wheel.type, event.data.wheel.amount * event.data.wheel.rotation, event.data.wheel.direction, event.data.wheel.x, event.data.wheel.y); // Fire mouse wheel event. dispatch_event(&event);}
开发者ID:InspectorWidget,项目名称:libuiohook,代码行数:39,
示例27: _clutter_stage_win32_window_procLRESULT CALLBACK_clutter_stage_win32_window_proc (HWND hwnd, UINT umsg, WPARAM wparam, LPARAM lparam){ gboolean message_handled = FALSE; /* Windows sends some messages such as WM_GETMINMAXINFO and WM_CREATE before returning from CreateWindow. The stage point will not yet be stored in the Window structure in this case so we need to skip these messages because we can't know which stage the window belongs to */ if (GetWindowLongPtrW (hwnd, 0)) { MSG msg; DWORD message_pos = GetMessagePos (); /* Convert the parameters to a MSG struct */ msg.hwnd = hwnd; msg.message = umsg; msg.wParam = wparam; msg.lParam = lparam; msg.time = GetMessageTime (); /* Neither MAKE_POINTS nor GET_[XY]_LPARAM is defined in MinGW headers so we need to convert to a signed type explicitly */ msg.pt.x = (SHORT) LOWORD (message_pos); msg.pt.y = (SHORT) HIWORD (message_pos); /* Process the message */ message_handled = clutter_win32_handle_event (&msg); } if (!message_handled) return DefWindowProcW (hwnd, umsg, wparam, lparam); else return 0;}
开发者ID:nobled,项目名称:clutter,代码行数:36,
注:本文中的GetMessageTime函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ GetMessageType函数代码示例 C++ GetMessagePos函数代码示例 |