void CBCGPRadialMenu::OnSize(UINT nType, int cx, int cy) { CBCGPVisualCtrl::OnSize(nType, cx, cy); if ((GetExStyle() & WS_EX_LAYERED) == 0) { SetRgn(); } }
void CMainFrame::InitWindow() { DWORD d = 0xaabbccdd; BYTE r = GetRValue(d); BYTE g = GetGValue(d); BYTE b = GetBValue(d); CString strResourcePath=m_PaintManager.GetInstancePath(); strResourcePath+=GetSkinFolder().GetData(); CString sPic; sPic.Format(_T("%smain.bmp"), strResourcePath); DuiLib::STRINGorID tmp(sPic.GetBuffer()); HRGN hRgn = DuiLib::CRenderEngine::CreateImageRegion((DuiLib::CRenderEngine::LoadImage(tmp)), RGB(0,255,0)); SetRgn(hRgn); // CRgn rgn; // rgn.CreateRectRgn(100,100,200,200); // ::SetWindowRgn(m_hWnd, rgn, TRUE); SetTimer(2, 1000); }
BOOL CSonicSkin::OnWndMsg(UINT msg, WPARAM wParam, LPARAM lParam) { switch(msg) { case WM_DRAWITEM: { return OnDrawItem((LPDRAWITEMSTRUCT)lParam); } break; case WM_CTLCOLORSTATIC: { return OnCtlColorStatic((HDC)wParam, (HWND)lParam); } break; case WM_CTLCOLORBTN: { return OnCtlColorBtn((HDC)wParam, (HWND)lParam); } break; case WM_LBUTTONDBLCLK: { int x = LOWORD(lParam); int y = HIWORD(lParam); if(y < m_bg.wTitleHeight) { SendMessage(m_hWnd, WM_NCLBUTTONDBLCLK, HTCAPTION, 0); return FALSE; } } break; case WM_LBUTTONDOWN: { int x = LOWORD(lParam); int y = HIWORD(lParam); if(y < m_bg.wTitleHeight && m_bg.bEnableDrag) { SendMessage(m_hWnd, WM_NCLBUTTONDOWN, HTCAPTION, 0); return FALSE; } } break; case WM_NCHITTEST: { return OnNCHittest(LOWORD(lParam), HIWORD(lParam)); } break; // assure the none-border window wont override the tray bar case WM_GETMINMAXINFO: { return OnGetMinMaxInfo((MINMAXINFO *)lParam); } break; case WM_WINDOWPOSCHANGING: { return OnPosChanging((LPWINDOWPOS)lParam); } break; case WM_WINDOWPOSCHANGED: { return OnPosChanged((LPWINDOWPOS)lParam); } break; case WM_ERASEBKGND: { return OnEraseBackground((HDC)wParam); } break; // erase NC paint case WM_NCACTIVATE: g_UI.SetCallWndProcRet(TRUE); return FALSE; case WM_NCPAINT: SetRgn(); case WM_NCCALCSIZE: g_UI.SetCallWndProcRet(0); return FALSE; } return TRUE; }
int SetClipRgn(HDC hdc, int nXLeft, int nYLeft, int nWidth, int nHeight) { return SetRgn(hdc->clip, nXLeft, nYLeft, nWidth, nHeight); }