为什么 SetScrollInfo() 函数向 WndProc() 发送 WM_SIZE 消息? [英] Why does the SetScrollInfo() function sends a WM_SIZE message to WndProc()?
问题描述
为什么 SetScrollInfo() 函数向 WndProc() 发送 WM_SIZE 消息?
Why does the SetScrollInfo() function sends a WM_SIZE message to WndProc() ?
EDIT 显然,这是 WinAPI 中的一个错误.正在发送 WM_SIZE 消息,因为我忘记包含 WS_HSCROLL |WS_VSCROLL
窗口创建中的样式.更正后,WM_SIZE 将不再发送.谢谢.
EDIT Apparently, this is a bug in the WinAPI. The WM_SIZE message was being sent because I forgot to include the WS_HSCROLL | WS_VSCROLL
styles in the window creation. Once that was corrected, the WM_SIZE isn't being sent anymore. Thanks.
推荐答案
由于这是一个记录在案的功能,因此它可能不是错误.
Since this is a documented feature, it's likely not a bug.
来自 http://msdn.microsoft.com/en-us/library/windows/desktop/ms632646.aspx:
备注
如果 SetScrollPos
或 MoveWindow
函数作为 WM_SIZE
消息的结果为子窗口调用,bRedraw
或 bRepaint
参数应为非零值以重新绘制窗口.
If the SetScrollPos
or MoveWindow
function is called for a child window as a result of the WM_SIZE
message, the bRedraw
or bRepaint
parameter should be nonzero to cause the window to be repainted.
这篇关于为什么 SetScrollInfo() 函数向 WndProc() 发送 WM_SIZE 消息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!