@@ -6,7 +6,7 @@ use winapi::um::ole2::{RegisterDragDrop, OleInitialize, RevokeDragDrop};
6
6
use winapi:: um:: oleidl:: LPDROPTARGET ;
7
7
use winapi:: um:: winuser:: {
8
8
AdjustWindowRectEx , CreateWindowExW , DefWindowProcW , DestroyWindow , DispatchMessageW ,
9
- GetDpiForWindow , GetMessageW , GetWindowLongPtrW , LoadCursorW , PostMessageW , RegisterClassW ,
9
+ GetDpiForWindow , GetMessageW , GetWindowLongPtrW , LoadCursorW , SetCursor , PostMessageW , RegisterClassW ,
10
10
ReleaseCapture , SetCapture , SetProcessDpiAwarenessContext , SetTimer , SetWindowLongPtrW ,
11
11
SetWindowPos , TranslateMessage , UnregisterClassW , CS_OWNDC , GET_XBUTTON_WPARAM , GWLP_USERDATA ,
12
12
IDC_ARROW , MSG , SWP_NOMOVE , SWP_NOZORDER , WHEEL_DELTA , WM_CHAR , WM_CLOSE , WM_CREATE ,
@@ -31,7 +31,7 @@ use raw_window_handle::{HasRawWindowHandle, RawWindowHandle, Win32Handle};
31
31
const BV_WINDOW_MUST_CLOSE : UINT = WM_USER + 1 ;
32
32
33
33
use crate :: {
34
- Event , MouseButton , MouseEvent , PhyPoint , PhySize , ScrollDelta , Size , WindowEvent ,
34
+ Event , MouseButton , MouseEvent , PhyPoint , PhySize , ScrollDelta , Size , MouseCursor , WindowEvent ,
35
35
WindowHandler , WindowInfo , WindowOpenOptions , WindowScalePolicy ,
36
36
} ;
37
37
@@ -433,7 +433,7 @@ unsafe fn register_wnd_class() -> ATOM {
433
433
cbClsExtra : 0 ,
434
434
cbWndExtra : 0 ,
435
435
hIcon : null_mut ( ) ,
436
- hCursor : LoadCursorW ( null_mut ( ) , IDC_ARROW ) ,
436
+ hCursor : null_mut ( ) , // If the class cursor is not NULL, the system restores the class cursor each time the mouse is moved.
437
437
hbrBackground : null_mut ( ) ,
438
438
lpszMenuName : null_mut ( ) ,
439
439
} ;
@@ -761,7 +761,10 @@ impl Window<'_> {
761
761
}
762
762
763
763
pub fn set_mouse_cursor ( & mut self , cursor : MouseCursor ) {
764
- //@TODO: Implement
764
+ unsafe {
765
+ let cursor = LoadCursorW ( null_mut ( ) , cursor. to_windows_cursor ( ) ) ;
766
+ SetCursor ( cursor) ;
767
+ }
765
768
}
766
769
767
770
pub fn close ( & mut self ) {
0 commit comments