问题描述
大家好!
我想首先感谢所有花时间查看此主题并尝试提供帮助的人。
我有一个带有儿童静电控制的主窗口。我已将变量命名为 hsInfo 。
此静态控件使用样式SS_BITMAP,SS_NOTIFY和SS_REALSIZECONTROL创建,并显示位图。它也点击它时响应。
现在我需要创建另一个静态控件,其样式与上面相同,在上面提到的静态控件之上(hsInfo) )。此静态控件名为 hsHelp 。
当我将 hsInfo 作为CreateWindow()中的父窗口传递给 hsHelp , hsHelp 根本没有出现。
如果我点击大概出现 hsHelp 的区域,父静态控件会发送其通知,而不是 hsHelp 。似乎 hsHelp 甚至不存在。
但是,如果主窗口的句柄作为父,子传递正确绘制静态控件( hsHelp ),但无法再次捕获其通知,因为单击它会再次激活另一个通知( hsInfo )。 br $>
我的问题如下:
我应该在代码中更改一个静态控件是什么另一个静态控件的孩子?
注意:
我应该能够在用户点击它时捕获来自控件的通知消息。
我在MS Visual Studio Express 2008,Windows XP,C ++,使用WIN32 API工作。
如果需要任何其他信息(源代码或类似的东西),请求它,我将非常乐意提供它。
Hello everyone!
I would like to start by saying thanks to everyone who takes some time to view this thread and try to help.
I have a main window with a child static control. I have named the variable hsInfo.
This static control is created with styles SS_BITMAP, SS_NOTIFY and SS_REALSIZECONTROL, and displays bitmap. Also it responds when clicked on it.
Now I need to create another static control with styles same as above, to be on top of the above mentioned static control ( hsInfo ). This static control is named hsHelp.
When I pass hsInfo as the parent window in CreateWindow() for hsHelp, hsHelp doesn''t appear at all.
If I click on area where hsHelp should approximately appear, parent static control sends its notification, instead of hsHelp''s. It seems as if hsHelp doesn''t even exist.
However, if main window''s handle is passed as parent, child static control ( hsHelp ) is properly drawn, but its notifications again can''t be captured,since clicking on it activates again notification of the other one ( hsInfo ).
My question is following:
What should I change in my code to have one static control to be a child of the other static control?
NOTE:
I should be able to catch notification messages from control when user clicks on it.
I work in MS Visual Studio Express 2008, on Windows XP, in C++, using WIN32 API.
If any other information is required ( source code or something similar ), please ask for it, I will more than gladly supply it.
推荐答案
这篇关于子窗口不显示自己的子项。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!