📄 win32.cs
字号:
namespace Imps.Client.Pc.BizControls
{
using System;
using System.Drawing;
using System.Runtime.InteropServices;
internal class Win32
{
public const int SB_VERT = 1;
public const int TV_FIRST = 0x1100;
public const int TVM_GETITEM = 0x110c;
public const int TVM_SETITEM = 0x110d;
public const int WM_MOUSEWHEEL = 0x20a;
public const int WM_NCLBUTTONDOWN = 0xa1;
public const int WM_NCLBUTTONUP = 0xa2;
public const int WM_NCMOUSELEAVE = 0x2a2;
public const int WM_NCMOUSEMOVE = 160;
public const int WM_PAINT = 15;
public const int WM_VSCROLL = 0x115;
[DllImport("user32.dll")]
public static extern bool GetCursorPos(ref Point pt);
[DllImport("user32.dll")]
public static extern IntPtr GetDesktopWindow();
[DllImport("user32.dll")]
public static extern IntPtr GetParent(IntPtr hWndChild);
[DllImport("user32.dll")]
public static extern bool GetScrollInfo(IntPtr hwnd, int fnBar, ref tagSCROLLINFO lpsi);
[DllImport("user32.dll")]
public static extern bool MoveWindow(IntPtr hWnd, int X, int Y, int nWidth, int nHeight, bool bRepaint);
[DllImport("user32.dll")]
public static extern int PostMessage(IntPtr hwnd, int wMsg, int wParam, int lParam);
[DllImport("user32.dll")]
public static extern int SendMessage(IntPtr hwnd, int wMsg, int wParam, ref tagTVITEMEX lParam);
[DllImport("user32.dll")]
public static extern int SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam);
[DllImport("user32.dll")]
public static extern bool SetCursorPos(int x, int y);
[DllImport("user32.dll")]
public static extern IntPtr SetParent(IntPtr hWndChild, IntPtr hWndNewParent);
[DllImport("user32.dll")]
public static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
public static class scollBar_command
{
public const int SB_BOTTOM = 7;
public const int SB_ENDSCROLL = 8;
public const int SB_LEFT = 6;
public const int SB_LINEDOWN = 1;
public const int SB_LINELEFT = 0;
public const int SB_LINERIGHT = 1;
public const int SB_LINEUP = 0;
public const int SB_PAGEDOWN = 3;
public const int SB_PAGELEFT = 2;
public const int SB_PAGERIGHT = 3;
public const int SB_PAGEUP = 2;
public const int SB_RIGHT = 7;
public const int SB_THUMBPOSITION = 4;
public const int SB_THUMBTRACK = 5;
public const int SB_TOP = 6;
}
public enum ShowWindowCmd
{
SW_HIDE,
SW_SHOWNORMAL,
SW_SHOWMINIMIZED,
SW_SHOWMAXIMIZED,
SW_SHOWNOACTIVATE,
SW_SHOW,
SW_MINIMIZE,
SW_SHOWMINNOACTIVE,
SW_SHOWNA,
SW_RESTORE,
SW_SHOWDEFAULT,
SW_FORCEMINIMIZE
}
[Flags]
public enum sifFlag
{
SIF_ALL = 0x17,
SIF_DISABLENOSCROLL = 8,
SIF_PAGE = 2,
SIF_POS = 4,
SIF_RANGE = 1,
SIF_TRACKPOS = 0x10
}
[StructLayout(LayoutKind.Sequential)]
public struct tagSCROLLINFO
{
public int cbSize;
public int fMask;
public int nMin;
public int nMax;
public int nPage;
public int nPos;
public int nTrackPos;
}
[StructLayout(LayoutKind.Sequential)]
public struct tagTVITEMEX
{
public int mask;
public IntPtr hItem;
public int state;
public int stateMask;
public string pszText;
public int cchTextMax;
public int iImage;
public int iSelectedImage;
public int cChildren;
public int lParam;
public int iIntegral;
}
[Flags]
public enum tviMaskFalg
{
TVIF_CHILDREN = 0x40,
TVIF_DI_SETITEM = 0x1000,
TVIF_HANDLE = 0x10,
TVIF_IMAGE = 2,
TVIF_INTEGRAL = 0x80,
TVIF_PARAM = 4,
TVIF_SELECTEDIMAGE = 0x20,
TVIF_STATE = 8,
TVIF_TEXT = 1
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -