Skip to content

Commit

Permalink
Reduce title bar height and improve non-client area handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Zingzy committed Dec 29, 2024
1 parent 9152aff commit 9ca9045
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions hPyT/hPyT.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@
WM_NCACTIVATE = 0x0086
WM_NCPAINT = 0x0085

TITLE_BAR_HEIGHT_REDUCTION = 7

SWP_NOZORDER = 4
SWP_NOMOVE = 2
SWP_NOSIZE = 1
Expand Down Expand Up @@ -99,9 +101,13 @@ def handle(hwnd: int, msg: int, wp: int, lp: int) -> int:
if msg == WM_NCCALCSIZE and wp:
# Adjust the non-client area (title bar) size
lpncsp = NCCALCSIZE_PARAMS.from_address(lp)
lpncsp.rgrc[0].top -= 6 # Adjust the top boundary to hide the title bar
lpncsp.rgrc[
0
].top -= (
TITLE_BAR_HEIGHT_REDUCTION # Reduce the height of the title bar
)

elif msg == WM_NCACTIVATE or msg == WM_NCPAINT:
elif msg in [WM_NCACTIVATE, WM_NCPAINT]:
# Prevent Windows from drawing the title bar when the window is activated or painted
return 1 # Tell Windows not to process further

Expand Down

0 comments on commit 9ca9045

Please sign in to comment.