您的位置:首页 > 其它

模拟QQ窗口抖动效果

2015-08-25 16:59 211 查看
RECT rtWindow;
	GetWindowRect(&rtWindow);
	//long x = 400;
	//long y = 200;
	long x = rtWindow.left;
	long y = rtWindow.top;
	long cxWidth = rtWindow.right-rtWindow.left;
	long cyHeight = rtWindow.bottom-rtWindow.top;
	const long nOffset  = 9;
	const long SLEEP_INTERAL = 60;
	
	for(long i=0; i<=2; ++i)
	{
		::MoveWindow(m_hWnd, x+nOffset, y-nOffset, cxWidth, cyHeight, TRUE);
		::Sleep(SLEEP_INTERAL);
		::MoveWindow(m_hWnd, x-nOffset, y-nOffset, cxWidth, cyHeight, TRUE);
		::Sleep(SLEEP_INTERAL);
		::MoveWindow(m_hWnd, x-nOffset, y+nOffset, cxWidth, cyHeight, TRUE);
		::Sleep(SLEEP_INTERAL);
		::MoveWindow(m_hWnd, x+nOffset, y+nOffset ,cxWidth, cyHeight, TRUE);
		::Sleep(SLEEP_INTERAL);
		::MoveWindow(m_hWnd, x, y, cxWidth, cyHeight, TRUE);
		::Sleep(SLEEP_INTERAL);
	}


参考:http://www.rupeng.com/forum/thread-6423-1-1.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: