mirror of
https://github.com/S7NetPlus/s7netplus.git
synced 2026-02-17 22:38:27 +08:00
x fixes compatibility to support .NET 3.5 (removed unused usings/imports and changed method calls to .NET equivalents)
48 lines
1.2 KiB
C#
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);
|
|
}
|
|
|
|
}
|