0
在一个winform中,当鼠标停下来时,窗体会跟着鼠标,但有时当机器特别慢时,窗体会跟着鼠标,即使鼠标熄灭,所以我用win32 dll来判断鼠标如何确定是否按下鼠标左键?
[DllImport("user32.dll")]
static extern short GetAsyncKeyState(int nVirtKey);
public static bool GetCurrentLeftMouseIsDowning()
{
if (GetAsyncKeyState(0x01) == 0)
return false;
else
return true;
}
但当形式一直拖着内存会增加,还有什么其他的方式来确定鼠标的状态?或者如何控制表单时拖??