2

I am new to ImGui, and trying to set the max and min window size. I am using the example dx10 ImGui code. I understand that this line will set the width and hight of the window at the start to be 600*800:

HWND hwnd = ::CreateWindowW(wc.lpszClassName, L"Micheal's Application", WS_OVERLAPPEDWINDOW, 100, 100, 600, 800, NULL, NULL, wc.hInstance, NULL);

How do I disable the user's ability to resize this window?

Micheal Nestor
  • 91
  • 1
  • 10
  • Dear ImGui is a UI llibrary. The code you posted has nothing to do with ImGui, but window creation via the Win32 library. – Casey Dec 11 '22 at 14:31

1 Answers1

1

WS_OVERLAPPEDWINDOW is defined as

(WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX)

where

WS_THICKFRAME   0x00040000L The window has a sizing border. Same as the WS_SIZEBOX style.

So, you need to clear WS_THICKFRAME bit in the window style:

WS_OVERLAPPEDWINDOW & ~WS_THICKFRAME
dewaffled
  • 2,850
  • 2
  • 17
  • 30