I have a Windows MFC dialog with a single child, a CTabCtrl. I would like the dialog's window shape to conform to that of its CTabCtrl, so it appears that the CTabCtrl is "floating" on the desktop. I'll add an optional "drag bar" later so that it can be easily repositioned.
I've tried the following code, but it doesn't work (it just causes my window to vanish):
Does anyone see what I am doing wrong?
Where should this code be loaded (in InitDialog(), ShowWindow(), OnCreate(), ...)?
I'm not tied to a CDialog parent, a CFrameWnd or CWnd would be fine. I'd also be happy to have the CTabCtrl (which is derived from CWnd after all) be the toplevel window if that would work properly.
I'm using C++ in Visual Studio .NET. I'm running under Windows XP Pro, but would like to target older OSs, including Windows 98 and NT 4.0, if possible.
Any help would be appreciated. This is for a freeware/ArsWare program I'm developing in my spare time.
I've tried the following code, but it doesn't work (it just causes my window to vanish):
Code:
HRGN hrgn = CreateRectRgn(0,0,0,0);
int nRegionType = m_MainTab.GetWindowRgn(hrgn);
//TODO: This isn't working...
SetWindowRgn (hrgn, TRUE);
Does anyone see what I am doing wrong?
Where should this code be loaded (in InitDialog(), ShowWindow(), OnCreate(), ...)?
I'm not tied to a CDialog parent, a CFrameWnd or CWnd would be fine. I'd also be happy to have the CTabCtrl (which is derived from CWnd after all) be the toplevel window if that would work properly.
I'm using C++ in Visual Studio .NET. I'm running under Windows XP Pro, but would like to target older OSs, including Windows 98 and NT 4.0, if possible.
Any help would be appreciated. This is for a freeware/ArsWare program I'm developing in my spare time.