@@ -65,6 +65,8 @@ class WindowManager
6565 void WindowManager::SetSize (const flutter::EncodableMap &args);
6666 void WindowManager::SetMinimumSize (const flutter::EncodableMap &args);
6767 void WindowManager::SetMaximumSize (const flutter::EncodableMap &args);
68+ bool WindowManager::IsResizable ();
69+ void WindowManager::SetResizable (const flutter::EncodableMap &args);
6870 bool WindowManager::IsMinimizable ();
6971 void WindowManager::SetMinimizable (const flutter::EncodableMap &args);
7072 bool WindowManager::IsClosable ();
@@ -391,16 +393,20 @@ void WindowManager::SetMaximumSize(const flutter::EncodableMap &args)
391393 }
392394}
393395
394- bool WindowManager::IsAlwaysOnTop ()
396+ bool WindowManager::IsResizable ()
395397{
396- DWORD dwExStyle = GetWindowLong (GetMainWindow (), GWL_EXSTYLE);
397- return (dwExStyle & WS_EX_TOPMOST) != 0 ;
398+ HWND hWnd = GetMainWindow ();
399+ DWORD gwlStyle = GetWindowLong (hWnd, GWL_STYLE);
400+ return (gwlStyle & WS_THICKFRAME) != 0 ;
398401}
399402
400- void WindowManager::SetAlwaysOnTop (const flutter::EncodableMap &args)
403+ void WindowManager::SetResizable (const flutter::EncodableMap &args)
401404{
402- bool isAlwaysOnTop = std::get<bool >(args.at (flutter::EncodableValue (" isAlwaysOnTop" )));
403- SetWindowPos (GetMainWindow (), isAlwaysOnTop ? HWND_TOPMOST : HWND_NOTOPMOST, 0 , 0 , 0 , 0 , SWP_NOMOVE | SWP_NOSIZE);
405+ HWND hWnd = GetMainWindow ();
406+ bool isResizable = std::get<bool >(args.at (flutter::EncodableValue (" isResizable" )));
407+ DWORD gwlStyle = GetWindowLong (hWnd, GWL_STYLE);
408+ gwlStyle = isResizable ? gwlStyle | WS_THICKFRAME : gwlStyle & ~WS_THICKFRAME;
409+ SetWindowLong (hWnd, GWL_STYLE, gwlStyle);
404410}
405411
406412bool WindowManager::IsMinimizable ()
@@ -418,6 +424,7 @@ void WindowManager::SetMinimizable(const flutter::EncodableMap &args)
418424 gwlStyle = isMinimizable ? gwlStyle | WS_MINIMIZEBOX : gwlStyle & ~WS_MINIMIZEBOX;
419425 SetWindowLong (hWnd, GWL_STYLE, gwlStyle);
420426}
427+
421428bool WindowManager::IsClosable ()
422429{
423430 HWND hWnd = GetMainWindow ();
@@ -434,6 +441,18 @@ void WindowManager::SetClosable(const flutter::EncodableMap &args)
434441 SetClassLong (hWnd, GCL_STYLE, gclStyle);
435442}
436443
444+ bool WindowManager::IsAlwaysOnTop ()
445+ {
446+ DWORD dwExStyle = GetWindowLong (GetMainWindow (), GWL_EXSTYLE);
447+ return (dwExStyle & WS_EX_TOPMOST) != 0 ;
448+ }
449+
450+ void WindowManager::SetAlwaysOnTop (const flutter::EncodableMap &args)
451+ {
452+ bool isAlwaysOnTop = std::get<bool >(args.at (flutter::EncodableValue (" isAlwaysOnTop" )));
453+ SetWindowPos (GetMainWindow (), isAlwaysOnTop ? HWND_TOPMOST : HWND_NOTOPMOST, 0 , 0 , 0 , 0 , SWP_NOMOVE | SWP_NOSIZE);
454+ }
455+
437456std::string WindowManager::GetTitle ()
438457{
439458 int const bufferSize = 1 + GetWindowTextLength (GetMainWindow ());
0 commit comments