您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ ClipCursor函数代码示例

51自学网 2021-06-01 20:11:31
  C++
这篇教程C++ ClipCursor函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中ClipCursor函数的典型用法代码示例。如果您正苦于以下问题:C++ ClipCursor函数的具体用法?C++ ClipCursor怎么用?C++ ClipCursor使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了ClipCursor函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: GetWindowRect

void OverlayControl::MouseDown(HWND hwnd, WPARAM wParam, LPARAM lParam){	if (!ActiveOverlay)		return;	//	Left or right button clicked -- select the element under cursor.	RECT clipRect, clientRect;	GetWindowRect(hwnd, &clipRect);	GetClientRect(hwnd, &clientRect);	//	Save original mouse position.	GetCursorPosition(hwnd, &clickAnchor);	//	Element could be activated only if no element active AND user doesn't click 	//	within the active element.	if (!ActiveOverlay->ActiveElement || 		!ActiveOverlay->HitTestElement(ActiveOverlay->ActiveElement, &clientRect, &clickAnchor, &hitTestAnchor))	{		//	Find overlay element under cursor.		OverlayElement *element = ActiveOverlay->FindElementFromPoint(&clientRect, &clickAnchor, &hitTestAnchor);		ActivateElement(hwnd, element);	}	if (!ActiveOverlay->ActiveElement)	{		ResetCursor();	}	if (0 != (wParam & MK_LBUTTON))	{		if (ActiveOverlay->ActiveElement)		{			ActiveOverlay->ActiveElement->GetRect(&clientRect, &elementRectAnchor);			//	Show that we're about to drag the object.			UpdateCursor(hitTestAnchor);			//	Capture the mouse.			SetCapture(hwnd);			ClipCursor(&clipRect);		}		return;	}	if (0 != (wParam & MK_RBUTTON))	{		//	Show popup menu.		POINT pt;		GetCursorPos(&pt);		__raise RightMouseButtonClicked(ActiveOverlay->ActiveElement, &pt);		return;	}}
开发者ID:Erls-Corporation,项目名称:webinaria-source,代码行数:56,


示例2: rcTrack

void CRemoteWnd::TrackScaler(){	MSG* pMsg = &AfxGetThreadState()->m_msgCur;	CRect rcTrack( &m_rcsScalerTrack );	CPoint point;	ClientToScreen( &rcTrack );	ClipCursor( &rcTrack );	ScreenToClient( &rcTrack );	SetCapture();	rcTrack.DeflateRect( m_rcScalerTab.Width() / 2, 0 );	while ( GetAsyncKeyState( VK_LBUTTON ) & 0x8000 )	{		while ( ::PeekMessage( pMsg, NULL, WM_MOUSEFIRST, WM_MOUSELAST, PM_REMOVE ) );		if ( ! AfxGetThread()->PumpMessage() )		{			AfxPostQuitMessage( 0 );			break;		}		GetCursorPos( &point );		ScreenToClient( &point );		int nPosition = (int)( 105.0f * (float)( point.x - rcTrack.left ) / (float)rcTrack.Width() );		if ( nPosition < 0 ) nPosition = 0;		else if ( nPosition >= 102 ) nPosition = 101;		else if ( nPosition >= 100 ) nPosition = 100;		// ToDo: Settings.Live.BandwidthScaleOut		if ( nPosition != (int)Settings.Live.BandwidthScaleIn )		{			Settings.Live.BandwidthScaleIn = (DWORD)nPosition;			Invalidate();		}	}	ReleaseCapture();	ClipCursor( NULL );	Invalidate();}
开发者ID:GetEnvy,项目名称:Envy,代码行数:43,


示例3: GetWindowRect

void	Window::LockMouseToWindow(bool lock)	{	lockMouse = lock;	if(lock) {		RECT		windowRect;		GetWindowRect (window->windowHandle, &windowRect);		SetCapture(window->windowHandle);		ClipCursor(&windowRect);		POINT pt;		GetCursorPos(&pt);		ScreenToClient(window->windowHandle, &pt);		Window::GetMouse()->SetAbsolutePosition(pt.x,pt.y);	}	else{		ReleaseCapture();		ClipCursor(NULL);	}}
开发者ID:JohnEz,项目名称:Dissertation,代码行数:19,


示例4: _ClipCursor

BOOL WINAPI _ClipCursor(const RECT *lpRect){  if ( !wmode )  {    if ( _ClipCursorOld )      return _ClipCursorOld(lpRect);    return ClipCursor(lpRect);  }  return TRUE;}
开发者ID:Maiven,项目名称:bwapi,代码行数:10,


示例5: ClipCursor

void OverlayControl::MouseUp(HWND hwnd, WPARAM wParam, LPARAM lParam){	if (!ActiveOverlay)		return;	//	Release mouse.	ClipCursor(0);	ReleaseCapture();	ResetCursor();}
开发者ID:Erls-Corporation,项目名称:webinaria-source,代码行数:10,


示例6: MouseSetRect

void MouseSetRect(int x1, int y1, int x2, int y2){	#if 0	TRect r;		r.x1 = x1, r.y1 = y1, r.x2 = x2, r.y2 = y2;	ClipCursor(&r); /// FIXME -- SDL cannot clip mouse cursor, do it ourselves!SDL_WM_GrabInput(SDL_GRAB_ON);	#endif}
开发者ID:zarevucky,项目名称:signus,代码行数:10,


示例7: ClipCursor

// ----------------------------------------------------------------------- //////	ROUTINE:	CLTWnd::OnLButtonUp////	PURPOSE:	This is the actual left button up handler//// ----------------------------------------------------------------------- //BOOL CLTWnd::OnLButtonUp(int xPos, int yPos){	// Stop any draggage	//if(s_pWndDrag)	g_mouseMgr.SetClipRect(NULL);	ClipCursor(g_prcClip);	//s_pWndDrag = NULL;	s_pWndCapture = NULL;	return(this != s_pMainWnd);}
开发者ID:Arc0re,项目名称:lithtech,代码行数:17,


示例8: GetWindowRect

void WindowsMouseController::grab(){    RECT clipRegion;    GetWindowRect( mWindowHandle, &clipRegion );    clipRegion.left += 10;    clipRegion.right -= 10;    clipRegion.top += 33;    clipRegion.bottom -= 10;    ClipCursor( &clipRegion );}
开发者ID:Gohla,项目名称:Diversia,代码行数:10,


示例9: GetClientRect

void Window::lockMouse(){	RECT clientRect;	GetClientRect(m_hWnd,&clientRect);	POINT p1 = {clientRect.left,clientRect.top};	POINT p2 = {clientRect.right,clientRect.bottom};	ClientToScreen(m_hWnd,&p1); ClientToScreen(m_hWnd,&p2);	RECT bounds={p1.x,p1.y,p2.x,p2.y};	ClipCursor(&bounds);}
开发者ID:MattiasLiljeson,项目名称:Amalgamation,代码行数:10,


示例10: mouse

/*   Effect:        Handle any actions relating to the user pressing *down*                  the left mouse button within the widget.                  In particular, we need to prepare the widget for moving                  || sizing. To do this, we remove any drag blobs already                  present on the widget.                  We also capture the mouse input, so we can track the                  movement of the mouse. We will release the capture                  when the user releases the mouse key.                  Since the window class style of the widget might not                  accept double clicks, we will need to compute double                  clicks ourselves.                  If someone else has control of the mouse (like the                  session window || another widget), we won't be getting                  this mouse message.   See Also:      WidgetLButtonUp, WidgetLMouseMove.   Called By:     WidgetWndProc, in response to WM_LBUTTONDOWN messages.                  LayoutWndProc, in response to WM_LBUTTONDOWN messages                  when the mouse is over a drag blob.*/void WidgetLButtonDown(HWND hWnd, int nDragMode, POINT ptScreen){    RECT rcParentScreen;    HWND hWndParent, hWndPrev;    HDC hDC;    CurrentWidgetInfo.ptPrev = ptScreen;    hWndParent = GetParent(hWnd);    CurrentWidgetInfo.nDragMode = nDragMode;    hDC = GetDC(hWndParent);    /* Erase the drag blobs from the current widget. The blobs will */    /* be repainted in WidgetButtonUp after the user finishes dragging */    /* || sizing. */    GetWindowRect(hWnd, &CurrentWidgetInfo.rcPrevDots);    GetWindowRect(hWnd, &CurrentWidgetInfo.rcPrev);    hWndPrev = CurrentWidgetInfo.hWnd;    CurrentWidgetInfo.bDotsDrawn = FALSE;    CurrentWidgetInfo.bDotsDrawn = TRUE;    if (hWnd != CurrentWidgetInfo.hWnd)    {        if (KpsSetCurrentWidget(hWnd))        {            if (IsWindow(hWndPrev))            {                if (KpsIsAWidget(hWndPrev))                {                    InvalidateRect(hWndPrev, NULL, TRUE);                    UpdateWindow(hWndPrev);                }            }        }        InvalidateRect(hWnd, NULL, TRUE);        UpdateWindow(hWnd);    }    if (!CurrentWidgetInfo.bCapture)    {        SetCapture(hWnd);        GetClientRect(hWndParent, &rcParentScreen);        KpsClientRectToScreen(hWndParent, &rcParentScreen);        ClipCursor(&rcParentScreen);        CurrentWidgetInfo.bCapture = TRUE;    }    ReleaseDC(hWndParent, hDC);    /* Clear out the rectangle, indicating there is nothing to erase! */    SetRectEmpty(&rcPrev);}
开发者ID:thearttrooper,项目名称:KappaPC,代码行数:81,


示例11: IN_DeactivateWin32Mouse

/*================IN_DeactivateWin32Mouse================*/void IN_DeactivateWin32Mouse(void){	// NERVE - SMF - dont do this in developer mode	if(!com_developer->integer)	{		ClipCursor(NULL);	}	ReleaseCapture();	while(ShowCursor(TRUE) < 0)		;}
开发者ID:ethr,项目名称:ETXrealPro,代码行数:16,


示例12: GetWindowRect

void PixelLightCtrl::SetTrapMouse(bool bTrap){	if (m_hFrontendWnd) {		// Trap mouse?		if (bTrap) {			// Get window rect (in screen coordinates)			RECT sRect;			GetWindowRect(&sRect);			// Trap mouse			ClipCursor(&sRect); 		} else {			// Untrap mouse			ClipCursor(nullptr);		}		// Backup the state		m_bTrapMouse = bTrap;	}}
开发者ID:ByeDream,项目名称:pixellight,代码行数:20,


示例13: Win_DeAcquireMouse

// Called when the window loses focusstatic void Win_DeAcquireMouse( void ) {    if( win.mouse.restoreparms )        SystemParametersInfo( SPI_SETMOUSE, 0, win.mouse.originalparms, 0 );    SetCursorPos( win.center_x, win.center_y );    ClipCursor( NULL );    ReleaseCapture();    SetWindowText( win.wnd, PRODUCT );}
开发者ID:Bad-ptr,项目名称:q2pro,代码行数:12,


示例14: WIN_UpdateClipCursor

voidWIN_UpdateClipCursor(SDL_Window *window){    SDL_WindowData *data = (SDL_WindowData *) window->driverdata;    SDL_Mouse *mouse = SDL_GetMouse();    /* Don't clip the cursor while we're in the modal resize or move loop */    if (data->in_title_click || data->in_modal_loop) {        ClipCursor(NULL);        return;    }    if ((mouse->relative_mode || (window->flags & SDL_WINDOW_INPUT_GRABBED)) &&        (window->flags & SDL_WINDOW_INPUT_FOCUS)) {        if (mouse->relative_mode && !mouse->relative_mode_warp) {            LONG cx, cy;            RECT rect;            GetWindowRect(data->hwnd, &rect);            cx = (rect.left + rect.right) / 2;            cy = (rect.top + rect.bottom) / 2;            /* Make an absurdly small clip rect */            rect.left = cx - 1;            rect.right = cx + 1;            rect.top = cy - 1;            rect.bottom = cy + 1;            ClipCursor(&rect);        } else {            RECT rect;            if (GetClientRect(data->hwnd, &rect) && !IsRectEmpty(&rect)) {                ClientToScreen(data->hwnd, (LPPOINT) & rect);                ClientToScreen(data->hwnd, (LPPOINT) & rect + 1);                ClipCursor(&rect);            }        }    } else {        ClipCursor(NULL);    }}
开发者ID:dreamsxin,项目名称:nsg-library,代码行数:41,


示例15: hideCursor

// Hide the mouse cursor//static void hideCursor(_GLFWwindow* window){    POINT pos;    ClipCursor(NULL);    if (GetCursorPos(&pos))    {        if (WindowFromPoint(pos) == window->win32.handle)            SetCursor(NULL);    }}
开发者ID:RubenMagallanes,项目名称:comp308sheepSim,代码行数:14,


示例16: RestrictMouseMovementTo

void RestrictMouseMovementTo( int left , int top , int right , int bottom ){		RECT r;	r.left = left;	r.top = top;	r.right = right;	r.bottom = bottom;	ClipCursor( &r );}
开发者ID:v1ka5,项目名称:Owl_zwei,代码行数:12,


示例17: ClipCursor

void r3dMouse::SetRange(int x1, int y1, int x2, int y2){	RECT	rc;	// Clip Cursor	rc.left   = x1;	rc.top    = y1;	rc.right  = x2;	rc.bottom = y2;	ClipCursor(&rc);	SetCursorPos(0, 0);}
开发者ID:Mateuus,项目名称:srcundead,代码行数:12,


示例18: Win_ClipCursor

// Called when the window gains focus or changes in some waystatic void Win_ClipCursor( void ) {    RECT rc;    get_client_rect( win.wnd, &rc );    win.center_x = ( rc.right + rc.left ) / 2;    win.center_y = ( rc.top + rc.bottom ) / 2;    SetCursorPos( win.center_x, win.center_y );    ClipCursor( &rc );}
开发者ID:Bad-ptr,项目名称:q2pro,代码行数:13,


示例19: sizeof

GameWindow::GameWindow(const string name_t,const string title_t,int width,int height):name(name_t),title(title_t),WIDTH(width),HEIGHT(height){	//1.创建窗口类	WNDCLASSEX wndClass = {};	wndClass.cbSize = sizeof(WNDCLASSEX);	wndClass.style = CS_HREDRAW | CS_VREDRAW;	wndClass.lpfnWndProc = WndProc;	wndClass.cbClsExtra = 0;	wndClass.cbWndExtra = 0;	wndClass.hInstance = GetModuleHandle(NULL);	wndClass.hIcon = LoadIcon(NULL, IDI_APPLICATION);	wndClass.hCursor = LoadCursor(NULL, IDC_ARROW);	wndClass.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);	wndClass.lpszMenuName = NULL;	wndClass.lpszClassName = name.c_str();	//2.注册窗口类	assert(RegisterClassEx(&wndClass));	//3.创建窗口	hwnd = CreateWindow(name.c_str(),title.c_str(),WS_OVERLAPPEDWINDOW,CW_USEDEFAULT,CW_USEDEFAULT,WIDTH,HEIGHT,NULL,NULL,wndClass.hInstance,NULL);	//4.调整大小,移动,显示,更新	RECT window_rect = {0,0,WIDTH,HEIGHT};	AdjustWindowRectEx(&window_rect, GetWindowStyle(hwnd), GetMenu(hwnd) != NULL, GetWindowExStyle(hwnd));	MoveWindow(hwnd,300,150,window_rect.right-window_rect.left, window_rect.bottom-window_rect.top,false);	ShowWindow(hwnd,SW_NORMAL);	UpdateWindow(hwnd);	//5.隐藏鼠标,设为屏幕中心	ShowCursor(false);	center.x = WIDTH/2;	center.y = HEIGHT/2;	ClientToScreen(hwnd,&center);	SetCursorPos(center.x,center.y);	//6.限定鼠标在窗口内	RECT rect;	GetClientRect(hwnd,&rect);	POINT left_top;	left_top.x = rect.left;	left_top.y = rect.top;	POINT right_bottom;	right_bottom.x = rect.right;	right_bottom.y = rect.bottom;	ClientToScreen(hwnd,&left_top);	ClientToScreen(hwnd,&right_bottom);	rect.left = left_top.x;	rect.top = left_top.y;	rect.right = right_bottom.x;	rect.bottom = right_bottom.y;	ClipCursor(&rect);}
开发者ID:zhanghuanzj,项目名称:3DRender,代码行数:52,


示例20: unclip

void unclip(){int a;RECT _screen;_screen.left = 0;_screen.top = 0;_screen.right = GetSystemMetrics(SM_CXSCREEN);_screen.bottom = GetSystemMetrics(SM_CYSCREEN);ClipCursor(&_screen);}
开发者ID:jnck,项目名称:winlock,代码行数:13,


示例21: updatewindowsize

/** * Called from VIDC code when the RISC OS mode has changed. * Update windows size to hold it. * * @param x X size in pixels * @param y Y size in pixels */void updatewindowsize(uint32_t x, uint32_t y){	RECT r;	GetWindowRect(ghwnd, &r);	MoveWindow(ghwnd, r.left, r.top,	           x + (GetSystemMetrics(SM_CXFIXEDFRAME) * 2),	           y + (GetSystemMetrics(SM_CYFIXEDFRAME) * 2) + GetSystemMetrics(SM_CYMENU) + GetSystemMetrics(SM_CYCAPTION),	           TRUE);        if (mousecapture)        {                RECT arcclip;                ClipCursor(&oldclip);                GetWindowRect(ghwnd,&arcclip);                arcclip.left+=GetSystemMetrics(SM_CXFIXEDFRAME)+10;                arcclip.right-=GetSystemMetrics(SM_CXFIXEDFRAME)+10;                arcclip.top+=GetSystemMetrics(SM_CXFIXEDFRAME)+GetSystemMetrics(SM_CYMENUSIZE)+GetSystemMetrics(SM_CYCAPTION)+10;                arcclip.bottom-=GetSystemMetrics(SM_CXFIXEDFRAME)+10;                ClipCursor(&arcclip);        }}
开发者ID:dwhinham,项目名称:rpcemu,代码行数:29,


示例22: CorrectCursor

	void CorrectCursor() {		bool autoHide = ((g_Config.bFullScreen && !mouseButtonDown) || (g_Config.bMouseControl && trapMouse)) && GetUIState() == UISTATE_INGAME;		if (autoHide && (hideCursor || g_Config.bMouseControl)) {			while (cursorCounter >= 0) {				cursorCounter = ShowCursor(FALSE);			}			if (g_Config.bMouseConfine) {				RECT rc;				GetClientRect(hwndDisplay, &rc);				ClientToScreen(hwndDisplay, reinterpret_cast<POINT*>(&rc.left));				ClientToScreen(hwndDisplay, reinterpret_cast<POINT*>(&rc.right));				ClipCursor(&rc);			}		} else {			hideCursor = !autoHide;			if (cursorCounter < 0) {				cursorCounter = ShowCursor(TRUE);				SetCursor(LoadCursor(NULL, IDC_ARROW));				ClipCursor(NULL);			}		}	}
开发者ID:hrydgard,项目名称:ppsspp,代码行数:22,


示例23: GetClientRect

void CDriverD3D::setCapture (bool b){	if (b)	{		RECT client;		GetClientRect (_HWnd, &client);		POINT pt1,pt2;		pt1.x = client.left;		pt1.y = client.top;		ClientToScreen (_HWnd, &pt1);		pt2.x = client.right;		pt2.y = client.bottom;		ClientToScreen (_HWnd, &pt2);		client.bottom = pt2.y;		client.top = pt1.y;		client.left = pt1.x;		client.right = pt2.x;		ClipCursor (&client);	}	else		ClipCursor (NULL);}
开发者ID:mixxit,项目名称:solinia,代码行数:22,


示例24: Java_sage_UIManager_setCursorClip

/* * Class:     sage_UIManager * Method:    setCursorClip * Signature: (Ljava/awt/Rectangle;)V */JNIEXPORT void JNICALL Java_sage_UIManager_setCursorClip(	JNIEnv *env, jclass jc, jobject inRect){	RECT myClip;	static jclass rectClass = (jclass) env->NewGlobalRef(env->FindClass("java/awt/Rectangle"));	static jfieldID rectX = env->GetFieldID(rectClass, "x", "I");	static jfieldID rectY = env->GetFieldID(rectClass, "y", "I");	static jfieldID rectW = env->GetFieldID(rectClass, "width", "I");	static jfieldID rectH = env->GetFieldID(rectClass, "height", "I");	if (inRect)	{		LONG width = (LONG) env->GetIntField(inRect, rectW);		LONG height = (LONG) env->GetIntField(inRect, rectH);		myClip.left = (LONG) env->GetIntField(inRect, rectX);		myClip.top = (LONG) env->GetIntField(inRect, rectY);		myClip.right = myClip.left + width;		myClip.bottom = myClip.top + height;		ClipCursor(&myClip);	}	else		ClipCursor(NULL);}
开发者ID:JREkiwi,项目名称:sagetv,代码行数:27,


示例25: cmdLine_Init

void game::Init(void){  if(g_isConsoleUpdater)  {    cmdLine_Init();    return;  }    //@gHwInfoPoster.Start(); -- DISABLED FOR NOW  // set small icon  ::SendMessage(win::hWnd, WM_SETICON, FALSE, (LPARAM)::LoadIcon(win::hInstance, MAKEINTRESOURCE(IDI_WARINC)));    // make borderless window and subclass wndProc  r3dWinStyleModify(win::hWnd, 0, WS_BORDER);  r3dWinStyleModify(win::hWnd, 0, WS_CAPTION);  SetWindowLong(win::hWnd, GWL_WNDPROC, (DWORD)&updApp_WndFunc);  // ok, now r3drendered started using vars inside itself...  RegisterAllVars();  const int Width  = 785;  const int Height = 650;  HDC disp_dc  = CreateIC("DISPLAY", NULL, NULL, NULL);  int curDispWidth  = GetDeviceCaps(disp_dc, HORZRES);  int curDispHeight = GetDeviceCaps(disp_dc, VERTRES);  int StartXPos = (curDispWidth - Width) / 2;  int StartYPos = (curDispHeight - Height) / 2;  SetWindowPos(win::hWnd, NULL, StartXPos, StartYPos, (int)Width, (int)Height, 0);  r3dRenderer = new r3dRenderLayer;  r3dRenderer->Init(win::hWnd, NULL);    fake_SetMode(Width, Height);    char title[512];  sprintf(title, "Infestation Thailand Updater %s (%s)", UPDATER_VERSION, UPDATER_BUILD);  if(!UPDATER_UPDATER_ENABLED) strcat(title, "!!!!SELF_UPDATE_DISABLED!!!");  ::SetWindowText(win::hWnd, title);  CreateResources();    ShowWindow(win::hWnd, SW_SHOW);    ClipCursor(NULL);    // release dinput classes becase we won't be using them  Keyboard->ReleaseCapture();  Mouse->ReleaseCapture();}
开发者ID:Mateuus,项目名称:newundead,代码行数:51,


示例26: IN_ActivateMouse

/*===========IN_ActivateMouseCalled when the window gains focus or changes in some way===========*/void IN_ActivateMouse (void){	int		width, height;	if (!mouseinitialized)		return;	if (!in_mouse->value)	{		mouseactive = false;		return;	}	if (mouseactive)		return;	mouseactive = true;	if (mouseparmsvalid)		restore_spi = SystemParametersInfo (SPI_SETMOUSE, 0, newmouseparms, 0);	width = GetSystemMetrics (SM_CXSCREEN);	height = GetSystemMetrics (SM_CYSCREEN);	GetWindowRect ( cl_hwnd, &window_rect);	/*	** The following clamping code doesn't work on multi-monitor setups.	** Hence it has been commented out.	*/	/*if (window_rect.left < 0)		window_rect.left = 0;	if (window_rect.top < 0)		window_rect.top = 0;	if (window_rect.right >= width)		window_rect.right = width-1;	if (window_rect.bottom >= height-1)		window_rect.bottom = height-1;*/	window_center_x = (window_rect.right + window_rect.left)/2;	window_center_y = (window_rect.top + window_rect.bottom)/2;	SetCursorPos (window_center_x, window_center_y);	old_x = window_center_x;	old_y = window_center_y;	SetCapture ( cl_hwnd );	ClipCursor (&window_rect);	while (ShowCursor (FALSE) >= 0)		;}
开发者ID:geekmaster,项目名称:stereo-quake,代码行数:58,


示例27: getClientRect

void CShowGrafView::mouseMoveMarkInterval(UINT nFlags, const CPoint &point) {  if(m_dragging) {    if(nFlags && MK_LBUTTON) {      const CRect cr      = getClientRect(this, IDC_SYSTEMPANEL);      const CRect newRect = CRect(m_mouseDownPoint.x, cr.bottom, point.x, cr.top);      CClientDC(GetDlgItem(IDC_SYSTEMPANEL)).DrawDragRect(&newRect, CSize(1,1), &m_dragRect, CSize(1,1));      m_dragRect = newRect;    } else {      CClientDC(GetDlgItem(IDC_SYSTEMPANEL)).DrawDragRect(&m_dragRect, CSize(1,1), NULL, CSize(1,1));      m_dragging = false;      ClipCursor(NULL);    }  }}
开发者ID:JesperMikkelsen,项目名称:Big-Numbers,代码行数:14,


示例28: SetCapture

void WindowsMouse::GetMouseCapture(HWND hWnd){    SetCapture(hWnd);    ShowCursor(0);    GetCursorPos(&origCursorPos);    RECT r;    GetWindowRect(hWnd, &r);    ClipCursor(&r);    center.x = (r.left + r.right) / 2;    center.y = (r.top + r.bottom) / 2;    SetCursorPos(center.x, center.y);}
开发者ID:KitoHo,项目名称:pcsx2,代码行数:14,


示例29: win_grab_mouse

static bool win_grab_mouse(ALLEGRO_DISPLAY *display){    ALLEGRO_SYSTEM_WIN *system = (void *)al_get_system_driver();    ALLEGRO_DISPLAY_WIN *win_disp = (void *)display;    RECT rect;    GetWindowRect(win_disp->window, &rect);    if (ClipCursor(&rect) != 0) {        system->mouse_grab_display = display;        return true;    }    return false;}
开发者ID:BorisCarvajal,项目名称:allegro5,代码行数:14,



注:本文中的ClipCursor函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ ClipSkyPolygon函数代码示例
C++ ClientUserinfoChanged函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。