I'm using the win32 Platform SDK (on XP Pro) to create an app consisting a single main window with a number of child windows.
我正在使用win32 Platform SDK(在XP专业版上)创建一个应用程序,其中包含一个带有多个子窗口的主窗口。
The styles passed to CreateWindow are WS_OVERLAPPEDWINDOW | WS_VISIBLE
(for the main window) and WS_CHILDWINDOW | WS_VISIBLE
for the children.
传递给CreateWindow的样式是WS_OVERLAPPEDWINDOW | WS_VISIBLE(用于主窗口)和WS_CHILDWINDOW | WS_VISIBLE为孩子们。
The error I'm seeing is that when another application is dragged on top of my app, the underlying windows are not redrawn. An easy (but kludgy) way to force an update is to 'jiggle' the titlebar.
我看到的错误是,当我的应用程序上拖动另一个应用程序时,底层窗口不会重绘。强制更新的一种简单(但很有用)的方法是“摇动”标题栏。
I'm guessing that I'm missing a windows message or not calling a win32 function correctly. Most of my code is straight from Petzold's 95 book.
我猜我错过了一条Windows消息或没有正确调用win32函数。我的大多数代码都直接来自Petzold的95书。
If it matters, the main window doesn't need to draw anything: the child windows handle all display duties.
如果重要,主窗口不需要绘制任何东西:子窗口处理所有显示任务。
1 个解决方案
#1
It sounds like you are not calling DefWindowProc for the WM_PAINT message.
听起来你没有为WM_PAINT消息调用DefWindowProc。
Are you sure you are handling the WM_PAINT event properly? In particular make sure that for this WM_PAINT message that you are calling:
您确定正确处理WM_PAINT事件吗?特别要确保您正在调用的WM_PAINT消息:
DefWindowProc(hwnd,msg,wParam,lParam);
WM_PAINT will be called when your window needs to be repainted.
当您的窗口需要重新绘制时,将调用WM_PAINT。
If you are trying to handle your own drawing of the window, make sure you are calling BeginPaint and EndPaint in your handler.
如果您正在尝试处理自己的窗口绘图,请确保在处理程序中调用BeginPaint和EndPaint。
#1
It sounds like you are not calling DefWindowProc for the WM_PAINT message.
听起来你没有为WM_PAINT消息调用DefWindowProc。
Are you sure you are handling the WM_PAINT event properly? In particular make sure that for this WM_PAINT message that you are calling:
您确定正确处理WM_PAINT事件吗?特别要确保您正在调用的WM_PAINT消息:
DefWindowProc(hwnd,msg,wParam,lParam);
WM_PAINT will be called when your window needs to be repainted.
当您的窗口需要重新绘制时,将调用WM_PAINT。
If you are trying to handle your own drawing of the window, make sure you are calling BeginPaint and EndPaint in your handler.
如果您正在尝试处理自己的窗口绘图,请确保在处理程序中调用BeginPaint和EndPaint。