📄 win32api_wrapper.cs
字号:
public static extern bool EnableScrollBar(IntPtr hWnd, uint wSBflags, uint wArrows);
[DllImport("user32.dll")]
public static extern bool EndDeferWindowPos(IntPtr hWinPosInfo);
[DllImport("GDI32.dll")]
public static extern int ExcludeClipRect(IntPtr hDc, int left, int top, int right, int bottom);
[DllImport("user32.dll")]
public static extern int FillRect(IntPtr hDc, ref RECT rect, IntPtr hBrush);
[DllImport("user32.dll")]
public static extern bool GetClientRect(IntPtr hWnd, ref RECT rcClient);
[DllImport("Kernel32.dll")]
public static extern uint GetCurrentThreadId();
[DllImport("user32.dll")]
public static extern IntPtr GetDC(IntPtr hWnd);
[DllImport("user32.dll")]
public static extern IntPtr GetDCEx(IntPtr hWnd, IntPtr hRgn, int nFlags);
[DllImport("user32.dll")]
public static extern IntPtr GetDesktopWindow();
[DllImport("Kernel32.dll")]
public static extern int GetLastError();
[DllImport("user32.dll")]
public static extern bool GetLastInputInfo(ref LASTINPUTINFO lii);
[DllImport("user32.dll")]
public static extern IntPtr GetParent(IntPtr hWnd);
[DllImport("user32.dll")]
public static extern bool GetScrollInfo(IntPtr hWnd, uint fnBar, ref SCROLLINFO si);
[DllImport("user32.dll")]
public static extern int GetScrollPos(IntPtr hWnd, uint nBar);
[DllImport("user32.dll")]
public static extern int GetSystemMetrics(int nIndex);
[DllImport("kernel32.dll")]
public static extern uint GetTickCount();
[DllImport("user32.dll")]
public static extern bool GetWindowInfo(IntPtr hWnd, ref WINDOWINFO pwi);
[DllImport("user32.dll")]
public static extern long GetWindowLong(IntPtr hWnd, int nIndex);
[DllImport("user32.dll")]
public static extern bool GetWindowRect(IntPtr hWnd, ref RECT rcWnd);
[DllImport("comctl32.dll")]
public static extern int ImageList_Add(IntPtr himl, IntPtr hbmImage, IntPtr hbmMask);
[DllImport("comctl32.dll")]
public static extern bool ImageList_BeginDrag(IntPtr himlTrack, int iTrack, int dxHotspot, int dyHotspot);
[DllImport("comctl32.dll")]
public static extern IntPtr ImageList_Create(int cx, int cy, uint flags, int cInitial, int cGrow);
[DllImport("comctl32.dll")]
public static extern bool ImageList_Destroy(IntPtr himl);
[DllImport("comctl32.dll")]
public static extern bool ImageList_DragEnter(IntPtr hwndLock, int x, int y);
[DllImport("comctl32.dll")]
public static extern bool ImageList_DragLeave(IntPtr hwndLock);
[DllImport("comctl32.dll")]
public static extern bool ImageList_DragMove(int x, int y);
[DllImport("comctl32.dll")]
public static extern void ImageList_EndDrag();
[DllImport("GDI32.dll")]
public static extern int IntersectClipRect(IntPtr hDc, int left, int top, int right, int bottom);
[DllImport("user32.dll")]
public static extern bool InvalidateRect(IntPtr hWnd, IntPtr lpRect, bool fErase);
[DllImport("user32.dll")]
public static extern bool IsWindowVisible(IntPtr hWnd);
[DllImport("user32.dll")]
public static extern bool LockWindowUpdate(IntPtr hWndLock);
[DllImport("user32.dll")]
public static extern bool MoveWindow(IntPtr hWnd, int x, int y, int nWidth, int nHeight, bool fRepaint);
[DllImport("user32.dll")]
public static extern bool PostMessage(IntPtr hWnd, uint uMsg, IntPtr wParam, IntPtr lParam);
[DllImport("user32.dll")]
public static extern bool ReleaseDC(IntPtr hWnd, IntPtr hDc);
[DllImport("user32.dll")]
public static extern bool ScreenToClient(IntPtr hWnd, ref POINT ptOut);
[DllImport("user32.dll")]
public static extern IntPtr SendMessage(IntPtr hWnd, uint uMsg, IntPtr wParam, IntPtr lParam);
[DllImport("user32.dll")]
public static extern IntPtr SetParent(IntPtr hWndChild, IntPtr hWndNewParent);
[DllImport("user32.dll")]
public static extern int SetScrollInfo(IntPtr hWnd, uint fnBar, ref SCROLLINFO si, bool fRedraw);
[DllImport("user32.dll")]
public static extern int SetScrollPos(IntPtr hWnd, int nBar, int nPos, bool bRedraw);
[DllImport("Gdi32.dll")]
public static extern bool SetViewportOrgEx(IntPtr hdc, int X, int Y, ref POINT point);
[DllImport("user32.dll")]
public static extern IntPtr SetWindowLong(IntPtr hWnd, int nIndex, wndproc_type nNewLong);
[DllImport("user32.dll")]
public static extern IntPtr SetWindowLong(IntPtr hWnd, int nIndex, IntPtr nNewLong);
[DllImport("user32.dll")]
public static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int x, int y, int cx, int cy, uint uFlags);
[DllImport("user32.dll")]
public static extern bool ShowScrollBar(IntPtr hWnd, uint wBar, bool fShow);
[DllImport("user32.dll")]
public static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
[StructLayout(LayoutKind.Explicit)]
public struct LASTINPUTINFO
{
[FieldOffset(0)]
public int cbSize;
[FieldOffset(4)]
public uint dwTime;
}
[StructLayout(LayoutKind.Sequential)]
public struct NCCALCSIZE_PARAMS
{
public win32api_wrapper.RECT rgrc0;
public win32api_wrapper.RECT rgrc1;
public win32api_wrapper.RECT rgrc2;
public unsafe win32api_wrapper.WINDOWPOS* lppos;
}
[StructLayout(LayoutKind.Sequential)]
public struct POINT
{
public int x;
public int y;
}
[StructLayout(LayoutKind.Explicit)]
public struct RECT
{
[FieldOffset(12)]
public int bottom;
[FieldOffset(0)]
public int left;
[FieldOffset(8)]
public int right;
[FieldOffset(4)]
public int top;
}
[StructLayout(LayoutKind.Sequential)]
public struct SCROLLINFO
{
public uint cbSize;
public uint fMask;
public int nMin;
public int nMax;
public uint nPage;
public int nPos;
public int nTrackPos;
}
[StructLayout(LayoutKind.Sequential)]
public struct WINDOWINFO
{
public uint cbSize;
public win32api_wrapper.RECT rcWindow;
public win32api_wrapper.RECT rcClient;
public uint dwStyle;
public uint dwExStyle;
public uint dwWindowStatus;
public uint cxWindowBorders;
public uint cyWindowBorders;
public ushort atomWindowType;
public ushort wCreatorVersion;
}
[StructLayout(LayoutKind.Sequential)]
public struct WINDOWPOS
{
public IntPtr hwnd;
public IntPtr hwndInsertAfter;
public int x;
public int y;
public int cx;
public int cy;
public uint flags;
}
public delegate IntPtr wndproc_type(IntPtr hwnd, int uMsg, IntPtr wParam, IntPtr lParam);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -