mirror of
https://github.com/hawkeye-stan/msfs-popout-panel-manager.git
synced 2024-11-29 09:10:09 +00:00
79 lines
3.2 KiB
C#
79 lines
3.2 KiB
C#
|
using System;
|
|||
|
using System.Runtime.InteropServices;
|
|||
|
using System.Text;
|
|||
|
|
|||
|
namespace MSFSPopoutPanelManager
|
|||
|
{
|
|||
|
public class PInvoke
|
|||
|
{
|
|||
|
[DllImport("user32.dll")]
|
|||
|
public static extern bool ClientToScreen(IntPtr hWnd, ref System.Drawing.Point lpPoint);
|
|||
|
|
|||
|
[DllImport("user32.dll")]
|
|||
|
public static extern IntPtr CreateWindowEx(int dwExStyle, string lpClassName, string lpWindowName, int dwStyle, int x, int y, int nWidth, int nHeight, IntPtr hWndParent, IntPtr hMenu, IntPtr hInstance, IntPtr lpParam);
|
|||
|
|
|||
|
[DllImport("user32.dll", CharSet = CharSet.Unicode)]
|
|||
|
[return: MarshalAs(UnmanagedType.Bool)]
|
|||
|
public static extern bool DestroyWindow(IntPtr hwnd);
|
|||
|
|
|||
|
[DllImport("user32.dll")]
|
|||
|
[return: MarshalAs(UnmanagedType.Bool)]
|
|||
|
public static extern bool EnumChildWindows(IntPtr window, EnumWindowProc callback, IntPtr lParam);
|
|||
|
|
|||
|
[DllImport("user32.dll", CharSet = CharSet.Auto)]
|
|||
|
public static extern int GetClassName(IntPtr hWnd, StringBuilder strPtrClassName, Int32 nMaxCount);
|
|||
|
|
|||
|
[DllImport("user32.dll")]
|
|||
|
public static extern bool GetClientRect(IntPtr hWnd, out Rect lpRect);
|
|||
|
|
|||
|
[DllImport("user32.dll")]
|
|||
|
[return: MarshalAs(UnmanagedType.Bool)]
|
|||
|
public static extern bool GetCursorPos(out POINT lpPoint);
|
|||
|
|
|||
|
[DllImport("user32.dll")]
|
|||
|
public static extern IntPtr GetWindowLong(IntPtr hWnd, int nIndex);
|
|||
|
|
|||
|
[DllImport("user32.dll")]
|
|||
|
public static extern int GetWindowRect(IntPtr hwnd, out Rect lpRect);
|
|||
|
|
|||
|
[DllImport("user32.dll", CharSet = CharSet.Auto)]
|
|||
|
public static extern int GetWindowText(IntPtr hWnd, StringBuilder lpWindowText, int nMaxCount);
|
|||
|
|
|||
|
[DllImport("user32.dll", CharSet = CharSet.Auto)]
|
|||
|
public static extern int GetWindowThreadProcessId(IntPtr hWnd, out int lpdwProcessId);
|
|||
|
|
|||
|
[DllImport("user32.dll")]
|
|||
|
public static extern void keybd_event(byte bVk, byte bScan, uint dwFlags, int dwExtraInfo);
|
|||
|
|
|||
|
[DllImport("user32.dll")]
|
|||
|
public static extern void mouse_event(uint dwFlags, int dx, int dy, uint cButtons, uint dwExtraInfo);
|
|||
|
|
|||
|
[DllImport("user32.dll")]
|
|||
|
public static extern bool MoveWindow(IntPtr hWnd, int x, int y, int width, int height, bool repaint);
|
|||
|
|
|||
|
[DllImport("User32.dll")]
|
|||
|
public static extern bool SetCursorPos(int X, int Y);
|
|||
|
|
|||
|
[DllImport("user32.dll")]
|
|||
|
public static extern bool SetForegroundWindow(IntPtr hWnd);
|
|||
|
|
|||
|
[DllImport("user32.dll")]
|
|||
|
public static extern IntPtr SendMessage(IntPtr hWnd, int msg, int wParam, IntPtr lParam);
|
|||
|
|
|||
|
[DllImport("USER32.dll")]
|
|||
|
public static extern int SetWindowLong(IntPtr hWnd, int nIndex, uint dwNewLong);
|
|||
|
|
|||
|
[DllImport("user32.dll")]
|
|||
|
public static extern IntPtr SetWindowPos(IntPtr hWnd, int hWndInsertAfter, int x, int y, int cx, int cy, uint wFlags);
|
|||
|
|
|||
|
[DllImport("user32.dll")]
|
|||
|
public static extern bool SetWindowText(System.IntPtr hwnd, System.String lpString);
|
|||
|
|
|||
|
[DllImport("user32.dll")]
|
|||
|
[return: MarshalAs(UnmanagedType.Bool)]
|
|||
|
public static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
|
|||
|
|
|||
|
public delegate bool EnumWindowProc(IntPtr hwnd, IntPtr lParam);
|
|||
|
}
|
|||
|
}
|