Skip to content

Commit

Permalink
Merge pull request #2083 from hughbe/cursor-interop
Browse files Browse the repository at this point in the history
Remove duplicate GetCursor interop
  • Loading branch information
msftbot[bot] authored Oct 15, 2019
2 parents 6502d50 + 19b43ef commit 64aa1a0
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 10 deletions.
6 changes: 0 additions & 6 deletions src/Common/src/NativeMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3127,12 +3127,6 @@ public enum MONTCALENDAR_VIEW_MODE
[DllImport(ExternDll.User32, ExactSpelling = true)]
public static extern bool GetUpdateRect(IntPtr hwnd, ref RECT rc, bool fErase);

[DllImport(ExternDll.User32, ExactSpelling = true, CharSet = CharSet.Auto)]
public static extern IntPtr GetCursor();

[DllImport(ExternDll.User32, ExactSpelling = true, CharSet = CharSet.Auto)]
public static extern bool GetCursorPos(out Point pt);

[DllImport(ExternDll.User32, ExactSpelling = true, CharSet = CharSet.Auto)]
public static extern IntPtr SetParent(IntPtr hWnd, IntPtr hWndParent);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@
<Compile Include="..\..\Common\src\Interop\User32\Interop.EndPaint.cs" Link="Interop\User32\Interop.EndPaint.cs" />
<Compile Include="..\..\Common\src\Interop\User32\Interop.GetActiveWindow.cs" Link="Interop\User32\Interop.GetActiveWindow.cs" />
<Compile Include="..\..\Common\src\Interop\User32\Interop.GetCapture.cs" Link="Interop\User32\Interop.GetCapture.cs" />
<Compile Include="..\..\Common\src\Interop\User32\Interop.GetCursor.cs" Link="Interop\User32\Interop.GetCursor.cs" />
<Compile Include="..\..\Common\src\Interop\User32\Interop.GetCursorPos.cs" Link="Interop\User32\Interop.GetCursorPos.cs" />
<Compile Include="..\..\Common\src\Interop\User32\Interop.GetDC.cs" Link="Interop\User32\Interop.GetDC.cs" />
<Compile Include="..\..\Common\src\Interop\User32\Interop.GetFocus.cs" Link="Interop\User32\Interop.GetFocus.cs" />
<Compile Include="..\..\Common\src\Interop\User32\Interop.GetKeyState.cs" Link="Interop\User32\Interop.GetKeyState.cs" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,7 @@ protected override void OnDragEnter(DragEventArgs e)
if (!IsLocalDrag(e))
{
_behaviorService._validDragArgs = e;
NativeMethods.GetCursorPos(out Point pt);
User32.GetCursorPos(out Point pt);
NativeMethods.MapWindowPoints(IntPtr.Zero, Handle, ref pt, 1);
_behaviorService.PropagateHitTest(pt);

Expand Down Expand Up @@ -850,7 +850,7 @@ protected override void OnDragOver(DragEventArgs e)
if (!IsLocalDrag(e))
{
_behaviorService._validDragArgs = e;
NativeMethods.GetCursorPos(out Point pt);
User32.GetCursorPos(out Point pt);
NativeMethods.MapWindowPoints(IntPtr.Zero, Handle, ref pt, 1);
_behaviorService.PropagateHitTest(pt);
}
Expand Down Expand Up @@ -1407,7 +1407,7 @@ private void SetAppropriateCursor(Cursor cursor)

if (_toolboxSvc != null && _toolboxSvc.SetCursor())
{
cursor = new Cursor(NativeMethods.GetCursor());
cursor = new Cursor(User32.GetCursor());
}
}
_adornerWindow.Cursor = cursor;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ protected virtual bool OnKeyCancel(object sender)
if (tbx != null && tbx.GetSelectedToolboxItem((IDesignerHost)GetService(typeof(IDesignerHost))) != null)
{
tbx.SelectedToolboxItemUsed();
NativeMethods.GetCursorPos(out Point p);
User32.GetCursorPos(out Point p);
IntPtr hwnd = NativeMethods.WindowFromPoint(p.X, p.Y);
if (hwnd != IntPtr.Zero)
{
Expand Down

0 comments on commit 64aa1a0

Please sign in to comment.