WNDPROC SetWndProc(WNDPROC wndproc) { AssertThread(); return (WNDPROC)::SetWindowLongPtr(hWnd, GWLP_WNDPROC, (LONG_PTR)wndproc); }
void SetCapture() { AssertNoneLocked(); AssertThread(); ::SetCapture(hWnd); }
void ReleaseCapture() { AssertNoneLocked(); AssertThread(); ::ReleaseCapture(); }
void SetFocus() { AssertNoneLocked(); AssertThread(); ::SetFocus(hWnd); }
void FocusParent() { AssertNoneLocked(); AssertThread(); ::SetFocus(::GetParent(hWnd)); }
void Show() { AssertThread(); ::ShowWindow(hWnd, SW_SHOW); }
void Hide() { AssertThread(); ::ShowWindow(hWnd, SW_HIDE); }
bool IsDown() const { AssertNoneLocked(); AssertThread(); return (Button_GetState(hWnd) & BST_PUSHED) != 0; }
const Font &GetFont() const { AssertThread(); assert(font != nullptr); return *font; }
/** * Returns the parent's client area rectangle. */ #ifdef USE_WINUSER gcc_pure PixelRect GetParentClientRect() const { assert(IsDefined()); HWND hParent = ::GetParent(hWnd); assert(hParent != nullptr); PixelRect rc; ::GetClientRect(hParent, &rc); return rc; } #else gcc_pure PixelRect GetParentClientRect() const; #endif #ifndef USE_WINUSER virtual void Invalidate(); #else /* USE_WINUSER */ HDC BeginPaint(PAINTSTRUCT *ps) { AssertThread(); return ::BeginPaint(hWnd, ps); }
void EndPaint(PAINTSTRUCT *ps) { AssertThread(); ::EndPaint(hWnd, ps); }
void SetUserData(void *value) { AssertThread(); ::SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG_PTR)value); }
void ReleaseCapture() { AssertThread(); ::ReleaseCapture(); }
void SetCapture() { AssertThread(); ::SetCapture(hWnd); }
void SetFocus() { AssertThread(); ::SetFocus(hWnd); }
bool is_down() const { assert_none_locked(); AssertThread(); return (Button_GetState(hWnd) & BST_PUSHED) != 0; }