Hi,everyone
I have a program with VS2005+OSG2.8.2, use MFC SDI to display OSG 3D scene.
When pick a certain object in 3D world, I want use a modeless dialog to show
the infomation.
In the function of OnInitDialog, I do something below:
Code:
BOOL CDlgDataView::OnInitDialog()
{
CDialog::OnInitDialog();
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon
#define LWA_COLORKEY 0x00000002
#define WS_EX_LAYERED 0x00080000
typedef BOOL (WINAPI *lpfnSetLayeredWindowAttributes)(HWND hWnd,
COLORREF crKey, BYTE bAlpha, DWORD dwFlags);
lpfnSetLayeredWindowAttributes SetLayeredWindowAttributes;
COLORREF maskColor=RGB(0,0,0);
HMODULE hUser32 = GetModuleHandle("user32.dll");
SetLayeredWindowAttributes =
(lpfnSetLayeredWindowAttributes)GetProcAddress(hUser32,"SetLayeredWindowAttributes");
SetWindowLong(this->GetSafeHwnd(), GWL_EXSTYLE,
GetWindowLong(GetSafeHwnd(), GWL_EXSTYLE)|WS_EX_LAYERED);
SetLayeredWindowAttributes(this->GetSafeHwnd(), maskColor, 192,
LWA_COLORKEY);
FreeLibrary(hUser32);
return TRUE; // return TRUE unless you set the focus to a
control
}
when the information is on the top of the main window, it can not be seen.
How can I solve this problem?Thanks!
Cheers,
Hunjun
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=31798#31798
Attachments:
http://forum.openscenegraph.org//files/transparence_191.jpg
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org