What is the default/preferred size of the hit-test area for resizing a window?

thebluetropics 1,046 Reputation points
2022-10-29T10:50:49.95+00:00

I am trying to replace the standard window frame with a custom window frame using DWM.
It seems I need to handle the WM_NCHITTEST.

What is the default, preferred size of "window resize" hit-test area?

An illustration is shown in this image:

255304-image.png

[Red] Left and Right
[Blue] Top and Bottom
[Green] Corners

But I have tested other applications too, it seems most of these windows uses this layout:

255341-image.png

Is this true?

What is the preferred size of the hit-test borders and corners:

  • top, left, bottom, right
  • corners

My guess is 8px each.

I also see other apps uses this layout too:

255296-image.png

I have an assumption that image 2 and image 3 is a matter of preference, depends of the application interface layout itself...

Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,523 questions
C++
C++
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,636 questions
{count} vote