Skip to content

Commit a2ca1ca

Browse files
committed
Update to latest integration test harness and support Visual Studio 2022
1 parent 49626d5 commit a2ca1ca

16 files changed

+306
-1017
lines changed

Tvl.VisualStudio.MouseFastScroll.IntegrationTests/AbstractIdeIntegrationTest.cs

Lines changed: 0 additions & 89 deletions
This file was deleted.

Tvl.VisualStudio.MouseFastScroll.IntegrationTests/Harness/IntegrationHelper.cs

Lines changed: 0 additions & 108 deletions
This file was deleted.

Tvl.VisualStudio.MouseFastScroll.IntegrationTests/Harness/NativeMethods.cs

Lines changed: 0 additions & 137 deletions
Original file line numberDiff line numberDiff line change
@@ -5,106 +5,14 @@ namespace Tvl.VisualStudio.MouseFastScroll.IntegrationTests.Harness
55
{
66
using System;
77
using System.Runtime.InteropServices;
8-
using System.Text;
9-
using IBindCtx = Microsoft.VisualStudio.OLE.Interop.IBindCtx;
10-
using IRunningObjectTable = Microsoft.VisualStudio.OLE.Interop.IRunningObjectTable;
118

129
internal static class NativeMethods
1310
{
14-
private const string Kernel32 = "kernel32.dll";
15-
private const string Ole32 = "ole32.dll";
1611
private const string User32 = "User32.dll";
1712

18-
public const int RPC_E_CALL_REJECTED = unchecked((int)0x80010001);
19-
public const int RPC_E_SERVERCALL_RETRYLATER = unchecked((int)0x8001010A);
20-
21-
public const uint GA_PARENT = 1;
22-
public const uint GA_ROOT = 2;
23-
public const uint GA_ROOTOWNER = 3;
24-
25-
public const uint GW_HWNDFIRST = 0;
26-
public const uint GW_HWNDLAST = 1;
27-
public const uint GW_HWNDNEXT = 2;
28-
public const uint GW_HWNDPREV = 3;
29-
public const uint GW_OWNER = 4;
30-
public const uint GW_CHILD = 5;
31-
public const uint GW_ENABLEDPOPUP = 6;
32-
33-
public const int HWND_NOTOPMOST = -2;
34-
public const int HWND_TOPMOST = -1;
35-
public const int HWND_TOP = 0;
36-
public const int HWND_BOTTOM = 1;
37-
38-
public const uint INPUT_MOUSE = 0;
39-
public const uint INPUT_KEYBOARD = 1;
40-
public const uint INPUT_HARDWARE = 2;
41-
42-
public const uint KEYEVENTF_NONE = 0x0000;
43-
public const uint KEYEVENTF_EXTENDEDKEY = 0x0001;
44-
public const uint KEYEVENTF_KEYUP = 0x0002;
45-
public const uint KEYEVENTF_UNICODE = 0x0004;
46-
public const uint KEYEVENTF_SCANCODE = 0x0008;
47-
48-
public const uint SWP_NOSIZE = 0x0001;
49-
public const uint SWP_NOMOVE = 0x0002;
50-
public const uint SWP_NOZORDER = 0x0004;
51-
public const uint SWP_NOREDRAW = 0x008;
52-
public const uint SWP_NOACTIVATE = 0x0010;
53-
public const uint SWP_DRAWFRAME = 0x0020;
54-
public const uint SWP_FRAMECHANGED = 0x0020;
55-
public const uint SWP_SHOWWINDOW = 0x0040;
56-
public const uint SWP_HIDEWINDOW = 0x0080;
57-
public const uint SWP_NOCOPYBITS = 0x0100;
58-
public const uint SWP_NOOWNERZORDER = 0x0200;
59-
public const uint SWP_NOREPOSITION = 0x0200;
60-
public const uint SWP_NOSENDCHANGING = 0x0400;
61-
public const uint SWP_DEFERERASE = 0x2000;
62-
public const uint SWP_ASYNCWINDOWPOS = 0x4000;
63-
64-
public const uint WM_GETTEXT = 0x000D;
65-
public const uint WM_GETTEXTLENGTH = 0x000E;
66-
67-
public const uint MAPVK_VK_TO_VSC = 0;
68-
public const uint MAPVK_VSC_TO_VK = 1;
69-
public const uint MAPVK_VK_TO_CHAR = 2;
70-
public const uint MAPVK_VSC_TO_KV_EX = 3;
71-
7213
public const int SM_CXSCREEN = 0;
7314
public const int SM_CYSCREEN = 1;
7415

75-
public static readonly int SizeOf_INPUT = Marshal.SizeOf<INPUT>();
76-
77-
[UnmanagedFunctionPointer(CallingConvention.Winapi, SetLastError = false)]
78-
[return: MarshalAs(UnmanagedType.Bool)]
79-
public delegate bool WNDENUMPROC(IntPtr hWnd, IntPtr lParam);
80-
81-
[DllImport(Kernel32)]
82-
public static extern uint GetCurrentThreadId();
83-
84-
[DllImport(User32, SetLastError = true)]
85-
[return: MarshalAs(UnmanagedType.Bool)]
86-
public static extern bool AttachThreadInput(uint idAttach, uint idAttachTo, [MarshalAs(UnmanagedType.Bool)] bool fAttach);
87-
88-
[DllImport(User32)]
89-
public static extern IntPtr GetForegroundWindow();
90-
91-
[DllImport(User32)]
92-
public static extern uint GetWindowThreadProcessId(IntPtr hWnd, [Optional] IntPtr lpdwProcessId);
93-
94-
[DllImport(User32, SetLastError = true)]
95-
public static extern IntPtr SetActiveWindow(IntPtr hWnd);
96-
97-
[DllImport(User32, SetLastError = true)]
98-
public static extern IntPtr SetFocus(IntPtr hWnd);
99-
100-
[DllImport(User32, SetLastError = false)]
101-
[return: MarshalAs(UnmanagedType.Bool)]
102-
public static extern bool SetForegroundWindow(IntPtr hWnd);
103-
104-
[DllImport(User32, SetLastError = true)]
105-
[return: MarshalAs(UnmanagedType.Bool)]
106-
public static extern bool SetWindowPos(IntPtr hWnd, [Optional] IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, uint uFlags);
107-
10816
[DllImport(User32, CharSet = CharSet.Unicode)]
10917
public static extern int GetSystemMetrics(int nIndex);
11018

@@ -127,50 +35,5 @@ public struct POINT
12735
public IntPtr x;
12836
public IntPtr y;
12937
}
130-
131-
[StructLayout(LayoutKind.Explicit, CharSet = CharSet.Unicode, Pack = 8)]
132-
public struct INPUT
133-
{
134-
[FieldOffset(0)]
135-
public uint Type;
136-
137-
[FieldOffset(4)]
138-
public MOUSEINPUT mi;
139-
140-
[FieldOffset(4)]
141-
public KEYBDINPUT ki;
142-
143-
[FieldOffset(4)]
144-
public HARDWAREINPUT hi;
145-
}
146-
147-
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 8)]
148-
public struct HARDWAREINPUT
149-
{
150-
public uint uMsg;
151-
public ushort wParamL;
152-
public ushort wParamH;
153-
}
154-
155-
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 8)]
156-
public struct KEYBDINPUT
157-
{
158-
public ushort wVk;
159-
public ushort wScan;
160-
public uint dwFlags;
161-
public uint time;
162-
public IntPtr dwExtraInfo;
163-
}
164-
165-
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode, Pack = 8)]
166-
public struct MOUSEINPUT
167-
{
168-
public int dx;
169-
public int dy;
170-
public uint mouseData;
171-
public uint dwFlags;
172-
public uint time;
173-
public IntPtr dwExtraInfo;
174-
}
17538
}
17639
}

0 commit comments

Comments
 (0)