@@ -41,6 +41,7 @@ use windows::Win32::Graphics::Gdi::MonitorFromPoint;
41
41
use windows:: Win32 :: Graphics :: Gdi :: MonitorFromWindow ;
42
42
use windows:: Win32 :: Graphics :: Gdi :: Rectangle ;
43
43
use windows:: Win32 :: Graphics :: Gdi :: RoundRect ;
44
+ use windows:: Win32 :: Graphics :: Gdi :: UpdateWindow ;
44
45
use windows:: Win32 :: Graphics :: Gdi :: HBRUSH ;
45
46
use windows:: Win32 :: Graphics :: Gdi :: HDC ;
46
47
use windows:: Win32 :: Graphics :: Gdi :: HMONITOR ;
@@ -100,6 +101,7 @@ use windows::Win32::UI::WindowsAndMessaging::PostMessageW;
100
101
use windows:: Win32 :: UI :: WindowsAndMessaging :: RealGetWindowClassW ;
101
102
use windows:: Win32 :: UI :: WindowsAndMessaging :: RegisterClassW ;
102
103
use windows:: Win32 :: UI :: WindowsAndMessaging :: RegisterDeviceNotificationW ;
104
+ use windows:: Win32 :: UI :: WindowsAndMessaging :: SendMessageW ;
103
105
use windows:: Win32 :: UI :: WindowsAndMessaging :: SetCursorPos ;
104
106
use windows:: Win32 :: UI :: WindowsAndMessaging :: SetForegroundWindow ;
105
107
use windows:: Win32 :: UI :: WindowsAndMessaging :: SetLayeredWindowAttributes ;
@@ -139,6 +141,8 @@ use windows::Win32::UI::WindowsAndMessaging::SYSTEM_PARAMETERS_INFO_ACTION;
139
141
use windows:: Win32 :: UI :: WindowsAndMessaging :: SYSTEM_PARAMETERS_INFO_UPDATE_FLAGS ;
140
142
use windows:: Win32 :: UI :: WindowsAndMessaging :: WINDOW_LONG_PTR_INDEX ;
141
143
use windows:: Win32 :: UI :: WindowsAndMessaging :: WM_CLOSE ;
144
+ use windows:: Win32 :: UI :: WindowsAndMessaging :: WM_ENTERSIZEMOVE ;
145
+ use windows:: Win32 :: UI :: WindowsAndMessaging :: WM_EXITSIZEMOVE ;
142
146
use windows:: Win32 :: UI :: WindowsAndMessaging :: WNDCLASSW ;
143
147
use windows:: Win32 :: UI :: WindowsAndMessaging :: WNDENUMPROC ;
144
148
use windows:: Win32 :: UI :: WindowsAndMessaging :: WS_DISABLED ;
@@ -1360,6 +1364,24 @@ impl WindowsApi {
1360
1364
unsafe { InvalidateRect ( Option :: from ( HWND ( as_ptr ! ( hwnd) ) ) , rect, erase) } . as_bool ( )
1361
1365
}
1362
1366
1367
+ pub fn send_enter_size_move ( hwnd : isize ) -> Result < ( ) > {
1368
+ unsafe {
1369
+ SendMessageW ( HWND ( as_ptr ! ( hwnd) ) , WM_ENTERSIZEMOVE , None , None ) ;
1370
+ Ok ( ( ) )
1371
+ }
1372
+ }
1373
+
1374
+ pub fn send_exit_size_move ( hwnd : isize ) -> Result < ( ) > {
1375
+ unsafe {
1376
+ SendMessageW ( HWND ( as_ptr ! ( hwnd) ) , WM_EXITSIZEMOVE , None , None ) ;
1377
+ Ok ( ( ) )
1378
+ }
1379
+ }
1380
+
1381
+ pub fn update_window ( hwnd : isize ) -> bool {
1382
+ unsafe { UpdateWindow ( HWND ( as_ptr ! ( hwnd) ) ) } . as_bool ( )
1383
+ }
1384
+
1363
1385
pub fn alt_is_pressed ( ) -> bool {
1364
1386
let state = unsafe { GetKeyState ( i32:: from ( VK_MENU . 0 ) ) } ;
1365
1387
#[ allow( clippy:: cast_sign_loss) ]
0 commit comments