使子窗口的标题/边框透明 [英] Make caption/border of child window transparent
问题描述
在Win32应用程序中,我想在主窗口中创建一个子窗口.我在调用CreateWindowEx
时将这些样式分配给了子窗口:
In my Win32 application, I want to create a child window within the main window. I assigned these styles to the child window when calling CreateWindowEx
:
WS_CHILDWINDOW | WS_VISIBLE | WS_VSCROLL | WS_HSCROLL | WS_SIZEBOX | WS_CAPTION
我得到的子窗口具有标题和可调整大小的边框.但是,标题中没有关闭按钮,并且子窗口的标题/边框不是透明的.我正在Windows 7中使用aero主题.
这是屏幕截图:
如何在字幕上添加关闭按钮?如何使字幕/边框透明?
此外,您可能没有注意到,但子窗口的左上角和右上角最初是黑色背景.如果我拖动窗口或调整窗口大小,黑色背景将消失.
The child window I get has a caption and a resizable border. However there''s no close button in the caption, and the caption/border of the child window is not transparent. I''m using the aero theme in Windows 7.
Here is the screen shot:
How to add close button to the caption? How can I make the caption/border transparent?
What''s more, you may not notice but initially the upper left and upper right corner of the child window has a black background. If I drag the window or resize it, the black background will disappear. Why is that and how to fix this minor problem?
推荐答案
请尝试使用WS_SYSMENU
样式.
哪个画笔设置为您的窗口类?您可以粘贴用于创建子窗口的示例代码吗?
问候,
拉达克里希南(Radhakrishnan G.)
Please try withWS_SYSMENU
style.
Which brush is set to your window class? Can you paste sample code for creating the child window?
Regards,
Radhakrishnan G.
这篇关于使子窗口的标题/边框透明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!