Skip to content
This repository has been archived by the owner on Dec 19, 2023. It is now read-only.

Commit

Permalink
win: snap layout refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
wangwenx190 committed Aug 21, 2023
1 parent 469c686 commit 6442669
Show file tree
Hide file tree
Showing 2 changed files with 213 additions and 148 deletions.
60 changes: 60 additions & 0 deletions include/FramelessHelper/Core/framelesshelper_windows.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,30 @@
# define ABM_GETAUTOHIDEBAREX (0x0000000b)
#endif

#ifndef MAKEWORD
# define MAKEWORD(a, b) ((WORD)(((BYTE)(((DWORD_PTR)(a)) & 0xff)) | ((WORD)((BYTE)(((DWORD_PTR)(b)) & 0xff))) << 8))
#endif

#ifndef MAKELONG
# define MAKELONG(a, b) ((LONG)(((WORD)(((DWORD_PTR)(a)) & 0xffff)) | ((DWORD)((WORD)(((DWORD_PTR)(b)) & 0xffff))) << 16))
#endif

#ifndef LOWORD
# define LOWORD(l) ((WORD)(((DWORD_PTR)(l)) & 0xffff))
#endif

#ifndef HIWORD
# define HIWORD(l) ((WORD)((((DWORD_PTR)(l)) >> 16) & 0xffff))
#endif

#ifndef LOBYTE
# define LOBYTE(w) ((BYTE)(((DWORD_PTR)(w)) & 0xff))
#endif

#ifndef HIBYTE
# define HIBYTE(w) ((BYTE)((((DWORD_PTR)(w)) >> 8) & 0xff))
#endif

#ifndef GET_X_LPARAM
# define GET_X_LPARAM(lp) (static_cast<int>(static_cast<short>(LOWORD(lp))))
#endif
Expand All @@ -130,6 +154,42 @@
# define GET_Y_LPARAM(lp) (static_cast<int>(static_cast<short>(HIWORD(lp))))
#endif

#ifndef GET_KEYSTATE_WPARAM
# define GET_KEYSTATE_WPARAM(wParam) (LOWORD(wParam))
#endif

#ifndef GET_NCHITTEST_WPARAM
# define GET_NCHITTEST_WPARAM(wParam) (static_cast<short>(LOWORD(wParam)))
#endif

#ifndef GET_XBUTTON_WPARAM
# define GET_XBUTTON_WPARAM(wParam) (HIWORD(wParam))
#endif

#ifndef POINTSTOPOINT
# define POINTSTOPOINT(pt, pts) \
{ \
(pt).x = static_cast<LONG>(static_cast<SHORT>(LOWORD(*(LONG*)&pts))); \
(pt).y = static_cast<LONG>(static_cast<SHORT>(HIWORD(*(LONG*)&pts))); \
}
#endif

#ifndef POINTTOPOINTS
# define POINTTOPOINTS(pt) (MAKELONG(static_cast<short>((pt).x), static_cast<short>((pt).y)))
#endif

#ifndef MAKEWPARAM
# define MAKEWPARAM(l, h) (static_cast<WPARAM>(static_cast<DWORD>(MAKELONG(l, h))))
#endif

#ifndef MAKELPARAM
# define MAKELPARAM(l, h) (static_cast<LPARAM>(static_cast<DWORD>(MAKELONG(l, h))))
#endif

#ifndef MAKELRESULT
# define MAKELRESULT(l, h) (static_cast<LRESULT>(static_cast<DWORD>(MAKELONG(l, h))))
#endif

#ifndef IsMinimized
# define IsMinimized(hwnd) (::IsIconic(hwnd) != FALSE)
#endif
Expand Down
Loading

0 comments on commit 6442669

Please sign in to comment.