Why does the SetScrollInfo() function sends a WM_SIZE message to WndProc()?

谁都会走 提交于 2021-02-08 06:37:33

问题


Why does the SetScrollInfo() function sends a WM_SIZE message to WndProc() ?

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.


回答1:


Since this is a documented feature, it's likely not a bug.

From http://msdn.microsoft.com/en-us/library/windows/desktop/ms632646.aspx:

Remarks

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.



来源:https://stackoverflow.com/questions/10251901/why-does-the-setscrollinfo-function-sends-a-wm-size-message-to-wndproc

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!