14 #include "../WinAPI/cWinAtom.h"
35 cWinMsg(
WINMSG_t uMsg, WPARAM wParam = 0, LPARAM lParam = 0) noexcept
36 : m_uMsg(uMsg), m_wParam(wParam), m_lParam(lParam)
39 cWinMsg(
WINMSG_t uMsg, WPARAM wParam,
const void* lParam) noexcept
40 : m_uMsg(uMsg), m_wParam(wParam), m_lParam((LPARAM)lParam)
43 cWinMsg(
WINMSG_t uMsg, WPARAM wParam, WPARAM a, WPARAM b) noexcept
44 : m_uMsg(uMsg), m_wParam(wParam), m_lParam(MAKELPARAM(a, b))
49 POINT get_Point() const noexcept
65 cWinClassHandle(ATOM a = INVALID_ATOM) noexcept
69 bool GetInfo(HINSTANCE hInstance,
_GTN(WNDCLASS)* pWC)
const
71 return _GTN(::GetClassInfo)(hInstance, get_IntAtom(), pWC);
74 bool GetInfoEx(HINSTANCE hInstance,
_GTN(WNDCLASSEX)* pWC)
const
76 return _GTN(::GetClassInfoEx)(hInstance, get_IntAtom(), pWC);
79 bool Unregister(HINSTANCE hInstance)
81 return _GTN(::UnregisterClass)(get_IntAtom(), hInstance);
101 static cWinClassHandle sm_aClassNameDefault;
116 bool AttachHwnd(HWND hWnd)
118 if (hWnd == get_Hwnd())
121 return SUPER_t::AttachHwnd(hWnd);
124 static LRESULT WINAPI WndProc(HWND hWnd,
WINMSG_t message, WPARAM wParam, LPARAM lParam);
125 virtual LRESULT WindowProc(
WINMSG_t message, WPARAM wParam, LPARAM lParam);
127 static ATOM
GRAYCALL RegisterClassX(
_GTN(WNDCLASS)* pWC);
128 static ATOM
GRAYCALL RegisterClassX(
const GChar_t* pszClassName, UINT uStyleFlags = CS_DBLCLKS, HICON hIcon =
WINHANDLE_NULL, HBRUSH hBrushBack = (HBRUSH)(COLOR_WINDOW + 1));
129 static bool GRAYCALL RegisterClassNameDefault();
131 #if defined(UNDER_CE)
132 static const DWORD k_nStyleDef = WS_VISIBLE;
134 static const DWORD k_nStyleDef = WS_OVERLAPPEDWINDOW | WS_VISIBLE;
136 bool CreateWindowDef(
const GChar_t* pszTitle =
nullptr, DWORD dwStyle = k_nStyleDef,
int x = CW_USEDEFAULT,
int y = CW_USEDEFAULT,
int cx = CW_USEDEFAULT,
int cy = CW_USEDEFAULT, HWND hWndParent =
WINHANDLE_NULL, HMENU hMenuOrChildId =
WINHANDLE_NULL);
#define GRAYCALL
declare calling convention for static functions so everyone knows the arg passing scheme....
Definition: GrayCore.h:36
#define GRAYLIB_LINK
Definition: GrayLibBase.h:35
#define _GTN(c)
_WIN32 name has a A or W for UTF8 or UNICODE (like _FNF)
Definition: StrConst.h:28
UINT WINMSG_t
Supplement _WIN32 "windows.h".
Definition: WinTypes.h:111
#define WINHANDLE_NULL
HWND, HPEN, etc are NOT OS Handles. like HWND_DESKTOP. like HANDLEPTR_NULL. This is a WINAPI void* ha...
Definition: cOSHandle.h:23
static const GChar_t *const k_pszClassNameDefault
Definition: cWindow.h:97
cWindow(HWND hWnd=WINHANDLE_NULL) noexcept
Definition: cWindow.h:105
Definition: cWndHandle.h:26
UNITTEST2_PREDEF(cQuadtree)
char GChar_t
My version of TCHAR, _TCHAR.
Definition: StrConst.h:26