From 174f5219ecfe5c8866977928d40de1514fa58db2 Mon Sep 17 00:00:00 2001 From: David Hall Date: Wed, 19 Sep 2018 06:54:14 -0600 Subject: [PATCH] Updates to existing code with breaking changes. --- UnitTests/PInvoke/CommCtrl/EditTest.cs | 2 +- UnitTests/PInvoke/NtDll/NtDllTests.cs | 2 ++ WIndows.Forms/Extensions/CursorExtension.cs | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/UnitTests/PInvoke/CommCtrl/EditTest.cs b/UnitTests/PInvoke/CommCtrl/EditTest.cs index ea8a7c82..88d36eec 100644 --- a/UnitTests/PInvoke/CommCtrl/EditTest.cs +++ b/UnitTests/PInvoke/CommCtrl/EditTest.cs @@ -15,7 +15,7 @@ namespace Vanara.PInvoke.Tests var f = new Form { Size = new System.Drawing.Size(100, 100) }; var btn = new TextBox { Size = new System.Drawing.Size(50, 12), Location = new System.Drawing.Point(5, 5) }; var tip = new EDITBALLOONTIP("Test", "tested"); - btn.HandleCreated += (s, a) => SendMessage(new System.Runtime.InteropServices.HandleRef(btn, btn.Handle), EditMessage.EM_SHOWBALLOONTIP, 0, ref tip); + btn.HandleCreated += (s, a) => SendMessage(new System.Runtime.InteropServices.HandleRef(btn, btn.Handle), User32_Gdi.EditMessage.EM_SHOWBALLOONTIP, 0, ref tip); f.Controls.Add(btn); f.ShowDialog(); } diff --git a/UnitTests/PInvoke/NtDll/NtDllTests.cs b/UnitTests/PInvoke/NtDll/NtDllTests.cs index fe4c0fef..f888eb5c 100644 --- a/UnitTests/PInvoke/NtDll/NtDllTests.cs +++ b/UnitTests/PInvoke/NtDll/NtDllTests.cs @@ -16,7 +16,9 @@ namespace Vanara.PInvoke.Tests [Test] public void NtQuerySystemInformationTest() { +#pragma warning disable CS0618 // Type or member is obsolete var bi = NtQuerySystemInformation(SYSTEM_INFORMATION_CLASS.SystemBasicInformation); +#pragma warning restore CS0618 // Type or member is obsolete Assert.That(bi.NumberOfProcessors, Is.Not.Zero); var qi = NtQuerySystemInformation(SYSTEM_INFORMATION_CLASS.SystemRegistryQuotaInformation); Assert.That(qi.RegistryQuotaUsed, Is.Not.Zero); diff --git a/WIndows.Forms/Extensions/CursorExtension.cs b/WIndows.Forms/Extensions/CursorExtension.cs index fd0d8886..a7efc0ff 100644 --- a/WIndows.Forms/Extensions/CursorExtension.cs +++ b/WIndows.Forms/Extensions/CursorExtension.cs @@ -11,7 +11,7 @@ namespace Vanara.Extensions { var size = Size.Empty; var info = new ICONINFO(); - GetIconInfo(cursor.Handle, info); + GetIconInfo(new SafeIconHandle(cursor.Handle, false), info); if (info.hbmColor != IntPtr.Zero) { using (var bm = Image.FromHbitmap(info.hbmColor))