怎样做到像WINNAMP那样在鼠标拖动时窗口没有巨型框? 响应WM_LMOUSEDOWN消息,设置标志响应WM_MOUSEMOVE消息,如标志为真则根据鼠标位置移动窗口我做过,很简单 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 我做了一个基于对话框的工程Winamp在类 CWinampDlg 中新增3个成员变量int MoveFlag;int xx,yy;BOOL CWinampDlg::OnInitDialog(){ // TODO: Add extra initialization here MoveFlag = FALSE; xx = 0; yy = 0;}void CWinampDlg::OnLButtonDown(UINT nFlags, CPoint point) { // TODO: Add your message handler code here and/or call default MoveFlag = TRUE; RECT Rect; POINT Point; GetWindowRect(&Rect); GetCursorPos(&Point); xx = Point.x - Rect.left; yy = Point.y - Rect.top; SetCapture();}void CWinampDlg::OnLButtonUp(UINT nFlags, CPoint point) { // TODO: Add your message handler code here and/or call default MoveFlag = FALSE; ReleaseCapture();}void CWinampDlg::OnMouseMove(UINT nFlags, CPoint point) { // TODO: Add your message handler code here and/or call default if(MoveFlag != TRUE) return; POINT Point; GetCursorPos(&Point); SetWindowPos(&wndTop,Point.x-xx,Point.y-yy,0,0,SWP_NOSIZE);} 关于DLL... 键盘钩子问题!! VC如何 实现类似PDF里面的抓手功能? 我要做一个一对多的文件传输程序,服务端使用IOCP,不知道能够支持多少个客户端同时下载? 关于全角字符的查找 (在线等待) 界面设计问题 在CListBox中怎么添加字符串 我的Tab Control控件怎么不能用了? 关于winsock2 谁有词法生成器? 还是流量统计 数据库高手请进
在类 CWinampDlg 中新增3个成员变量
int MoveFlag;
int xx,yy;BOOL CWinampDlg::OnInitDialog()
{
// TODO: Add extra initialization here
MoveFlag = FALSE;
xx = 0;
yy = 0;
}void CWinampDlg::OnLButtonDown(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
MoveFlag = TRUE;
RECT Rect;
POINT Point;
GetWindowRect(&Rect);
GetCursorPos(&Point);
xx = Point.x - Rect.left;
yy = Point.y - Rect.top;
SetCapture();
}void CWinampDlg::OnLButtonUp(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
MoveFlag = FALSE;
ReleaseCapture();
}void CWinampDlg::OnMouseMove(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
if(MoveFlag != TRUE)
return;
POINT Point;
GetCursorPos(&Point);
SetWindowPos(&wndTop,Point.x-xx,Point.y-yy,0,0,SWP_NOSIZE);
}