Files
s7netplus/S7.Net.UnitTest/Helpers/NativeMethods.cs
Johnnyxy 533a18e2cc o changed target .NET framework to v3.5 (higher .NET versions can load and execute lower versions code)
x fixes compatibility to support .NET 3.5 (removed unused usings/imports and changed method calls to .NET equivalents)
2015-06-17 17:04:12 +02:00

48 lines
1.2 KiB
C#

using System;
using System.Runtime.InteropServices;
namespace S7.Net.UnitTest.Helpers
{
internal static class NativeMethods
{
[StructLayout(LayoutKind.Sequential)]
public struct CURSORINFO
{
public Int32 cbSize;
public Int32 flags;
public IntPtr hCursor;
public POINTAPI ptScreenPos;
}
[StructLayout(LayoutKind.Sequential)]
public struct POINTAPI
{
public int x;
public int y;
}
[DllImport("user32.dll")]
public static extern int BringWindowToTop(IntPtr hwnd);
[DllImport("kernel32.dll")]
public static extern bool AllocConsole();
[DllImport("kernel32.dll")]
public static extern bool FreeConsole();
[DllImport("kernel32.dll")]
public static extern IntPtr GetConsoleWindow();
[DllImport("kernel32.dll")]
public static extern int GetConsoleOutputCP();
[DllImport("user32.dll")]
public static extern bool GetCursorInfo(out CURSORINFO pci);
[DllImport("user32.dll")]
public static extern bool DrawIcon(IntPtr hDC, int X, int Y, IntPtr hIcon);
}
}