win32 空心对话框

在init dialog里加入:

	HWND currentWnd = this->GetSafeHwnd();
	RECT rcSrc, rcMid;
	::GetWindowRect(currentWnd, &rcSrc);
	int space = 20;
	rcMid.left = rcSrc.left + space;
	rcMid.top = rcSrc.top + space;
	rcMid.right = rcSrc.right - space;
	rcMid.bottom = rcSrc.bottom - space;

	HRGN hrgnSrc = ::CreateRectRgn(rcSrc.left, rcSrc.top, rcSrc.right, rcSrc.bottom);
	HRGN hrgnMid = ::CreateRectRgn(rcMid.left, rcMid.top, rcMid.right, rcMid.bottom);
	HRGN hrgn = ::CreateRectRgn(0, 0, 1, 1);
	::CombineRgn(hrgn, hrgnSrc, hrgnMid, RGN_DIFF);
	::SetWindowRgn(currentWnd, hrgn, TRUE);
 CreateRectRgn 使用  DeleteObject释放

你可能感兴趣的:(win32 空心对话框)