29 #ifndef WM_NCMOUSELEAVE
30 #define WM_NCMOUSELEAVE 0x02A2
33 #define TME_NONCLIENT 0x10
61 , m_barColor(::GetSysColor(COLOR_ACTIVECAPTION)), m_naBarColor(::GetSysColor(COLOR_INACTIVECAPTION))
62 , m_textColor(::GetSysColor(COLOR_CAPTIONTEXT)), m_naTextColor(::GetSysColor(COLOR_INACTIVECAPTIONTEXT))
97 m_nWidthEllipse = widthEllipse;
98 m_nHeightEllipse = heightEllipse;
120 virtual void DrawEx(HDC dc,
int x,
int y, LPARAM lParam)
const
122 HWND hWnd = ::WindowFromDC(dc);
129 COLORREF c1 = (lParam == 0) ? m_barColor : m_naBarColor;
136 if ( m_nWidthEllipse > 0 || m_nHeightEllipse > 0 )
138 HRGN rgn = ::CreateRoundRectRgn(x, y, x +
m_size.cx, y +
m_size.cy, m_nWidthEllipse, m_nHeightEllipse);
139 ::SelectClipRgn(dc, rgn);
141 ::SelectClipRgn(dc, NULL);
150 HICON icon =
reinterpret_cast<HICON
>(::SendMessage(m_hWnd, WM_GETICON, 0, 0));
154 ::DrawIconEx(dc, x + 2, y + 1, icon, CalcScaleX(16, dc), CalcScaleY(16, dc), 0, 0, DI_NORMAL);
155 x += CalcScaleX(16 + 5, dc);
163 ::GetWindowText(m_hWnd, w.
Ref(), 256);
169 COLORREF color = (lParam == 0) ? m_textColor : m_naTextColor;
181 COLORREF m_naBarColor;
182 COLORREF m_textColor;
183 COLORREF m_naTextColor;
185 int m_nHeightEllipse;
246 : m_pressedButton(BK_Nothing), m_transColor(CLR_INVALID), m_hNcRgn(NULL)
247 , m_isActive(true), m_boHasHover(false), m_isInit(false), m_isInitWindowRgn(true), m_canMenuCheck(true)
248 , m_frameWidths(0, 0, 0, 0), m_titleRect(0, 0, 0, 0), m_titleHeight(0), m_isEvenBackGround(false)
249 , m_textColor(CLR_INVALID), m_isMenuInit(false), m_isNcResized(false)
256 if ( m_hNcRgn != NULL )
258 _DeleteObject(m_hNcRgn);
270 m_backGround[0] = ::CreatePatternBrush(bbd.
GetParts(5));
271 m_backGround[1] = ::CreatePatternBrush(bbd.
GetParts(5));
272 m_isEvenBackGround =
true;
273 m_pFrameDrawer = bbd.
Clone();
285 m_backGround[0] = ::CreatePatternBrush(bbd1.
GetParts(5));
286 m_backGround[1] = ::CreatePatternBrush(bbd2.
GetParts(5));
287 m_isEvenBackGround =
false;
299 m_backGround[0] = ::CreatePatternBrush(bmp);
300 m_backGround[1] = ::CreatePatternBrush(bmp);
301 m_isEvenBackGround =
true;
302 m_pFrameDrawer = draw.
Clone();
313 m_transColor = color;
324 m_pTitleDrawer = draw.
Clone();
336 if ( titleHeight <= 0 )
338 titleHeight = ::GetSystemMetrics(SM_CYCAPTION);
340 ::SetRect(&m_titleRect, frameWidths.left, frameWidths.top, 0, frameWidths.top + titleHeight);
341 m_titleHeight = titleHeight;
342 m_frameWidths = frameWidths;
343 m_frameWidths.top += titleHeight;
356 if ( frameWidth >= 0 )
358 ::SetRect(&rc, frameWidth, frameWidth, frameWidth, frameWidth);
377 m_button[BK_Close].SetDrawer(pos, bbd, HTCLOSE, SC_CLOSE);
390 m_button[BK_Minimum].SetDrawer(pos, bbd, HTMINBUTTON, SC_MINIMIZE);
403 m_button[BK_Maximum].SetDrawer(pos, bbd, HTMAXBUTTON, SC_MAXIMIZE);
416 m_button[BK_Restore].SetDrawer(pos, bbd, HTMAXBUTTON, SC_RESTORE);
429 m_button[BK_Help].SetDrawer(pos, bbd, HTHELP, SC_CONTEXTHELP);
438 if ( color == RGB(255, 255, 255) )
440 color = RGB(255, 255, 254);
453 return m_backGround[isActive ? 0 : 1];
463 m_pFrameDrawer = o.m_pFrameDrawer;
464 m_backGround[0] = o.m_backGround[0];
465 m_backGround[1] = o.m_backGround[1];
466 m_isEvenBackGround = o.m_isEvenBackGround;
467 m_pTitleDrawer.
Null();
468 if ( ! o.m_pTitleDrawer.
IsNull() )
470 m_pTitleDrawer = o.m_pTitleDrawer->
Clone();
472 m_textColor = o.m_textColor;
473 m_frameWidths = o.m_frameWidths;
474 m_titleRect = o.m_titleRect;
475 m_titleHeight = o.m_titleHeight;
476 m_transColor = o.m_transColor;
479 m_button[i] = o.m_button[i];
512 int fx = ::GetSystemMetrics(SM_CXFIXEDFRAME);
513 int fy = ::GetSystemMetrics(SM_CYFIXEDFRAME);
514 int ch = ::GetSystemMetrics(SM_CYCAPTION);
515 DWORD style = ::GetWindowLong(hWnd, GWL_STYLE);
516 if ( (style & WS_THICKFRAME) != 0 )
518 fx = ::GetSystemMetrics(SM_CXSIZEFRAME);
519 fy = ::GetSystemMetrics(SM_CYSIZEFRAME);
521 if ( (::GetWindowLong(hWnd, GWL_EXSTYLE) & WS_EX_TOOLWINDOW) != 0 )
523 ch = ::GetSystemMetrics(SM_CYSMCAPTION);
525 if ( (style & WS_CAPTION) != WS_CAPTION )
529 if ( (style & WS_BORDER) == 0 )
533 if ( m_frameWidths.IsRectNull() )
535 m_frameWidths.SetRect(fx, fy + ch, fx, fy);
537 if ( m_titleRect.IsRectNull() )
539 m_titleRect.SetRect(fx, fy, 0, fy + ch);
552 if ( ! m_pTitleDrawer.
IsNull() )
554 HDC dc = ::GetWindowDC(
m_hWnd);
555 m_pTitleDrawer->
DrawEx(dc, 0, 0, 0);
559 ::GetClientRect(
m_hWnd, rc);
560 m_windowSize = rc.Size() + CSize(m_frameWidths.left + m_frameWidths.right, m_frameWidths.top + m_frameWidths.bottom);
563 mbi.cbSize =
sizeof(MENUBARINFO);
564 if ( ::GetMenuBarInfo(
m_hWnd, OBJID_MENU, 0, &mbi) )
567 m_menuHeight = r.Height() + 1;
568 m_windowSize.cy += m_menuHeight;
570 ::SetWindowPos(
m_hWnd, NULL, 0, 0, m_windowSize.cx, m_windowSize.cy, SWP_NOMOVE | SWP_NOZORDER | SWP_FRAMECHANGED);
590 ::SetWindowPos(
m_hWnd, NULL, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_FRAMECHANGED);
606 void m_CheckMenu(
void)
608 if ( m_canMenuCheck )
610 LONG l = ::GetWindowLong(
m_hWnd, GWL_STYLE);
613 m_button[i].SetVisibleMode(
false);
615 if ( (l & WS_SYSMENU) != 0 )
617 m_button[BK_Close].SetVisibleMode(
true);
618 HMENU hMenu = ::GetSystemMenu(
m_hWnd, FALSE);
619 UINT state = ::GetMenuState(hMenu, SC_CLOSE, MF_BYCOMMAND);
620 m_button[BK_Close].SetEnableMode((state & (MF_GRAYED | MF_DISABLED)) == 0);
621 if ( (l & WS_MINIMIZEBOX) != 0 )
623 m_button[BK_Minimum].SetVisibleMode(
true);
624 m_button[BK_Minimum].SetEnableMode(
true);
625 if ( (l & WS_MAXIMIZEBOX) == 0 )
627 m_button[BK_Maximum].SetVisibleMode(
true);
628 m_button[BK_Maximum].SetEnableMode(
false);
631 if ( (l & WS_MAXIMIZEBOX) != 0 )
633 int b = ::IsZoomed(
m_hWnd) ? BK_Restore : BK_Maximum;
634 m_button[b].SetVisibleMode(
true);
635 if ( (l & WS_MINIMIZEBOX) == 0 )
637 m_button[BK_Minimum].SetVisibleMode(
true);
638 m_button[BK_Minimum].SetEnableMode(
false);
642 if ( (l & DS_CONTEXTHELP) != 0 )
644 m_button[BK_Help].SetVisibleMode(
true);
655 void m_OnFramePaint(HDC dc,
const CSize& size,
const CRect& rect,
bool isActive)
658 bi.
Set(size.cx, size.cy);
661 if ( ! m_pFrameDrawer.
IsNull() )
663 ::SetBrushOrgEx(dc, m_frameWidths.left, m_frameWidths.top, NULL);
664 m_pFrameDrawer->
Resize(size);
665 m_pFrameDrawer->
DrawEx(dc, 0, 0, ! isActive);
667 if ( ! m_pTitleDrawer.
IsNull() )
669 m_pTitleDrawer->
Resize(rect.Size());
670 m_pTitleDrawer->
DrawEx(dc, rect.left, rect.top, ! isActive);
675 t.Resize(rect.Size());
676 t.DrawEx(dc, rect.left, rect.top, ! isActive);
680 m_button[i].Draw(dc, m_windowSize);
694 LRESULT m_OnNcHitTest(LRESULT r,
const POINT& pos)
698 LRESULT l = m_button[i].HitTest(pos, m_windowSize);
699 if ( l != HTNOWHERE )
704 if ( r == HTSYSMENU )
707 else if ( m_titleRect.PtInRect(pos) )
711 else if ( r == HTCAPTION )
715 else if ( r == HTCLOSE || r == HTMINBUTTON || r == HTMAXBUTTON )
727 void m_OnNcMouseMove(WPARAM wParam)
730 if ( m_pressedButton == BK_Nothing )
734 r |= m_button[i].SetHoverMode(wParam);
739 r |= m_button[m_pressedButton].SetPressMode(wParam);
740 r |= m_button[m_pressedButton].SetHoverMode(wParam);
756 bool m_OnNcButton(UINT message, WPARAM wParam, LPARAM& _lParam)
760 case WM_NCLBUTTONDBLCLK:
761 case WM_NCRBUTTONDBLCLK:
764 case WM_NCRBUTTONDOWN:
766 if ( wParam == HTCLOSE )
768 _lParam = MAKELONG(-1, -1);
771 case WM_NCLBUTTONDOWN:
776 if ( message == WM_NCLBUTTONUP || message == WM_LBUTTONUP)
778 if ( m_pressedButton == BK_Nothing )
782 EButtonKind b = m_pressedButton;
783 m_SetButtonPressState(BK_Nothing);
784 m_button[b].SetPressMode(
false);
786 if ( m_button[b].IsHitTest(wParam) )
794 if ( m_button[i].IsHitTest(wParam) && m_button[i].isEnable() )
796 m_SetButtonPressState(
static_cast<EButtonKind
>(i));
797 m_button[i].SetPressMode(
true);
828 void m_OnNcCalcSize(
bool boCalcValidRects, NCCALCSIZE_PARAMS* pParams)
830 if ( pParams->lppos == NULL || ! boCalcValidRects )
834 CPoint po(pParams->lppos->x, pParams->lppos->y);
835 CRect rc(CPoint(0, 0), CSize(pParams->lppos->cx, pParams->lppos->cy));
836 rc.DeflateRect(m_frameWidths);
837 MENUBARINFO mbi = {
sizeof(MENUBARINFO) };
839 if ( ::GetMenuBarInfo(
m_hWnd, OBJID_MENU, 0, &mbi) )
841 m_menuHeight = (mbi.rcBar.bottom - mbi.rcBar.top) + 1;
843 rc.top += m_menuHeight;
844 pParams->rgrc[0] = rc + po;
851 void m_SetButtonPressState(EButtonKind bn)
853 if ( bn == BK_Nothing )
855 if ( m_pressedButton != BK_Nothing )
857 m_pressedButton = BK_Nothing;
863 if ( m_pressedButton == BK_Nothing )
865 m_pressedButton = bn;
878 CMyButton(
void) : m_onButton(false), m_isPress(false), m_isEnable(true), m_isVisible(false), m_size(0, 0), m_point(0, 0)
886 void GetRect(RECT& _rect,
const SIZE& sz)
const
890 _rect.left = (m_point.x >= 0) ? (m_point.x) : (sz.cx + m_point.x - m_size.cx);
891 _rect.right = _rect.left + m_size.cx;
892 _rect.top = (m_point.y >= 0) ? (m_point.y) : (sz.cy + m_point.y - m_size.cy);
893 _rect.bottom = _rect.top + m_size.cy;
897 ::SetRectEmpty(&_rect);
905 bool isEnable(
void)
const
907 return m_isVisible && m_isEnable && ! m_pDrawer.IsNull();
916 LRESULT HitTest(
const POINT& pos,
const SIZE& sz)
const
920 return rc.PtInRect(pos) ? m_hitTest : HTNOWHERE;
928 bool IsHitTest(WPARAM wParam)
const
930 return wParam == m_hitTest;
936 void SetVisibleMode(
bool isVisible)
938 m_isVisible = isVisible;
944 void SetEnableMode(
bool isEnable)
946 m_isEnable = isEnable;
954 bool SetHoverMode(WPARAM wParam)
956 bool isHover = (wParam == m_hitTest);
957 bool r = (m_onButton != isHover);
958 m_onButton = isHover;
967 bool SetPressMode(WPARAM wParam)
969 bool isPress = (wParam == m_hitTest);
970 bool r = (m_isPress != isPress);
978 void SetPressMode(
bool isPress)
988 void Draw(HDC dc,
const SIZE& sz)
const
990 if ( ! m_isVisible || m_pDrawer.IsNull() )
1001 else if ( m_isPress )
1005 else if ( m_onButton )
1009 m_pDrawer->DrawEx(dc, rc.left, rc.top, p);
1018 void SetDrawer(
const POINT& pos,
const IDrawable& draw, UINT hitTest, UINT msg)
1020 m_pDrawer = draw.
Clone();
1023 m_hitTest = hitTest;
1030 void PostSysCommand(HWND hWnd)
1059 return new CMyBrushDrawer(*
this);
1062 virtual void Draw(HDC dc,
int x = 0,
int y = 0)
const
1065 ::FillRect(dc, &r, m_brush);
1068 COLORREF m_textColor;
1071 bool m_isEvenBackGround;
1073 CRect m_frameWidths;
1077 CPoint m_windowPoint;
1080 bool m_isInitWindowRgn;
1082 COLORREF m_transColor;
1084 CMyButton m_button[BK_Max];
1085 EButtonKind m_pressedButton;
1088 bool m_canMenuCheck;
1096 void m_SetWindowRgn(
void)
1098 if ( m_hNcRgn != NULL )
1100 HRGN rgn = ::CreateRectRgn(0, 0, 0, 0);
1101 ::CombineRgn(rgn, m_hNcRgn, NULL, RGN_COPY);
1102 ::SetWindowRgn(
m_hWnd, rgn,
true);
1108 LRESULT m_OrgWndProcWithNoSysmeny(UINT message, WPARAM wParam, LPARAM lParam)
1110 m_canMenuCheck =
false;
1111 LONG nowStyle = ::GetWindowLong(
m_hWnd, GWL_STYLE);
1112 ::SetWindowLong(
m_hWnd, GWL_STYLE, nowStyle & (~WS_SYSMENU));
1113 LRESULT r = _super::WindowProc(message, wParam, lParam);
1114 ::SetWindowLong(
m_hWnd, GWL_STYLE, nowStyle);
1115 m_canMenuCheck =
true;
1119 void m_NcPaint(
void)
1122 ::GetWindowRect(
m_hWnd, rc);
1124 ::GetClientRect(
m_hWnd, cliRc);
1125 if ( m_isInitWindowRgn )
1127 m_isInitWindowRgn =
false;
1128 if ( m_hNcRgn != NULL )
1130 _DeleteObject(m_hNcRgn);
1132 if ( ! m_frameWidths.IsRectNull() && m_transColor != CLR_INVALID && ! m_pFrameDrawer.
IsNull() )
1134 m_pFrameDrawer->
Resize(rc.Size());
1140 cliRc.OffsetRect(m_frameWidths.left, m_frameWidths.top + m_menuHeight);
1141 HDC dc = ::GetWindowDC(
m_hWnd);
1142 ::ExcludeClipRect(dc, cliRc.left, cliRc.top, cliRc.right, cliRc.bottom);
1143 m_titleRect.right = rc.Width() - m_frameWidths.right;
1144 if ( m_menuHeight != 0 )
1147 int h = ::GetSystemMetrics(SM_CYCAPTION);
1148 m_titleRect.bottom = m_titleRect.top + h;
1149 m_frameWidths.top -= m_titleHeight;
1150 m_frameWidths.top += h;
1153 m_OnFramePaint(dc, rc.Size(), m_titleRect, m_isActive);
1165 virtual LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
1171 LRESULT r = _super::WindowProc(message, wParam, lParam);
1176 case WM_CTLCOLOREDIT:
1178 HWND hWnd =
reinterpret_cast<HWND
>(lParam);
1179 if ( (::GetWindowLong(hWnd, GWL_EXSTYLE) & WS_EX_TRANSPARENT) != 0 )
1181 HDC dc =
reinterpret_cast<HDC
>(wParam);
1182 ::SetBkMode(dc, TRANSPARENT);
1183 HBRUSH b = m_backGround[m_isActive ? 0 : 1];
1184 _super::WindowProc(message, wParam, lParam);
1185 if ( IS_RGBVALUE(m_textColor) )
1189 return reinterpret_cast<LRESULT
>(b);
1193 case WM_CTLCOLORSTATIC:
1195 HWND hWnd =
reinterpret_cast<HWND
>(lParam);
1197 if ( (r & DLGC_HASSETSEL) != 0 )
1203 case WM_CTLCOLORBTN:
1205 HDC dc =
reinterpret_cast<HDC
>(wParam);
1206 ::SetBkMode(dc, TRANSPARENT);
1207 HBRUSH b = m_backGround[m_isActive ? 0 : 1];
1208 _super::WindowProc(message, wParam, lParam);
1209 if ( IS_RGBVALUE(m_textColor) )
1213 return reinterpret_cast<LRESULT
>(b);
1216 case WM_CTLCOLORDLG:
1217 case WM_CTLCOLORMSGBOX:
1219 HDC dc =
reinterpret_cast<HDC
>(wParam);
1220 HBRUSH b = m_backGround[m_isActive ? 0 : 1];
1221 _super::WindowProc(message, wParam, lParam);
1222 if ( IS_RGBVALUE(m_textColor) )
1226 return reinterpret_cast<LRESULT
>(b);
1229 case WM_WINDOWPOSCHANGED:
1231 CRect oldRc(m_windowPoint, m_windowSize);
1232 LRESULT r = _super::WindowProc(message, wParam, lParam);
1233 const WINDOWPOS* P =
reinterpret_cast<const WINDOWPOS*
>(lParam);
1234 m_windowPoint.x = P->x;
1235 m_windowPoint.y = P->y;
1237 b |= (m_windowSize.cx != P->cx);
1238 m_windowSize.cx = P->cx;
1239 b |= (m_windowSize.cy != P->cy);
1240 m_windowSize.cy = P->cy;
1243 m_isNcResized =
true;
1245 if ( ::GetCursorPos(&po) )
1247 WPARAM w =
SendMessage(WM_NCHITTEST, 0, MAKELONG(po.x, po.y));
1251 m_isInitWindowRgn =
true;
1259 if ( ! m_isMenuInit )
1261 m_isMenuInit =
true;
1275 if ( ::GetMenu(
m_hWnd) != NULL && m_menuBar.m_hMenu == NULL )
1277 m_menuBar.
Attach(
this,
false);
1282 NCCALCSIZE_PARAMS* P =
reinterpret_cast<NCCALCSIZE_PARAMS*
>(lParam);
1283 LRESULT r = _super::WindowProc(message, wParam, lParam);
1284 m_OnNcCalcSize(wParam != 0, P);
1297 return m_OrgWndProcWithNoSysmeny(message, wParam, lParam);
1301 LRESULT r = _super::WindowProc(message, wParam, lParam);
1303 return m_OnNcHitTest(r, CPoint(p.x - m_windowPoint.x, p.y - m_windowPoint.y));
1307 if ( m_pressedButton >= 0 )
1310 ::ClientToScreen(
m_hWnd, &po);
1311 WPARAM w =
SendMessage(WM_NCHITTEST, 0, MAKELONG(po.x, po.y));
1315 case WM_CAPTURECHANGED:
1316 if ( m_pressedButton != BK_Nothing )
1318 m_SetButtonPressState(BK_Nothing);
1321 m_button[i].SetPressMode(
false);
1326 m_isActive = !! wParam;
1327 if ( ! m_isEvenBackGround )
1330 ::RedrawWindow(
m_hWnd, NULL, NULL, RDW_ERASE | RDW_FRAME | RDW_INVALIDATE);
1334 CRect rc(0, 0, 1, 1);
1335 ::RedrawWindow(
m_hWnd, rc, NULL, RDW_FRAME | RDW_NOERASE | RDW_NOINTERNALPAINT | RDW_INVALIDATE);
1343 case WM_NCMOUSELEAVE:
1346 m_boHasHover =
false;
1348 if ( ::GetCursorPos(&po) )
1350 WPARAM w =
SendMessage(WM_NCHITTEST, 0, MAKELONG(po.x, po.y));
1355 case WM_NCMOUSEMOVE:
1356 if ( m_isNcResized )
1358 m_isNcResized =
false;
1361 if ( m_isInit && m_isActive )
1364 if ( (::GetWindowLong(
m_hWnd, GWL_EXSTYLE) & WS_EX_TOOLWINDOW) == 0 )
1371 m_OnNcMouseMove(wParam);
1372 if ( ! m_boHasHover )
1374 m_boHasHover =
true;
1375 TRACKMOUSEEVENT tme;
1376 tme.cbSize =
sizeof (TRACKMOUSEEVENT);
1378 tme.dwHoverTime = HOVER_DEFAULT;
1379 tme.dwFlags = TME_LEAVE | TME_NONCLIENT;
1380 ::_TrackMouseEvent(&tme);
1386 return m_OrgWndProcWithNoSysmeny(message, wParam, lParam);
1390 LRESULT r = m_OrgWndProcWithNoSysmeny(message, wParam, lParam);
1395 case WM_INITMENUPOPUP:
1396 if ( m_popupMenu.m_hMenu != NULL )
1398 m_popupMenu.Detach();
1400 m_popupMenu.
Attach(
this,
reinterpret_cast<HMENU
>(wParam),
true,
true);
1401 if ( HIWORD(lParam) == 1 )
1403 LRESULT r = m_OrgWndProcWithNoSysmeny(message, wParam, lParam);
1409 case WM_STYLECHANGED:
1410 if ( m_canMenuCheck )
1417 if ( m_pressedButton >= 0 )
1420 ::ClientToScreen(
m_hWnd, &po);
1421 WPARAM w =
SendMessage(WM_NCHITTEST, 0, MAKELONG(po.x, po.y));
1422 if ( m_OnNcButton(message, w, lParam) )
1428 case WM_NCLBUTTONDOWN:
1429 case WM_NCRBUTTONUP:
1430 if ( m_OnNcButton(message, wParam, lParam) )
1445 return m_OrgWndProcWithNoSysmeny(message, wParam, lParam);
1448 case WM_NCLBUTTONUP :
1449 case WM_NCLBUTTONDBLCLK:
1450 case WM_NCRBUTTONDOWN:
1451 case WM_NCRBUTTONDBLCLK:
1452 if ( m_OnNcButton(message, wParam, lParam) )
1457 case WM_NCMBUTTONDOWN:
1458 case WM_NCMBUTTONUP:
1459 case WM_NCMBUTTONDBLCLK:
1464 if ( m_hNcRgn != NULL )
1466 _DeleteObject(m_hNcRgn);
1470 LRESULT r = _super::WindowProc(message, wParam, lParam);
1475 case WM_THEMECHANGED:
1476 ::SetWindowPos(
m_hWnd, NULL, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOZORDER | SWP_FRAMECHANGED);
1477 ::InvalidateRect(
m_hWnd, NULL, TRUE);
1480 return _super::WindowProc(message, wParam, lParam);
#define loop(VAR, CNT)
loop構文.
CBankDrawer & Add(const IDrawable &draw)
[追加] 追加
virtual IDrawable * Clone(void) const
[作成] クローン作成.
CBitmapHandle GetParts(int idx) const
[取得] ビットマップ
virtual IDrawable * Clone(void) const
[作成] クローン作成.
static CBitmapHandle ToBitmap(const IDrawable &draw, COLORREF color=CLR_INVALID)
[作成] ビットマップ作成.
bool GradationFill(COLORREF color1, COLORREF color2, EDirection direction, const RECT *pRect=NULL)
[処理] グラデーション描画.
HRGN CreateRgn(COLORREF transColor=CLR_AUTOSELECT) const
[作成] リージョン作成.
HDC GetDC(void)
[取得]デバイスコンテキストハンドル取得.
bool CustomizeAlpha(BYTE alpha)
[処理] アルファチャネル操作.
bool Set(int cx, int cy, COLORREF color=CLR_INVALID)
[設定] イメージ設定.
bool ReleaseDC(void)
[設定] デバイスコンテキストハンドル返却.
bool Draw(HDC hdc, int x=0, int y=0) const
[処理] イメージ描画.
bool SemitransparectBlt(HDC hdc, int x, int y, int parsent=100, COLORREF color=CLR_AUTOSELECT) const
[挿入] 半透明,透過イメージ描画.
void SetBkMode(int mode)
[設定] 背景モード設定.
void SelectFont(HFONT font)
[選択] フォント選択.
bool SetSystemCaptionFont(void)
[設定] キャプションバーフォント設定.
bool IsNull(void) const
[確認] NULLチェック
static bool DrawTextRect(RECT &_rect, HDC dc, DWORD drawStyle, const POINT &offset, COLORREF color1, COLORREF color2, LPCTSTR str)
[表示] 範囲文字表示.
LRESULT SendMessage(UINT message, WPARAM wParam, LPARAM lParam)
[処理] SendMessage.
BOOL PostMessage(UINT message, WPARAM wParam, LPARAM lParam)
[処理] PostMessage.
HWND GetSafeHwnd(void) const
[取得] ウィンドウハンドル取得
const TYP * Ref(void) const
[取得] ポインタ取得
bool SetSelectMarkDrawer(const IDrawable &draw, ESelectMarkType type=OVERLAP)
[設定] 選択マーク描画指定.
bool SetBackgroundDrawer(const IDrawable &draw)
[設定] 背景描画指定.
void SetFrameBitmap(CBitmapHandle bmp)
[設定] フレームビットマップ設定
void SetMinimumButtonBitmap(const POINT &pos, CBitmapHandle bmp, int num=4, COLORREF color=CLR_INVALID)
[設定] Minimumボタン設定
void SetRestoreButtonBitmap(const POINT &pos, CBitmapHandle bmp, int num=4, COLORREF color=CLR_INVALID)
[設定] Restoreボタン設定
CDrawingMenu & ReferPopupMenu(void)
[参照] メニューバー参照.
void SetFrameTransColor(COLORREF color=CLR_AUTOSELECT)
[設定] 透過色指定
CDrawingMenuBar & ReferMenuBar(void)
[参照] メニューバー参照.
void SetMaximumButtonBitmap(const POINT &pos, CBitmapHandle bmp, int num=4, COLORREF color=CLR_INVALID)
[設定] Maximumボタン設定
CCustomWindowFrame(void)
コンストラクタ
void SetFrameBitmap(CBitmapHandle bmp1, CBitmapHandle bmp2)
[設定] フレームビットマップ設定
void SetHelpButtonBitmap(const POINT &pos, CBitmapHandle bmp, int num=4, COLORREF color=CLR_INVALID)
[設定] Helpボタン設定
virtual void OnDetacted(void)
[通知] デタッチ通知.
virtual void PreAttach(HWND hWnd)
[通知] アタッチ直前通知
HBRUSH GetBackground(bool isActive)
[取得] 背景ブラシ取得
void SetTitleBitmap(const IDrawable &draw)
[設定] タイトルバー描画情報指定.
virtual void OnAttached(void)
[通知] アタッチ通知.
void SetCloseButtonBitmap(const POINT &pos, CBitmapHandle bmp, int num=4, COLORREF color=CLR_INVALID)
[設定] Closeボタン設定
~CCustomWindowFrame(void)
デストラクタ
void CopyParameter(const CCustomWindowFrame &o)
[設定] 設定の複製.
void SetTextColor(COLORREF color)
[設定] テキスト色.
virtual void PreDetach(void)
[通知] デタッチ直前通知.
void SetFrameBitmap(const IDrawable &draw, CBitmapHandle bmp)
[設定] フレームビットマップ設定
void SetFrameWidths(int frameWidth=-1, int titleHeight=-1)
[設定] 大きさ設定.
void SetFrameWidths(const RECT &frameWidths, int titleHeight=-1)
[設定] 大きさ設定.
CWindowCaptionDrawer(HWND hWnd)
コンストラクタ
void SetTextColor(COLORREF c1, COLORREF c2)
[設定] 文字の色指定.
void SetBarEllipse(int widthEllipse=5, int heightEllipse=5)
[設定] バーの丸み指定
virtual IDrawable * Clone(void) const
[作成] クローン作成.
void SetBarColor(COLORREF c1, COLORREF c2)
[設定] バーの色指定.
virtual void DrawEx(HDC dc, int x, int y, LPARAM lParam) const
[描画] 描画.
virtual bool Resize(const SIZE &size)=0
[設定] サイズ設定.
virtual bool GetSize(SIZE &_size) const =0
[取得] サイズ取得.
virtual IDrawable * Clone(void) const =0
[作成] クローン作成.
virtual void DrawEx(HDC dc, int x, int y, LPARAM lParam) const
[描画] 描画.