I want to fix a transparent dialog on the desktop, I use this code for make the dialog transparent:
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 );
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?