@@ -7,7 +7,7 @@ use std::rc::{Rc, Weak};
77use  winapi:: shared:: guiddef:: { IsEqualIID ,  REFIID } ; 
88use  winapi:: shared:: minwindef:: { DWORD ,  WPARAM } ; 
99use  winapi:: shared:: ntdef:: { HRESULT ,  ULONG } ; 
10- use  winapi:: shared:: windef:: POINTL ; 
10+ use  winapi:: shared:: windef:: { POINT ,   POINTL } ; 
1111use  winapi:: shared:: winerror:: { E_NOINTERFACE ,  E_UNEXPECTED ,  S_OK } ; 
1212use  winapi:: shared:: wtypes:: DVASPECT_CONTENT ; 
1313use  winapi:: um:: objidl:: { IDataObject ,  FORMATETC ,  STGMEDIUM ,  TYMED_HGLOBAL } ; 
@@ -17,7 +17,7 @@ use winapi::um::oleidl::{
1717} ; 
1818use  winapi:: um:: shellapi:: { DragQueryFileW ,  HDROP } ; 
1919use  winapi:: um:: unknwnbase:: { IUnknown ,  IUnknownVtbl } ; 
20- use  winapi:: um:: winuser:: CF_HDROP ; 
20+ use  winapi:: um:: winuser:: { ScreenToClient ,   CF_HDROP } ; 
2121use  winapi:: Interface ; 
2222
2323use  crate :: { DropData ,  DropEffect ,  Event ,  EventStatus ,  MouseEvent ,  PhyPoint ,  Point } ; 
@@ -113,6 +113,9 @@ impl DropTarget {
113113            return ; 
114114        } ; 
115115
116+         let  mut  pt = POINT  {  x :  pt. x ,  y :  pt. y  } ; 
117+         unsafe  {  ScreenToClient ( window_state. hwnd ,  & mut  pt as  * mut  POINT )  } ; 
118+ 
116119        let  phy_point = PhyPoint :: new ( pt. x ,  pt. y ) ; 
117120        self . drag_position  = phy_point. to_logical ( & window_state. window_info ( ) ) ; 
118121    } 
0 commit comments