SimpleWindow
载入中...
搜索中...
未找到
WndBase.h
1#pragma once
2
3#include "App.h"
4#include "Cursor.h"
5#include "Delegate.h"
6#include "Dip.h"
7#include "Font.h"
8#include "HitTestResult.h"
9#include "IComparable.h"
10#include "IToString.h"
11#include "Keys.h"
12#include "ObservableObject.h"
13#include "Point.h"
14#include "ProcMsg.h"
15#include "Property.h"
16#include "Rect.h"
17#include "Size.h"
18#include "WndMsg.h"
19#include <Windows.h>
20#include <string>
21#include <type_traits>
22#include <windowsx.h>
23
24namespace sw
25{
26 class UIElement; // UIElement.h
27 class Control; // Control.h
28 class Window; // Window.h
29
33 using SimpleAction = Action<>;
34
38 class WndBase : public ObservableObject,
39 public IToString<WndBase>,
40 public IEqualityComparable<WndBase>
41 {
42 // 部分控件可能会改变HWND,设为友元类向Control类暴露_hwnd字段
43 friend class Control;
44
45 // HwndWrapper不使用InitWindow或InitControl初始化句柄,向其暴露底层细节以便实现相关功能
46 friend class HwndWrapper;
47
48 private:
52 const uint32_t _check;
53
57 HWND _hwnd = NULL;
58
62 HFONT _hfont = NULL;
63
67 sw::Font _font;
68
72 sw::Rect _rect{};
73
77 std::wstring _text{};
78
82 bool _focused = false;
83
87 bool _isDestroyed = false;
88
92 bool _isControl = false;
93
97 WNDPROC _originalWndProc = NULL;
98
99 public:
104
109
114
119
124
129
134
139
144
149
154
159
164
169
174
179
184
189
194
199
204
209
215
220
221 protected:
226
227 WndBase(const WndBase &) = delete; // 删除拷贝构造函数
228 WndBase(WndBase &&) = delete; // 删除移动构造函数
229 WndBase &operator=(const WndBase &) = delete; // 删除拷贝赋值运算符
230 WndBase &operator=(WndBase &&) = delete; // 删除移动赋值运算符
231
232 public:
236 virtual ~WndBase() = 0;
237
243
248 virtual Control *ToControl();
249
254 virtual Window *ToWindow();
255
259 bool Equals(const WndBase &other) const;
260
264 virtual std::wstring ToString() const;
265
266 protected:
270 void InitWindow(LPCWSTR lpWindowName, DWORD dwStyle, DWORD dwExStyle);
271
275 void InitControl(LPCWSTR lpClassName, LPCWSTR lpWindowName, DWORD dwStyle, DWORD dwExStyle, LPVOID lpParam = NULL);
276
280 LRESULT DefaultWndProc(const ProcMsg &msg);
281
285 virtual LRESULT WndProc(ProcMsg &refMsg);
286
291 virtual std::wstring &GetInternalText();
292
297 virtual void SetInternalText(const std::wstring &value);
298
303 virtual bool OnCreate();
304
309 virtual bool OnClose();
310
315 virtual bool OnDestroy();
316
321 virtual bool OnPaint();
322
326 virtual void OnEndPaint();
327
333 virtual bool OnNcPaint(HRGN hRgn);
334
338 virtual void OnEndNcPaint();
339
345 virtual bool OnMove(const Point &newClientPosition);
346
352 virtual bool OnSize(const Size &newClientSize);
353
357 virtual void OnTextChanged();
358
364 virtual bool OnSetFocus(HWND hPrevFocus);
365
371 virtual bool OnKillFocus(HWND hNextFocus);
372
379 virtual bool OnMouseMove(const Point &mousePosition, MouseKey keyState);
380
385 virtual bool OnMouseLeave();
386
394 virtual bool OnMouseWheel(int wheelDelta, const Point &mousePosition, MouseKey keyState);
395
402 virtual bool OnMouseLeftButtonDown(const Point &mousePosition, MouseKey keyState);
403
410 virtual bool OnMouseLeftButtonUp(const Point &mousePosition, MouseKey keyState);
411
418 virtual bool OnMouseLeftButtonDoubleClick(const Point &mousePosition, MouseKey keyState);
419
426 virtual bool OnMouseRightButtonDown(const Point &mousePosition, MouseKey keyState);
427
434 virtual bool OnMouseRightButtonUp(const Point &mousePosition, MouseKey keyState);
435
442 virtual bool OnMouseRightButtonDoubleClick(const Point &mousePosition, MouseKey keyState);
443
450 virtual bool OnMouseMiddleButtonDown(const Point &mousePosition, MouseKey keyState);
451
458 virtual bool OnMouseMiddleButtonUp(const Point &mousePosition, MouseKey keyState);
459
466 virtual bool OnMouseMiddleButtonDoubleClick(const Point &mousePosition, MouseKey keyState);
467
474 virtual bool OnChar(wchar_t ch, const KeyFlags &flags);
475
482 virtual bool OnDeadChar(wchar_t ch, const KeyFlags &flags);
483
490 virtual bool OnKeyDown(VirtualKey key, const KeyFlags &flags);
491
498 virtual bool OnKeyUp(VirtualKey key, const KeyFlags &flags);
499
506 virtual bool OnSysChar(wchar_t ch, const KeyFlags &flags);
507
514 virtual bool OnSysDeadChar(wchar_t ch, const KeyFlags &flags);
515
522 virtual bool OnSysKeyDown(VirtualKey key, const KeyFlags &flags);
523
530 virtual bool OnSysKeyUp(VirtualKey key, const KeyFlags &flags);
531
535 virtual void VisibleChanged(bool newVisible);
536
541 virtual bool SetParent(WndBase *parent);
542
547 virtual void ParentChanged(WndBase *newParent);
548
553 virtual void OnCommand(int code);
554
561 virtual void OnControlCommand(WndBase *pControl, int code, int id);
562
567 virtual void OnMenuCommand(int id);
568
573 virtual void OnAcceleratorCommand(int id);
574
579 virtual void HandleInitialized(HWND hwnd);
580
585 virtual void FontChanged(HFONT hfont);
586
595 virtual bool OnSetCursor(HWND hwnd, HitTestResult hitTest, int message, bool &result);
596
603 virtual bool OnContextMenu(bool isKeyboardMsg, const Point &mousePosition);
604
613 virtual bool OnMenuSelect(HMENU hMenu, int id, int flags);
614
621 virtual bool OnNotify(NMHDR *pNMHDR, LRESULT &result);
622
629 virtual bool OnNotified(NMHDR *pNMHDR, LRESULT &result);
630
637 virtual bool OnVerticalScroll(int event, int pos);
638
645 virtual bool OnHorizontalScroll(int event, int pos);
646
652 virtual bool OnEnabledChanged(bool newValue);
653
661 virtual bool OnCtlColor(WndBase *pControl, HDC hdc, HBRUSH &hRetBrush);
662
669 virtual bool OnColor(HDC hdc, HBRUSH &hRetBrush);
670
676 virtual void OnNcHitTest(const Point &testPoint, HitTestResult &result);
677
684 virtual bool OnEraseBackground(HDC hdc, LRESULT &result);
685
692 virtual bool OnDrawItem(int id, DRAWITEMSTRUCT *pDrawItem);
693
699 virtual bool OnDrawItemSelf(DRAWITEMSTRUCT *pDrawItem);
700
707 virtual bool OnMeasureItem(int id, MEASUREITEMSTRUCT *pMeasure);
708
714 virtual bool OnMeasureItemSelf(MEASUREITEMSTRUCT *pMeasure);
715
721 virtual bool OnDropFiles(HDROP hDrop);
722
723 public:
728
733
737 void Show(int nCmdShow);
738
742 void Close();
743
747 void Update();
748
753
758
764 void Redraw(bool erase = false, bool updateWindow = false);
765
769 bool IsVisible() const;
770
774 DWORD GetStyle() const;
775
779 void SetStyle(DWORD style);
780
785 bool GetStyle(DWORD mask) const;
786
792 void SetStyle(DWORD mask, bool value);
793
797 DWORD GetExtendedStyle() const;
798
802 void SetExtendedStyle(DWORD style);
803
808 bool GetExtendedStyle(DWORD mask);
809
815 void SetExtendedStyle(DWORD mask, bool value);
816
822 Point PointToScreen(const Point &point) const;
823
829 Point PointFromScreen(const Point &screenPoint) const;
830
834 LRESULT SendMessageA(UINT uMsg, WPARAM wParam, LPARAM lParam);
835
839 LRESULT SendMessageW(UINT uMsg, WPARAM wParam, LPARAM lParam);
840
844 BOOL PostMessageA(UINT uMsg, WPARAM wParam, LPARAM lParam);
845
849 BOOL PostMessageW(UINT uMsg, WPARAM wParam, LPARAM lParam);
850
855 HitTestResult NcHitTest(const Point &testPoint);
856
861 void Invoke(const SimpleAction &action);
862
867 void InvokeAsync(const SimpleAction &action);
868
872 DWORD GetThreadId() const;
873
877 bool CheckAccess() const;
878
882 bool CheckAccess(const WndBase &other) const;
883
884 public:
890 static WndBase *GetWndBase(HWND hwnd) noexcept;
891
895 static bool IsPtrValid(const WndBase *ptr) noexcept;
896
897 private:
901 static LRESULT CALLBACK _WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
902
906 static WndBase *_GetControlInitContainer();
907
911 static int _NextControlId();
912
918 static void _SetWndBase(HWND hwnd, WndBase &wnd);
919
920 public:
926 template <typename TDerived, typename TProperty>
927 auto GetProperty(TProperty TDerived::*prop)
928 -> typename std::enable_if<
929 std::is_base_of<WndBase, TDerived>::value && _IsReadableProperty<TProperty>::value,
930 typename TProperty::TValue>::type
931 {
932 auto getter = Reflection::GetPropertyGetter(prop);
933 return getter(*this);
934 }
935
941 template <typename TDerived, typename TProperty>
942 auto SetProperty(TProperty TDerived::*prop, typename TProperty::TSetterParam value)
943 -> typename std::enable_if<
944 std::is_base_of<WndBase, TDerived>::value && _IsWritableProperty<TProperty>::value>::type
945 {
946 auto setter = Reflection::GetPropertySetter(prop);
947 setter(*this, std::forward<typename TProperty::TSetterParam>(value));
948 }
949 };
950}
控件
Definition Control.h:12
Definition Delegate.h:21
字体类
Definition Font.h:137
将Win32 window包装为SimpleWindow对象
Definition HwndWrapper.h:12
相等性比较接口
Definition IComparable.h:14
为支持ToString方法的类提供统一接口
Definition IToString.h:13
可观察对象基类,实现属性更改通知功能
Definition ObservableObject.h:14
属性
Definition Property.h:1743
只读属性
Definition Property.h:1828
static auto GetPropertySetter(TProperty T::*prop) -> typename std::enable_if< std::is_base_of< DynamicObject, T >::value &&_IsWritableProperty< TProperty >::value, Delegate< void(DynamicObject &, typename TProperty::TSetterParam)> >::type
获取属性的Setter委托
Definition Reflection.h:354
static auto GetPropertyGetter(TProperty T::*prop) -> typename std::enable_if< std::is_base_of< DynamicObject, T >::value &&_IsReadableProperty< TProperty >::value, Delegate< typename TProperty::TValue(DynamicObject &)> >::type
获取属性的Getter委托
Definition Reflection.h:318
表示界面中的元素
Definition UIElement.h:90
窗口
Definition Window.h:35
表示一个Windows窗口,是所有窗口和控件的基类
Definition WndBase.h:41
const ReadOnlyProperty< sw::Rect > ClientRect
用户区尺寸
Definition WndBase.h:153
virtual bool OnPaint()
接收到WM_PAINT时调用该函数
void SetExtendedStyle(DWORD mask, bool value)
打开或关闭指定的扩展样式
void SetExtendedStyle(DWORD style)
设置扩展窗口样式
bool CheckAccess(const WndBase &other) const
判断当前对象所属线程是否与另一个WndBase对象所属线程相同
virtual bool OnMouseWheel(int wheelDelta, const Point &mousePosition, MouseKey keyState)
接收到WM_MOUSEWHEEL时调用该函数
virtual bool OnClose()
接收到WM_CLOSE时调用该函数
virtual bool OnMenuSelect(HMENU hMenu, int id, int flags)
接收到WM_MENUSELECT后调用该函数
bool Equals(const WndBase &other) const
判断当前对象与另一个WndBase是否相等
virtual bool OnMeasureItemSelf(MEASUREITEMSTRUCT *pMeasure)
父窗口接收到WM_MEASUREITEM后且父窗口OnMeasureItem函数返回false时调用发出通知控件的该函数
virtual void OnNcHitTest(const Point &testPoint, HitTestResult &result)
接收到WM_NCHITTEST后调用该函数
virtual bool OnMouseRightButtonDown(const Point &mousePosition, MouseKey keyState)
接收到WM_RBUTTONDOWN时调用该函数
virtual bool OnSysKeyDown(VirtualKey key, const KeyFlags &flags)
接收到WM_SYSKEYDOWN时调用该函数
static bool IsPtrValid(const WndBase *ptr) noexcept
检查指针是否指向有效的WndBase对象
virtual void SetInternalText(const std::wstring &value)
修改窗口文本,该函数默认实现为调用SetWindowTextW
virtual LRESULT WndProc(ProcMsg &refMsg)
对WndProc的封装
Point PointToScreen(const Point &point) const
获取用户区点在屏幕上点的位置
bool GetExtendedStyle(DWORD mask)
判断窗口是否设有指定扩展样式
virtual Window * ToWindow()
尝试将对象转换成Window
HFONT GetFontHandle()
获取字体句柄
LRESULT SendMessageA(UINT uMsg, WPARAM wParam, LPARAM lParam)
发送消息(ASCII)
void SetStyle(DWORD mask, bool value)
打开或关闭指定的样式
bool CheckAccess() const
判断当前线程是否为窗口所属线程
void Invoke(const SimpleAction &action)
在窗口线程上执行指定委托
const ReadOnlyProperty< std::wstring > ClassName
窗口类名
Definition WndBase.h:208
virtual bool OnMouseRightButtonUp(const Point &mousePosition, MouseKey keyState)
接收到WM_RBUTTONUP时调用该函数
const ReadOnlyProperty< double > ClientHeight
用户区高度
Definition WndBase.h:163
void Close()
发送关闭消息
const Property< bool > AcceptFiles
是否接受拖放文件
Definition WndBase.h:198
virtual bool OnMouseLeftButtonDown(const Point &mousePosition, MouseKey keyState)
接收到WM_LBUTTONDOWN时调用该函数
const Property< double > Width
宽度
Definition WndBase.h:143
Point PointFromScreen(const Point &screenPoint) const
获取屏幕上点在当前用户区点的位置
virtual bool OnMouseLeftButtonUp(const Point &mousePosition, MouseKey keyState)
接收到WM_LBUTTONUP时调用该函数
void InitWindow(LPCWSTR lpWindowName, DWORD dwStyle, DWORD dwExStyle)
初始化为窗口,该函数会调用CreateWindowExW
BOOL PostMessageA(UINT uMsg, WPARAM wParam, LPARAM lParam)
发送消息(ASCII)并立即返回
virtual bool OnSetFocus(HWND hPrevFocus)
接收到WM_SETFOCUS时调用该函数
virtual void HandleInitialized(HWND hwnd)
窗口句柄初始化完成
const ReadOnlyProperty< bool > IsControl
当前对象是否是控件
Definition WndBase.h:203
virtual void ParentChanged(WndBase *newParent)
父窗口改变时调用此函数
virtual void OnEndNcPaint()
在OnNcPaint函数完成之后调用该函数
virtual bool OnMeasureItem(int id, MEASUREITEMSTRUCT *pMeasure)
接收到WM_MEASUREITEM时调用该函数
const Property< double > Left
左边
Definition WndBase.h:133
const Property< sw::FontWeight > FontWeight
字体粗细
Definition WndBase.h:123
virtual bool OnSysKeyUp(VirtualKey key, const KeyFlags &flags)
接收到WM_SYSKEYUP时调用该函数
const Property< double > Height
高度
Definition WndBase.h:148
const Property< sw::Font > Font
字体
Definition WndBase.h:108
virtual bool OnNcPaint(HRGN hRgn)
接收到WM_NCPAINT时调用该函数
const ReadOnlyProperty< bool > IsDestroyed
是否已销毁,当该值为true时不应该继续使用当前对象
Definition WndBase.h:193
virtual bool OnMouseMiddleButtonDown(const Point &mousePosition, MouseKey keyState)
接收到WM_MBUTTONDOWN时调用该函数
virtual bool OnKeyUp(VirtualKey key, const KeyFlags &flags)
接收到WM_KEYUP时调用该函数
const Property< bool > IsGroupStart
窗口是否为一组控件中的第一个控件
Definition WndBase.h:214
virtual bool SetParent(WndBase *parent)
设置父窗口
virtual bool OnNotified(NMHDR *pNMHDR, LRESULT &result)
父窗口接收到WM_NOTIFY后且父窗口OnNotify函数返回false时调用发出通知控件的该函数
virtual void OnCommand(int code)
当父窗口接收到控件的WM_COMMAND时调用该函数
virtual bool OnChar(wchar_t ch, const KeyFlags &flags)
接收到WM_CHAR时调用该函数
auto GetProperty(TProperty TDerived::*prop) -> typename std::enable_if< std::is_base_of< WndBase, TDerived >::value &&_IsReadableProperty< TProperty >::value, typename TProperty::TValue >::type
获取属性值
Definition WndBase.h:927
virtual bool OnSysChar(wchar_t ch, const KeyFlags &flags)
接收到WM_SYSCHAR时调用该函数
const ReadOnlyProperty< bool > IsMouseCaptured
鼠标是否被当前窗口捕获
Definition WndBase.h:219
virtual std::wstring & GetInternalText()
获取内部记录窗口文本的字符串引用
virtual void OnControlCommand(WndBase *pControl, int code, int id)
当WM_COMMAND接收到控件命令时调用该函数
virtual bool OnMouseRightButtonDoubleClick(const Point &mousePosition, MouseKey keyState)
接收到WM_RBUTTONDBLCLK时调用该函数
void Redraw(bool erase=false, bool updateWindow=false)
重画
virtual ~WndBase()=0
析构函数,这里用纯虚函数使该类成为抽象类
const Property< double > Top
顶边
Definition WndBase.h:138
virtual bool OnKillFocus(HWND hNextFocus)
接收到WM_KILLFOCUS时调用该函数
virtual bool OnDrawItem(int id, DRAWITEMSTRUCT *pDrawItem)
接收到WM_DRAWITEM时调用该函数
const Property< bool > Focused
窗口是否拥有焦点
Definition WndBase.h:183
virtual bool OnVerticalScroll(int event, int pos)
接收到WM_VSCROLL时调用目标控件的该函数
const Property< std::wstring > FontName
字体名称
Definition WndBase.h:113
virtual bool OnEnabledChanged(bool newValue)
接收到WM_ENABLE时调用该函数
const Property< sw::Rect > Rect
位置和尺寸
Definition WndBase.h:128
virtual bool OnDrawItemSelf(DRAWITEMSTRUCT *pDrawItem)
父窗口接收到WM_DRAWITEM后且父窗口OnDrawItem函数返回false时调用发出通知控件的该函数
const ReadOnlyProperty< WndBase * > Parent
父窗口
Definition WndBase.h:188
virtual bool OnCreate()
接收到WM_CREATE时调用该函数
const Property< bool > Visible
窗口或控件是否可见
Definition WndBase.h:173
virtual bool OnMouseMove(const Point &mousePosition, MouseKey keyState)
接收到WM_MOUSEMOVE时调用该函数
HitTestResult NcHitTest(const Point &testPoint)
测试指定点在窗口的哪一部分
static WndBase * GetWndBase(HWND hwnd) noexcept
通过窗口句柄获取WndBase
void UpdateInternalRect()
同步窗口位置和尺寸到内部记录的Rect
DWORD GetThreadId() const
获取当前窗口所属线程的线程id
virtual void OnAcceleratorCommand(int id)
当WM_COMMAND接收到快捷键命令时调用该函数
bool IsVisible() const
判断当前对象在界面中是否可视,与Visible属性不同的是该函数返回值会受父窗口的影响
const ReadOnlyProperty< double > ClientWidth
用户区宽度
Definition WndBase.h:158
virtual bool OnMove(const Point &newClientPosition)
接收到WM_MOVE时调用该函数
virtual bool OnDestroy()
接收到WM_DESTROY时调用该函数
void InvokeAsync(const SimpleAction &action)
在窗口线程上执行指定委托,并立即返回
const Property< std::wstring > Text
窗口标题或控件文本
Definition WndBase.h:178
virtual bool OnDropFiles(HDROP hDrop)
接收到WM_DROPFILES时调用该函数
virtual bool OnCtlColor(WndBase *pControl, HDC hdc, HBRUSH &hRetBrush)
接收到WM_CTLCOLORxxx时调用该函数
LRESULT DefaultWndProc(const ProcMsg &msg)
调用默认的WndProc,对于窗口则调用DefWindowProcW,控件则调用_controlOldWndProc
virtual bool OnColor(HDC hdc, HBRUSH &hRetBrush)
父窗口接收到WM_CTLCOLORxxx时调用对应控件的该函数
WndBase()
初始化WndBase
virtual bool OnMouseLeave()
接收到WM_MOUSELEAVE时调用该函数
virtual bool OnSetCursor(HWND hwnd, HitTestResult hitTest, int message, bool &result)
接收到WM_SETCURSOR消息时调用该函数
void Update()
该函数调用UpdateWindow
bool GetStyle(DWORD mask) const
判断窗口是否设有指定样式
const ReadOnlyProperty< HWND > Handle
窗口句柄
Definition WndBase.h:103
virtual UIElement * ToUIElement()
尝试将对象转换成UIElement
virtual void FontChanged(HFONT hfont)
字体改变时调用该函数
DWORD GetExtendedStyle() const
获取扩展窗口样式
const Property< double > FontSize
字体大小
Definition WndBase.h:118
virtual bool OnMouseLeftButtonDoubleClick(const Point &mousePosition, MouseKey keyState)
接收到WM_LBUTTONDBLCLK时调用该函数
virtual bool OnContextMenu(bool isKeyboardMsg, const Point &mousePosition)
接收到WM_CONTEXTMENU后调用目标控件的该函数
virtual bool OnDeadChar(wchar_t ch, const KeyFlags &flags)
接收到WM_DEADCHAR时调用该函数
LRESULT SendMessageW(UINT uMsg, WPARAM wParam, LPARAM lParam)
发送消息(UNICODE)
const Property< bool > Enabled
窗口或控件是否可用
Definition WndBase.h:168
virtual void OnEndPaint()
在OnPaint函数完成之后调用该函数
virtual void OnTextChanged()
Text属性更改时调用此函数
void UpdateInternalText()
同步窗口文本到内部记录的字符串
void Show(int nCmdShow)
该函数调用ShowWindow
virtual Control * ToControl()
尝试将对象转换成Control
virtual bool OnMouseMiddleButtonDoubleClick(const Point &mousePosition, MouseKey keyState)
接收到WM_MBUTTONDBLCLK时调用该函数
BOOL PostMessageW(UINT uMsg, WPARAM wParam, LPARAM lParam)
发送消息(UNICODE)并立即返回
virtual bool OnSize(const Size &newClientSize)
接收到WM_SIZE时调用该函数
virtual bool OnSysDeadChar(wchar_t ch, const KeyFlags &flags)
接收到WM_SYSDEADCHAR时调用该函数
virtual bool OnNotify(NMHDR *pNMHDR, LRESULT &result)
接收到WM_NOTIFY后调用该函数
void InitControl(LPCWSTR lpClassName, LPCWSTR lpWindowName, DWORD dwStyle, DWORD dwExStyle, LPVOID lpParam=NULL)
初始化为控件,该函数会调用CreateWindowExW
virtual bool OnMouseMiddleButtonUp(const Point &mousePosition, MouseKey keyState)
接收到WM_MBUTTONUP时调用该函数
virtual void VisibleChanged(bool newVisible)
Visible属性改变时调用此函数
auto SetProperty(TProperty TDerived::*prop, typename TProperty::TSetterParam value) -> typename std::enable_if< std::is_base_of< WndBase, TDerived >::value &&_IsWritableProperty< TProperty >::value >::type
设置属性值
Definition WndBase.h:942
virtual std::wstring ToString() const
获取当前对象的描述字符串
virtual bool OnKeyDown(VirtualKey key, const KeyFlags &flags)
接收到WM_KEYDOWN时调用该函数
virtual bool OnHorizontalScroll(int event, int pos)
接收到WM_HSCROLL时调用目标控件的该函数
void UpdateFont()
更新字体
DWORD GetStyle() const
获取窗口样式
void SetStyle(DWORD style)
设置窗口样式
virtual bool OnEraseBackground(HDC hdc, LRESULT &result)
接收到WM_ERASEBKGND时调用该函数
virtual void OnMenuCommand(int id)
当WM_COMMAND接收到菜单命令时调用该函数
https://learn.microsoft.com/en-us/windows/win32/inputdev/about-keyboard-input#keystroke-message-flags
Definition Keys.h:12
表示相对于左上角的点坐标
Definition Point.h:15
对Windows窗口消息的封装
Definition ProcMsg.h:10
表示一个矩形区域
Definition Rect.h:17
尺寸
Definition Size.h:15
判断类型是否为可读属性的辅助模板
Definition Property.h:132
判断类型是否为可写属性的辅助模板
Definition Property.h:140