Windows 7问题 [英] Problem with Windows 7

查看:97
本文介绍了Windows 7问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在桌面上修复透明对话框,我使用以下代码使对话框透明:

I want to fix a transparent dialog on the desktop, I use this code for make the dialog transparent:

// change opacity : 0 is transparent and 255 is opaque.
LONG ExtendedStyle = GetWindowLong( GetSafeHwnd(), GWL_EXSTYLE );
SetWindowLong( GetSafeHwnd(), GWL_EXSTYLE, ExtendedStyle | WS_EX_LAYERED );
SetLayeredWindowAttributes( 0, 150, LWA_ALPHA );


我也用以下代码修复了桌面上的对话框:


also I fix dialog on the desktop with this code:

HWND ProgmanHwnd = ::FindWindowEx( ::FindWindowEx( ::FindWindow( L"Progman", L"Program Manager" ), NULL, L"SHELLDLL_DefView",L"" ), NULL, L"SysListView32", L"FolderView" ); 
::SetParent( m_hWnd, ProgmanHwnd );


我将两个代码都放在了OnCreate()中.

在Windows XP上可以正常工作,但是在win7中只有其中一个可以工作,这意味着如果我同时使用这两个代码,对话框将消失,但是如果我注释其中一个,则另一个可以正常工作.

关于这个奇怪的问题有什么主意吗?


I put both codes in OnCreate().

on Windows XP it works fine, but in win7 only one of them works, it means if I use both codes, the dialog will disappear, but if I comment one of them, the other one works fine.

Is there any idea about this strange problem?

推荐答案

您最好检查返回的值.在W7上,您可能无法获得所有手柄.

检查W7并写一些更好的方法;-)
you better check the returned values. On W7 you may not get all handles.

Check for W7 and write something what works better ;-)


这篇关于Windows 7问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆