Win32,WndProc和父子窗口

编程入门 行业动态 更新时间:2024-10-22 04:24:17
本文介绍了Win32,WndProc和父子窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在使用Win32 Api创建多个窗口的C代码进行开发. 我两次使用createWindow-创建父窗口和子窗口. 我有一个消息循环

I'm developing in C code that uses the Win32 Api to create multiple windows. I used createWindow twice - to create parent and child windows. I have a message loop

while ( GetMssage (&msg, NULL,0,0)){ . translate dispatch . }

但是我只调用一次WND_Proc函数,而不是每个窗口两次.

But I only get the WND_Proc function called once, instead of twice for each of the windows.

我在做什么错了?

推荐答案

如果我正确理解了您的问题,则您应该希望WndProc会为为其创建的每个窗口类的所创建的每个窗口收到一条WM_CREATE消息. WndProc已注册.

If I'm understanding your question correctly, you should expect your WndProc to receive a single WM_CREATE message for each window created of the window class for which the WndProc is registered.

您的WndProc将不会为您创建的其他类的窗口(例如,像标准Windows UI控件)收到WM_CREATE,即使它是WndProc类别的窗口的直接子代也是如此.如果您向我们提供了有关您要完成的工作的更多详细信息,我们可以提供建议或解决方法.

Your WndProc will not receive a WM_CREATE for a window you create of a different class (like the standard Windows UI controls, for example), even if it is a direct child of a window of the WndProc's class. If you gave us some more specifics on what you are trying to accomplish we could provide suggestions or workarounds.

这个问题也可能会消失更多了解您的情况.

This question may also shed some more light on your situation.

更多推荐

Win32,WndProc和父子窗口

本文发布于:2023-11-06 06:48:07,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1562979.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:父子   窗口   WndProc

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!