Updates to existing code with breaking changes.

pull/21/head
David Hall 2018-09-19 06:54:14 -06:00
parent d1f31b4154
commit 174f5219ec
3 changed files with 4 additions and 2 deletions

View File

@ -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();
}

View File

@ -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_BASIC_INFORMATION>(SYSTEM_INFORMATION_CLASS.SystemBasicInformation);
#pragma warning restore CS0618 // Type or member is obsolete
Assert.That(bi.NumberOfProcessors, Is.Not.Zero);
var qi = NtQuerySystemInformation<SYSTEM_REGISTRY_QUOTA_INFORMATION>(SYSTEM_INFORMATION_CLASS.SystemRegistryQuotaInformation);
Assert.That(qi.RegistryQuotaUsed, Is.Not.Zero);

View File

@ -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))