用了LockWindowUpdate(hwnd)怎么窗口还可以移动?不是说A Locked windows cannot be moved?
解决方案 »
- 如何动态使菜单项变得可用或不可用?
- 怎么在自己的应用程序中加入代码让别人的应用程序的窗口处于最前端被激活的状态,而且鼠标不响应自己的应用程序
- BITMAPINFOHEADER对象,我用delete[]释放时出错,各位给个方法先,谢谢!
- 我回来了!问一个问题,MFC中WM_COMMAND和WM_NOFITY消息的分派和流向以及怎么模拟实现?
- ADO插入数据的问题,高分求解,不够再加.在线等待!!!!!!
- 向DirectDraw表面写数据??急呀,帮我一下。
- 如何配置数据源
- 如何获取硬盘的吞吐量
- vc里件反斜杆\处理问题??
- 今天发现了csdn上的超级疑难问题,搜索了几十个贴子,没能解决.现倾家荡产想解决
- 请教:如何动态更改Edit控件的文本颜色?
- 问个简单问题。。。。请知道的回答一下,谢谢!
HWND hWndLock // handle to window
);hWndLock
[in] Specifies the window in which drawing will be disabled. If this parameter is NULL, drawing in the locked window is enabled. 只是禁止画图
The LockWindowUpdate function disables or enables drawing in the specified window. Only one window can be locked at a time. BOOL LockWindowUpdate(
HWND hWndLock // handle to window
);
Parameters
hWndLock
[in] Specifies the window in which drawing will be disabled. If this parameter is NULL, drawing in the locked window is enabled.
Return Values
If the function succeeds, the return value is nonzero.If the function fails, the return value is zero, indicating that an error occurred or another window was already locked. Windows NT/2000/XP: To get extended error information, call GetLastError.Res
If an application with a locked window (or any locked child windows) calls the GetDC, GetDCEx, or BeginPaint function, the called function returns a device context with a visible region that is empty. This will occur until the application unlocks the window by calling LockWindowUpdate, specifying a value of NULL for hWndLock. If an application attempts to draw within a locked window, the system records the extent of the attempted operation in a bounding rectangle. When the window is unlocked, the system invalidates the area within this bounding rectangle, forcing an eventual WM_PAINT message to be sent to the previously locked window and its child windows. If no drawing has occurred while the window updates were locked, no area is invalidated. LockWindowUpdate does not make the specified window invisible and does not clear the WS_VISIBLE style bit. A locked window cannot be moved.
MSDN上就这么写的
不过给我的感觉是 在移动的时候只有松开鼠标的就会自动解除锁定 在有些事件发生的时候 特别是用户的一些事件 系统会自动解除被锁定的窗口可能 MSDN 上漏掉了 说笑了
或者是Lock(WindowUpdate)
根移动不移动没关系啊