这篇教程C++ GetCapture函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中GetCapture函数的典型用法代码示例。如果您正苦于以下问题:C++ GetCapture函数的具体用法?C++ GetCapture怎么用?C++ GetCapture使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了GetCapture函数的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: OnLButtonUpvoid CMDIView::OnLButtonUp(UINT nFlags, CPoint point){ if(this == GetCapture()) ReleaseCapture(); // Stop capturing mouse messages // Make sure there is an element if(m_pTempElement) { // Add the element pointer to the sketch GetDocument()->AddElement(m_pTempElement); InvalidateRect(&m_pTempElement->GetEnclosingRect()); m_pTempElement.reset(); // Reset the element pointer }}
开发者ID:Jyang772,项目名称:MDI,代码行数:14,
示例2: InternalDialogintInternalDialog(HWND hDlg){ HWND hWnd,hWndFocus,hWndCapture; int rc = 0; MSG msg; if(hDlg == 0) return 0; hWnd = GetWindowWord(hDlg,DWW_PARENT); if ((hWndCapture = GetCapture())) ReleaseCapture(); while (IsWindow(hDlg) && (GetWindowWord(hDlg,DWW_STATUS) == 0)) { if(GetMessage(&msg, (HWND)0, 0, 0)) { if (msg.message == WM_CLOSE) { DispatchMessage (&msg) ; break; } if(IsDialogMessage(hDlg,&msg)) continue; TranslateMessage (&msg) ; DispatchMessage (&msg) ; } if (hWnd) { /* if there is an owner */ if (!PeekMessage(&msg,hDlg,0,0,PM_NOREMOVE)) SendMessage(hWnd,WM_ENTERIDLE,MSGF_DIALOGBOX,(LPARAM)hDlg); } } if (IsWindow(hDlg)) { rc = GetWindowWord(hDlg,DWW_RESULT); DestroyWindow(hDlg); } if(hWnd && IsWindow(hWnd)) { EnableWindow(hWnd, TRUE); if ((hWndFocus = GetDialogFocus(hWnd))) SetFocus(hWndFocus); } if (hWndCapture) SetCapture(hWndCapture); return rc;}
开发者ID:ErisBlastar,项目名称:osfree,代码行数:49,
示例3: OnRButtonUpvoid CDiasStatusBar::OnRButtonUp (UINT nFlags, CPoint point) { if (GetCapture() != this) { ReleaseCapture (); return; } ReleaseCapture (); CRect rect1, rect2; GetItemRect (2, rect1); GetItemRect (3, rect2); uvar32_64 n, count = 0; CaImMenu menu; CaImMenuItem** ppItems; menu.CreatePopupMenu (); GetItemRect (2, rect1); GetItemRect (3, rect2); if (rect1.PtInRect (point) || rect2.PtInRect (point)) { count = theApp.GeomScales.GetCount (); ppItems = new CaImMenuItem*[count]; for (n = 0; n < count; ++n) { ppItems[n] = new CaImMenuItem (theApp.GeomScales[n].GetName() + "/t(" + theApp.GeomScales[n].GetUnits () + ")", (theApp.GeomScales[aimActive].GetPos () == n) ? AMIS_CHECKED : 0); menu.AppendMenu (MF_STRING | MF_ENABLED | MF_OWNERDRAW, ID_TOOLS_GEOMSCALE_1 + n, (LPCTSTR)ppItems[n]); } menu.CheckMenuRadioItem (0, n, theApp.GeomScales[aimActive].GetPos (), MF_BYPOSITION); } GetItemRect (4, rect1); GetItemRect (5, rect2); if (rect1.PtInRect (point) || rect2.PtInRect (point)) { count = theApp.DensScales.GetCount (); ppItems = new CaImMenuItem*[count]; for (n = 0; n < count; ++n) { ppItems[n] = new CaImMenuItem (theApp.DensScales[n].GetName() + "/t(" + theApp.DensScales[n].GetUnits () + ")", (theApp.DensScales[aimActive].GetPos () == n) ? AMIS_CHECKED : 0); menu.AppendMenu (MF_STRING | MF_ENABLED | MF_OWNERDRAW, ID_TOOLS_GEOMSCALE_1 + n, (LPCTSTR)ppItems[n]); } menu.CheckMenuRadioItem (0, n, theApp.DensScales[aimActive].GetPos (), MF_BYPOSITION); } GetWindowRect (rect2); menu.TrackPopupMenu (TPM_LEFTALIGN, point.x + rect2.left, point.y + rect2.top, this); for (n = 0; n < count; ++n) delete ppItems[n]; if (count > 0) delete [] ppItems;}
开发者ID:macx0r,项目名称:dias-inet,代码行数:49,
示例4: StopCurAnimatevoid SButton::OnStateChanged( DWORD dwOldState,DWORD dwNewState ){ StopCurAnimate(); if(GetCapture()==m_swnd) //点击中 return; if(m_bAnimate && ((dwOldState==WndState_Normal && dwNewState==WndState_Hover) ||(dwOldState==WndState_Hover && dwNewState==WndState_Normal))) {//启动动画 m_byAlphaAni=5; GetContainer()->RegisterTimelineHandler(this); }}
开发者ID:kenchen1101,项目名称:soui,代码行数:15,
示例5: GetCursorPos// 鼠标左键按下void ProgressController::left_button_down(){ // 查询当前光标位置,判断光标是在滑道还是滑块上 POINT p; GetCursorPos(&p); HWND hwnd = GetCapture(); ScreenToClient(hwnd, &p); if (p.x >= m_left && p.x <= m_left + m_width) { // 如果光标在滑道上 POINT point; GetCursorPos(&point); // 查询光标位置 }}
开发者ID:shimachao,项目名称:SLPlayer,代码行数:16,
示例6: void CRoundButton2::OnCaptureChanged(CWnd *pWnd){ // Check, if we lost the mouse-capture if (GetCapture() != this) { // We have lost the mouse-capture, so the mouse has left the buttons face m_bMouseOnButton = false; // Redraw Control, if Button is hot if (m_bIsHotButton) Invalidate(); } CButton::OnCaptureChanged(pWnd);}
开发者ID:IcyX,项目名称:bote,代码行数:15,
示例7: KillTimervoid CAutoRepeatButton::OnLButtonUp(UINT nFlags, CPoint point) { KillTimer(IDT_TIMER); if(GetCapture() != NULL) { /* release capture */ ReleaseCapture(); if(sent == 0 && (GetState() & BST_PUSHED) != 0) GetParent()->SendMessage(WM_COMMAND, MAKELONG(GetDlgCtrlID(), BN_CLICKED), (LPARAM)m_hWnd); } /* release capture */ //CButton::OnLButtonUp(nFlags, point);}
开发者ID:drkjschmidt,项目名称:rudolf,代码行数:15,
示例8: OnMouseMove// on mouse movevoid CSplitterFrame::OnMouseMove(UINT nFlags, CPoint point){ if(GetCapture()==this) { CPoint ptCursor; GetCursorPos(&ptCursor); CPoint pt = GetAbsPosition(); if(sp_uiDockSide==AFX_IDW_DOCKBAR_LEFT || sp_uiDockSide==AFX_IDW_DOCKBAR_RIGHT) { pt.x = ptCursor.x; } else if(sp_uiDockSide==AFX_IDW_DOCKBAR_TOP || sp_uiDockSide==AFX_IDW_DOCKBAR_BOTTOM) { pt.y = ptCursor.y; } SetAbsPosition(pt); } CWnd::OnMouseMove(nFlags, point);}
开发者ID:rdrago,项目名称:LCSource,代码行数:16,
示例9: OnLButtonUpvoid CSketcherView::OnLButtonUp(UINT nFlags, CPoint point){ if(this == GetCapture()) ReleaseCapture(); // Stop capturing mouse messages // Make sure there is an element if(m_pTempElement) { // Call a document class function to store the element // pointed to by m_pTempElement in the document object delete m_pTempElement; // This code is temporary m_pTempElement = 0; // Reset the element pointer }}
开发者ID:ktjones,项目名称:BVC2010,代码行数:15,
示例10: OnLButtonUpLTBOOL CFolderJoin::OnLButtonUp(int x, int y){ if (bDblClick) { bDblClick = LTFALSE; return LTFALSE; } if (GetCapture()) { return m_pPassEdit->OnEnter(); } return CBaseFolder::OnLButtonUp(x,y);}
开发者ID:germanocaldeira,项目名称:no-one-lives-forever,代码行数:15,
示例11: InitToolTipBOOL CExtButton::PreTranslateMessage(MSG* pMsg) { if( !CExtPopupMenuWnd::IsMenuTracking() ) { InitToolTip(); m_ToolTip.RelayEvent(pMsg); }// if( CExtPopupMenuWnd::IsMenuTracking() )// return TRUE; if( ( pMsg->message == WM_KEYDOWN || pMsg->message == WM_KEYUP ) && ( pMsg->wParam == VK_RETURN || pMsg->wParam == VK_SPACE ) ) { if( IsWindowEnabled() && IsWindowVisible() && (!m_bPushTracking) ) { if( (pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_RETURN) || (pMsg->message == WM_KEYUP && pMsg->wParam == VK_SPACE) ) { if( GetCapture() == this ) ReleaseCapture(); m_bMouseOver = m_bPushed = m_bPushTracking = m_bKeyTracking = FALSE; Invalidate(); UpdateWindow(); _OnClick(); return TRUE; } if(pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_SPACE) { m_bMouseOver = m_bPushed = m_bKeyTracking = TRUE; SetCapture(); Invalidate(); UpdateWindow(); return TRUE; } } // if( IsWindowEnabled() && IsWindowVisible() && (!m_bPushTracking) ) return TRUE; } return CButton::PreTranslateMessage(pMsg);}
开发者ID:darwinbeing,项目名称:trade,代码行数:48,
示例12: switch//////////////////// Change state for finite-state-machine.//void CDragDropMgr::SetState(UINT iState){// TRACE(_T("CDragDropMgr::SetState %d/n"),iState); if (iState != m_iState) { switch (iState) { case CAPTURED: ::SetCapture(m_hwndTracking); // capture mouse input break; case LDRAGGING: case RDRAGGING: m_hCursorSave = GetCursor(); // save current cursor break; default: // NONE if (GetCapture() == m_hwndTracking) ::ReleaseCapture(); // release capture and.. SetCursor(m_hCursorSave); // ..restore cursor if (m_pDragImage) { m_pDragImage->DragLeave(CWnd::FromHandle(m_ddi.hwndTarget)); m_pDragImage->EndDrag(); // end drawing and.. delete m_pDragImage; // ..destroy.. m_pDragImage=NULL; // ..image list } if (m_hwndTracking) InvalidateRect(m_hwndTracking, NULL, FALSE); if (m_ddi.hwndTarget) InvalidateRect(m_ddi.hwndTarget, NULL, FALSE); delete m_ddi.pData; m_ddi.pData = NULL; m_hwndTracking = NULL; break; } m_iState = iState; }}
开发者ID:jithuin,项目名称:infogeezer,代码行数:51,
示例13: TraceRectvoidZListTip::OnMouseMove( UINT uFlags, CPoint pt ){#ifdef DEBUG_ALL TraceRect( "ZListTip::OnMouseMove rectTitle: ", m_rectTitle ); TracePoint( "ZListTip::OnMouseMove pt: ", pt );#endif if ( m_rectTitle.PtInRect( pt ) == FALSE ) {#ifdef DEBUG_ALL TracePoint( "ZListTip::OnMouseMove PtInRect: ", pt );#endif#if 0 if ( GetCapture( ) == this ) ReleaseCapture( ); SetWindowPos( 0, 0, 0, 0, 0, SWP_HIDEWINDOW | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE );#else Hide( );#endif // Forward the message ClientToScreen( &pt ); CWnd *pWnd = WindowFromPoint( pt ); if ( pWnd == this ) pWnd = m_pParentWnd; CWnd *pWndTemp = GetFocus( ); if ( pWndTemp != pWnd ) pWnd->SetFocus( ); zLONG lParam = MAKELONG( pt.x, pt.y ); int nHitTest = (int) pWnd->SendMessage( WM_NCHITTEST, 0, lParam ); if ( nHitTest == HTCLIENT ) { pWnd->ScreenToClient( &pt ); lParam = MAKELONG( pt.x, pt.y ); pWnd->PostMessage( WM_MOUSEMOVE, uFlags, lParam ); } else { pWnd->PostMessage( WM_NCMOUSEMOVE, nHitTest, lParam ); } }}
开发者ID:DeegC,项目名称:ZeidonTools,代码行数:48,
示例14: get_keyboard_lparambool track_bar::on_hooked_message(message_hook_manager::t_message_hook_type p_type, int code, WPARAM wp, LPARAM lp){ win32_keyboard_lparam & lpkeyb = get_keyboard_lparam(lp); if (wp == VK_ESCAPE && !lpkeyb.transition_code && !lpkeyb.previous_key_state) { destroy_tooltip(); if (GetCapture() == get_wnd()) ReleaseCapture(); m_dragging = false; set_position_internal(m_position); message_hook_manager::deregister_hook(message_hook_manager::type_keyboard, this); m_hook_registered=false; return true; } return false;}
开发者ID:samithaj,项目名称:columns_ui,代码行数:16,
示例15: _GetButtonPtrvoid CFlatToolbar::OnCancelMode(){ CControlBar::OnCancelMode(); if (m_iButtonCapture >= 0) { AFX_TBBUTTON* pTBB = _GetButtonPtr(m_iButtonCapture); ASSERT(!(pTBB->nStyle & TBBS_SEPARATOR)); UINT nNewStyle = (pTBB->nStyle & ~TBBS_PRESSED); if (GetCapture() == this) ReleaseCapture(); SetButtonStyle(m_iButtonCapture, nNewStyle); m_iButtonCapture = -1; UpdateWindow(); }}
开发者ID:Joincheng,项目名称:lithtech,代码行数:16,
示例16: SetFocusvoid WLTreeItemAL::OnLButtonDown(UINT /*nFlags*/, CPoint point) { SetFocus() ; m_bLButtonDown = TRUE ; HostToClient(&point) ; if (SendMessage(WM_CAN_YOU_DRAG, 0, 0)) { if (GetCapture() != this) SetCapture() ; m_bPrepareDrag = TRUE ; m_dwPrepareDragTime = GetTickCount() ; m_ptPrepareDragPoint = point ; }}
开发者ID:baogechen,项目名称:foundit,代码行数:16,
示例17: GetCursorPos//---------------------------------------------------------------------------------------void z_ed3View::OnRButtonDown(UINT nFlags, CPoint point) { GetCursorPos(&_scrPoint); if(GetCapture()!= this) SetCapture(); GetCursorPos(&_scrPoint); HideTheCursor(); _mm._rdown = 1; _rotating = _mm._ldown; _mm._pt = point; _mm._ptd = point; CView::OnRButtonDown(nFlags, point);}
开发者ID:comarius,项目名称:getic3d,代码行数:17,
示例18: Escapevoid CFolderSave::Escape(){ if (GetCapture()) { m_pEdit->Select(LTFALSE); g_pColCtrl->SetString(0, g_hOldName); g_pColCtrl->SetString(2, g_hOldTime); SetCapture(LTNULL); RemoveFixedControl(m_pEdit); } else { CBaseFolder::Escape(); }}
开发者ID:Arc0re,项目名称:lithtech,代码行数:16,
示例19: Escapevoid CFolderJoin::Escape(){ if (m_pPassEdit && GetCapture() == m_pPassEdit) { SetCapture(LTNULL); m_szPassword[0] = LTNULL; RemoveFixedControl(m_pPassEdit); RemoveFixedControl(m_pPassLabel); RemoveFixedControl(m_pPassBack); m_bAskingForPassword = FALSE; ForceMouseUpdate(); } else CBaseFolder::Escape();}
开发者ID:germanocaldeira,项目名称:no-one-lives-forever,代码行数:16,
示例20: PreTranslateMessageBOOL COptionTreeImagePopUp::PreTranslateMessage(MSG* pMsg) { // Relay tooltip if (IsWindow(m_ttToolTip.GetSafeHwnd())) { m_ttToolTip.RelayEvent(pMsg); } // Sometimes if the picker loses focus it is never destroyed if (GetCapture()->GetSafeHwnd() != GetSafeHwnd()) { SetCapture(); } return CWnd::PreTranslateMessage(pMsg);}
开发者ID:ngphloc,项目名称:agmagic,代码行数:16,
示例21: ScrollTrackScrollBar/*********************************************************************** * ScrollTrackScrollBar * * Track a mouse button press on a scroll-bar. * pt is in screen-coordinates for non-client scroll bars. */VOID FASTCALLScrollTrackScrollBar(HWND Wnd, INT SBType, POINT Pt){ MSG Msg; UINT XOffset = 0, YOffset = 0; if (SBType != SB_CTL) { // Used with CMD mouse tracking. PWND pwnd = ValidateHwnd(Wnd); if (!pwnd) return; XOffset = pwnd->rcClient.left - pwnd->rcWindow.left; YOffset = pwnd->rcClient.top - pwnd->rcWindow.top;// RECT rect;// WIN_GetRectangles( Wnd, COORDS_CLIENT, &rect, NULL ); ScreenToClient(Wnd, &Pt);// Pt.x -= rect.left;// Pt.y -= rect.top; Pt.x += XOffset; Pt.y += YOffset; } IntScrollHandleScrollEvent(Wnd, SBType, WM_LBUTTONDOWN, Pt); do { if (!GetMessageW(&Msg, 0, 0, 0)) break; if (CallMsgFilterW(&Msg, MSGF_SCROLLBAR)) continue; if ( Msg.message == WM_LBUTTONUP || Msg.message == WM_MOUSEMOVE || (Msg.message == WM_SYSTIMER && Msg.wParam == SCROLL_TIMER)) { Pt.x = LOWORD(Msg.lParam) + XOffset; Pt.y = HIWORD(Msg.lParam) + YOffset; IntScrollHandleScrollEvent(Wnd, SBType, Msg.message, Pt); } else { TranslateMessage(&Msg); DispatchMessageW(&Msg); } if (!IsWindow(Wnd)) { ReleaseCapture(); break; } } while (Msg.message != WM_LBUTTONUP && GetCapture() == Wnd);}
开发者ID:GYGit,项目名称:reactos,代码行数:53,
示例22: onDestroy// ---------------------------------------------------------------------LRESULT WinSkinWindow::onDestroy( HWND hWnd, // ウィンドウハンドル UINT uMsg, // WM_DESTROY WPARAM wParam, // 利用しないパラメ C++ GetCaster函数代码示例 C++ GetCaptain函数代码示例
|