How to disable frame (and titlebar) but keep resizing and snap features when using SendMessage to drag the window?

Stanlyhalo 0 Reputation points
2024-11-19T04:56:46.9233333+00:00

I'm trying to disable the titlebar (and frame), but keep the ability to resize the window and have it so the snap layouts work when triggering SendMessage. I have the trigger work, but when I remove all the bit flags returned from GetWindowLong that gets it to disable the whole frame, none of the native windows features work when I drag my window anymore. So I'm completely lost at the moment on this issue. Does anyone have any solutions they've come up with to disable the frame but keep resizing and/or at least have it so when I drag using SendMessage the snap feature doesn't go away? Also lastly, I do use glfw, but I've been using the function to grab the hwnd and I'm able to add the custom window process using:

SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR)WindowProc);  
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,666 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,774 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Castorix31 86,046 Reputation points
    2024-11-19T09:14:16.9333333+00:00

    The WS_THICKFRAME | WS_MAXIMIZEBOX styles must be set for Snap.

    To remove caption + frame, with DWM (https://learn.microsoft.com/en-us/windows/win32/dwm/customframe) or by handling WM_NCCALCSIZE + WM_NCHITTEST

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.