如何设置允许光标移动的区域/矩形? [英] How to set the area/rectangle in which the cursor is allowed to move?
本文介绍了如何设置允许光标移动的区域/矩形?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
例如当你碰到显示器的一面时,你的光标不能再进一步,更多的例子是当在微软绘画,而你从RGB表中选择一种颜色,它不会允许你的鼠标走出去
b 我的问题是,如何在c ++中用win32 api实现?
解决方案
您可以使用Microsoft的以下函数
BOOL WINAPI ClipCursor $ b __in_opt const RECT * lpRect
);
请参阅 http://msdn.microsoft.com/en-us/library/ms648383(VS.85).aspx
E.g. when you hit the side of your monitor your cursor can't go any further, and more of an example is when in microsoft paint, and your choosing a colour from the RGB table, it won't allow your mouse to go outside of the rectangle while your mouse is down..
my question is how would you implement that in c++ with win32 api?
解决方案
You can use the following function from Microsoft
BOOL WINAPI ClipCursor(
__in_opt const RECT *lpRect
);
See http://msdn.microsoft.com/en-us/library/ms648383(VS.85).aspx
这篇关于如何设置允许光标移动的区域/矩形?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文