C#可以直接调用的Win32API(和VCL做的整理工作非常类似)

时间:2023-03-08 17:36:58
C#可以直接调用的Win32API(和VCL做的整理工作非常类似)

以前整理的Win32 API,可以直接在C#中直接调用,在做WinForm时还是很有帮助的。以前用在一个多窗口界面中,当轮询窗口时,调用API会提高很多效率。

源码下载 
http://files.cnblogs.com/lordeo/win32api.rar

整理的Win32 API,可以直接在C#中直接调用,在做WinForm时还是很有帮助的。

源码包含三个文件

Win32API.cs,

  1. using System;
  2. using System.Drawing;
  3. using System.Runtime.InteropServices;
  4. using Lordal.Window.Form.Lib.General;
  5. using Lordal.Window.Form.Lib.Win32;
  6. namespace Lordeo.Framework
  7. {
  8. /// <summary>
  9. /// Windows API Functions
  10. /// </summary>
  11. public class Win32API
  12. {
  13. #region .ctor()
  14. // No need to construct this object
  15. private Win32API()
  16. {
  17. }
  18. #endregion
  19. #region Constans values
  20. public const string TOOLBARCLASSNAME = "ToolbarWindow32";
  21. public const string REBARCLASSNAME = "ReBarWindow32";
  22. public const string PROGRESSBARCLASSNAME = "msctls_progress32";
  23. public const string SCROLLBAR = "SCROLLBAR";
  24. #endregion
  25. #region CallBacks
  26. public delegate IntPtr HookProc(int nCode, IntPtr wParam, IntPtr lParam);
  27. #endregion
  28. #region Kernel32.dll functions
  29. [DllImport("kernel32.dll", ExactSpelling=true, CharSet=CharSet.Auto)]
  30. public static extern int GetCurrentThreadId();
  31. #endregion
  32. #region Gdi32.dll functions
  33. [DllImport("gdi32.dll")]
  34. static public extern bool StretchBlt(IntPtr hDCDest, int XOriginDest, int YOriginDest, int WidthDest, int HeightDest,
  35. IntPtr hDCSrc,  int XOriginScr, int YOriginSrc, int WidthScr, int HeightScr, uint Rop);
  36. [DllImport("gdi32.dll")]
  37. static public extern IntPtr CreateCompatibleDC(IntPtr hDC);
  38. [DllImport("gdi32.dll")]
  39. static public extern IntPtr CreateCompatibleBitmap(IntPtr hDC, int Width, int Heigth);
  40. [DllImport("gdi32.dll")]
  41. static public extern IntPtr SelectObject(IntPtr hDC, IntPtr hObject);
  42. [DllImport("gdi32.dll")]
  43. static public extern bool BitBlt(IntPtr hDCDest, int XOriginDest, int YOriginDest, int WidthDest, int HeightDest,
  44. IntPtr hDCSrc,  int XOriginScr, int YOriginSrc, uint Rop);
  45. [DllImport("gdi32.dll")]
  46. static public extern IntPtr DeleteDC(IntPtr hDC);
  47. [DllImport("gdi32.dll")]
  48. static public extern bool PatBlt(IntPtr hDC, int XLeft, int YLeft, int Width, int Height, uint Rop);
  49. [DllImport("gdi32.dll")]
  50. static public extern bool DeleteObject(IntPtr hObject);
  51. [DllImport("gdi32.dll")]
  52. static public extern uint GetPixel(IntPtr hDC, int XPos, int YPos);
  53. [DllImport("gdi32.dll")]
  54. static public extern int SetMapMode(IntPtr hDC, int fnMapMode);
  55. [DllImport("gdi32.dll")]
  56. static public extern int GetObjectType(IntPtr handle);
  57. [DllImport("gdi32")]
  58. public static extern IntPtr CreateDIBSection(IntPtr hdc, ref BITMAPINFO_FLAT bmi,
  59. int iUsage, ref int ppvBits, IntPtr hSection, int dwOffset);
  60. [DllImport("gdi32")]
  61. public static extern int GetDIBits(IntPtr hDC, IntPtr hbm, int StartScan, int ScanLines, int lpBits, BITMAPINFOHEADER bmi, int usage);
  62. [DllImport("gdi32")]
  63. public static extern int GetDIBits(IntPtr hdc, IntPtr hbm, int StartScan, int ScanLines, int lpBits, ref BITMAPINFO_FLAT bmi, int usage);
  64. [DllImport("gdi32")]
  65. public static extern IntPtr GetPaletteEntries(IntPtr hpal, int iStartIndex, int nEntries, byte[] lppe);
  66. [DllImport("gdi32")]
  67. public static extern IntPtr GetSystemPaletteEntries(IntPtr hdc, int iStartIndex, int nEntries, byte[] lppe);
  68. [DllImport("gdi32")]
  69. public static extern uint SetDCBrushColor(IntPtr hdc,  uint crColor);
  70. [DllImport("gdi32")]
  71. public static extern IntPtr CreateSolidBrush(uint crColor);
  72. [DllImport("gdi32")]
  73. public static extern int SetBkMode(IntPtr hDC, BackgroundMode mode);
  74. [DllImport("gdi32")]
  75. public static extern int SetViewportOrgEx(IntPtr hdc,  int x, int y,  int param);
  76. [DllImport("gdi32")]
  77. public static extern uint SetTextColor(IntPtr hDC, uint colorRef);
  78. [DllImport("gdi32")]
  79. public static extern int SetStretchBltMode(IntPtr hDC, int StrechMode);
  80. #endregion
  81. #region Uxtheme.dll functions
  82. [DllImport("uxtheme.dll")]
  83. static public extern int SetWindowTheme(IntPtr hWnd, string AppID, string ClassID);
  84. #endregion
  85. #region User32.dll functions
  86. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  87. public static extern IntPtr GetDC(IntPtr hWnd);
  88. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  89. public static extern int ReleaseDC(IntPtr hWnd, IntPtr hDC);
  90. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  91. static public extern IntPtr GetDesktopWindow();
  92. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  93. static public extern bool ShowWindow(IntPtr hWnd, short State);
  94. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  95. static public extern bool UpdateWindow(IntPtr hWnd);
  96. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  97. static public extern bool SetForegroundWindow(IntPtr hWnd);
  98. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  99. static public extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int x, int y, int Width, int Height, uint flags);
  100. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  101. static public extern bool OpenClipboard(IntPtr hWndNewOwner);
  102. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  103. static public extern bool CloseClipboard();
  104. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  105. static public extern bool EmptyClipboard();
  106. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  107. static public extern IntPtr SetClipboardData( uint Format, IntPtr hData);
  108. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  109. static public extern bool GetMenuItemRect(IntPtr hWnd, IntPtr hMenu, uint Item, ref RECT rc);
  110. [DllImport("user32.dll", ExactSpelling=true, CharSet=CharSet.Auto)]
  111. public static extern IntPtr GetParent(IntPtr hWnd);
  112. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  113. public static extern int SendMessage(IntPtr hWnd, int msg, int wParam, int lParam);
  114. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  115. public static extern IntPtr SendMessage(IntPtr hWnd, int msg, int wParam, IntPtr lParam);
  116. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  117. public static extern void SendMessage(IntPtr hWnd, int msg, int wParam, ref RECT lParam);
  118. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  119. public static extern int SendMessage(IntPtr hWnd, int msg, int wParam, ref POINT lParam);
  120. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  121. public static extern void SendMessage(IntPtr hWnd, int msg, int wParam, ref TBBUTTON lParam);
  122. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  123. public static extern void SendMessage(IntPtr hWnd, int msg, int wParam, ref TBBUTTONINFO lParam);
  124. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  125. public static extern int SendMessage(IntPtr hWnd, int msg, int wParam, ref REBARBANDINFO lParam);
  126. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  127. public static extern void SendMessage(IntPtr hWnd, int msg, int wParam, ref TVITEM lParam);
  128. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  129. public static extern void SendMessage(IntPtr hWnd, int msg, int wParam, ref LVITEM lParam);
  130. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  131. public static extern void SendMessage(IntPtr hWnd, int msg, int wParam, ref HDITEM lParam);
  132. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  133. public static extern void SendMessage(IntPtr hWnd, int msg, int wParam, ref HD_HITTESTINFO hti);
  134. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  135. public static extern IntPtr PostMessage(IntPtr hWnd, int msg, int wParam, int lParam);
  136. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  137. public static extern IntPtr SetWindowsHookEx(int hookid, HookProc pfnhook, IntPtr hinst, int threadid);
  138. [DllImport("user32.dll", CharSet=CharSet.Auto, ExactSpelling=true)]
  139. public static extern bool UnhookWindowsHookEx(IntPtr hhook);
  140. [DllImport("user32.dll", CharSet=CharSet.Auto, ExactSpelling=true)]
  141. public static extern IntPtr CallNextHookEx(IntPtr hhook, int code, IntPtr wparam, IntPtr lparam);
  142. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  143. public static extern IntPtr SetFocus(IntPtr hWnd);
  144. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  145. public extern static int DrawText(IntPtr hdc, string lpString, int nCount, ref RECT lpRect, int uFormat);
  146. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  147. public extern static IntPtr SetParent(IntPtr hChild, IntPtr hParent);
  148. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  149. public extern static IntPtr GetDlgItem(IntPtr hDlg, int nControlID);
  150. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  151. public extern static int GetClientRect(IntPtr hWnd, ref RECT rc);
  152. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  153. public extern static int InvalidateRect(IntPtr hWnd,  IntPtr rect, int bErase);
  154. [DllImport("User32.dll", CharSet=CharSet.Auto)]
  155. public static extern bool WaitMessage();
  156. [DllImport("User32.dll", CharSet=CharSet.Auto)]
  157. public static extern bool PeekMessage(ref MSG msg, int hWnd, uint wFilterMin, uint wFilterMax, uint wFlag);
  158. [DllImport("User32.dll", CharSet=CharSet.Auto)]
  159. public static extern bool GetMessage(ref MSG msg, int hWnd, uint wFilterMin, uint wFilterMax);
  160. [DllImport("User32.dll", CharSet=CharSet.Auto)]
  161. public static extern bool TranslateMessage(ref MSG msg);
  162. [DllImport("User32.dll", CharSet=CharSet.Auto)]
  163. public static extern bool DispatchMessage(ref MSG msg);
  164. [DllImport("User32.dll", CharSet=CharSet.Auto)]
  165. public static extern IntPtr LoadCursor(IntPtr hInstance, uint cursor);
  166. [DllImport("User32.dll", CharSet=CharSet.Auto)]
  167. public static extern IntPtr SetCursor(IntPtr hCursor);
  168. [DllImport("User32.dll", CharSet=CharSet.Auto)]
  169. public static extern IntPtr GetFocus();
  170. [DllImport("User32.dll", CharSet=CharSet.Auto)]
  171. public static extern bool ReleaseCapture();
  172. [DllImport("User32.dll", CharSet=CharSet.Auto)]
  173. public static extern IntPtr BeginPaint(IntPtr hWnd, ref PAINTSTRUCT ps);
  174. [DllImport("User32.dll", CharSet=CharSet.Auto)]
  175. public static extern bool EndPaint(IntPtr hWnd, ref PAINTSTRUCT ps);
  176. [DllImport("User32.dll", CharSet=CharSet.Auto)]
  177. public static extern bool UpdateLayeredWindow(IntPtr hwnd, IntPtr hdcDst, ref POINT pptDst, ref SIZE psize, IntPtr hdcSrc, ref POINT pprSrc, Int32 crKey, ref BLENDFUNCTION pblend, Int32 dwFlags);
  178. [DllImport("User32.dll", CharSet=CharSet.Auto)]
  179. public static extern bool GetWindowRect(IntPtr hWnd, ref RECT rect);
  180. [DllImport("User32.dll", CharSet=CharSet.Auto)]
  181. public static extern bool ClientToScreen(IntPtr hWnd, ref POINT pt);
  182. [DllImport("User32.dll", CharSet=CharSet.Auto)]
  183. public static extern bool TrackMouseEvent(ref TRACKMOUSEEVENTS tme);
  184. [DllImport("User32.dll", CharSet=CharSet.Auto)]
  185. public static extern bool SetWindowRgn(IntPtr hWnd, IntPtr hRgn, bool redraw);
  186. [DllImport("User32.dll", CharSet=CharSet.Auto)]
  187. public static extern ushort GetKeyState(int virtKey);
  188. [DllImport("User32.dll", CharSet=CharSet.Auto)]
  189. public static extern bool MoveWindow(IntPtr hWnd, int x, int y, int width, int height, bool repaint);
  190. [DllImport("User32.dll", CharSet=CharSet.Auto)]
  191. public static extern int GetClassName(IntPtr hWnd,  out STRINGBUFFER ClassName, int nMaxCount);
  192. [DllImport("User32.dll", CharSet=CharSet.Auto)]
  193. public static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong);
  194. [DllImport("User32.dll", CharSet=CharSet.Auto)]
  195. public static extern IntPtr GetDCEx(IntPtr hWnd, IntPtr hRegion, uint flags);
  196. [DllImport("User32.dll", CharSet=CharSet.Auto)]
  197. public static extern IntPtr GetWindowDC(IntPtr hWnd);
  198. [DllImport("User32.dll", CharSet=CharSet.Auto)]
  199. public static extern int FillRect(IntPtr hDC, ref RECT rect, IntPtr hBrush);
  200. [DllImport("User32.dll", CharSet=CharSet.Auto)]
  201. public static extern int GetWindowPlacement(IntPtr hWnd, ref WINDOWPLACEMENT wp);
  202. [DllImport("User32.dll", CharSet=CharSet.Auto)]
  203. public static extern int SetWindowText(IntPtr hWnd, string text);
  204. [DllImport("User32.dll", CharSet=CharSet.Auto)]
  205. public static extern int GetWindowText(IntPtr hWnd, out STRINGBUFFER text, int maxCount);
  206. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  207. static public extern int SendMessage(IntPtr hWnd, int Msg, IntPtr wParam, IntPtr lParam);
  208. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  209. static public extern IntPtr SetClipboardViewer(IntPtr hWndNewViewer);
  210. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  211. static public extern int ChangeClipboardChain(IntPtr hWndRemove, IntPtr hWndNewNext);
  212. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  213. static public extern int GetSystemMetrics(int nIndex);
  214. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  215. static public extern int SetScrollInfo(IntPtr hwnd,  int bar, ref SCROLLINFO si, int fRedraw);
  216. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  217. public static extern int ShowScrollBar(IntPtr hWnd, int bar,  int show);
  218. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  219. public static extern int EnableScrollBar(IntPtr hWnd, uint flags, uint arrows);
  220. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  221. public static extern int BringWindowToTop(IntPtr hWnd);
  222. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  223. public static extern int GetScrollInfo(IntPtr hwnd, int bar, ref SCROLLINFO si);
  224. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  225. static public extern int ScrollWindowEx(IntPtr hWnd, int dx, int dy,
  226. ref RECT rcScroll, ref RECT rcClip, IntPtr UpdateRegion, ref RECT rcInvalidated, uint flags);
  227. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  228. public static extern int IsWindow(IntPtr hWnd);
  229. [DllImport("user32",CharSet=CharSet.Auto)]
  230. public static extern int GetKeyboardState(byte[] pbKeyState);
  231. [DllImport("user32")]
  232. public static extern int ToAscii(int uVirtKey, //[in] Specifies the virtual-key code to be translated.
  233. int uScanCode, // [in] Specifies the hardware scan code of the key to be translated. The high-order bit of this value is set if the key is up (not pressed).
  234. byte[] lpbKeyState, // [in] Pointer to a 256-byte array that contains the current keyboard state. Each element (byte) in the array contains the state of one key. If the high-order bit of a byte is set, the key is down (pressed). The low bit, if set, indicates that the key is toggled on. In this function, only the toggle bit of the CAPS LOCK key is relevant. The toggle state of the NUM LOCK and SCROLL LOCK keys is ignored.
  235. byte[] lpwTransKey, // [out] Pointer to the buffer that receives the translated character or characters.
  236. int fuState); // [in] Specifies whether a menu is active. This parameter must be 1 if a menu is active, or 0 otherwise.
  237. #endregion
  238. #region Common Controls functions
  239. [DllImport("comctl32.dll")]
  240. public static extern bool InitCommonControlsEx(INITCOMMONCONTROLSEX icc);
  241. [DllImport("comctl32.dll")]
  242. public static extern bool InitCommonControls();
  243. [DllImport("comctl32.dll", EntryPoint="DllGetVersion")]
  244. public extern static int GetCommonControlDLLVersion(ref DLLVERSIONINFO dvi);
  245. [DllImport("comctl32.dll")]
  246. public static extern IntPtr ImageList_Create(int width, int height, uint flags, int count, int grow);
  247. [DllImport("comctl32.dll")]
  248. public static extern bool ImageList_Destroy(IntPtr handle);
  249. [DllImport("comctl32.dll")]
  250. public static extern int ImageList_Add(IntPtr imageHandle, IntPtr hBitmap, IntPtr hMask);
  251. [DllImport("comctl32.dll")]
  252. public static extern bool ImageList_Remove(IntPtr imageHandle, int index);
  253. [DllImport("comctl32.dll")]
  254. public static extern bool ImageList_BeginDrag(IntPtr imageHandle, int imageIndex, int xHotSpot, int yHotSpot);
  255. [DllImport("comctl32.dll")]
  256. public static extern bool ImageList_DragEnter(IntPtr hWndLock, int x, int y);
  257. [DllImport("comctl32.dll")]
  258. public static extern bool ImageList_DragMove(int x, int y);
  259. [DllImport("comctl32.dll")]
  260. public static extern bool ImageList_DragLeave(IntPtr hWndLock);
  261. [DllImport("comctl32.dll")]
  262. public static extern void ImageList_EndDrag();
  263. #endregion
  264. #region Win32 Macro-Like helpers
  265. public static int GET_X_LPARAM(int lParam)
  266. {
  267. return (lParam & 0xffff);
  268. }
  269. public static int GET_Y_LPARAM(int lParam)
  270. {
  271. return (lParam >> 16);
  272. }
  273. public static Point GetPointFromLPARAM(int lParam)
  274. {
  275. return new Point(GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam));
  276. }
  277. public static int LOW_ORDER(int param)
  278. {
  279. return (param & 0xffff);
  280. }
  281. public static int HIGH_ORDER(int param)
  282. {
  283. return (param >> 16);
  284. }
  285. #endregion
  286. }
  287. }

Enums.cs,

  1. using System;
  2. using System.Runtime.InteropServices;
  3. using System.Drawing;
  4. using Lordal.Window.Form.Lib.General;
  5. using Lordal.Window.Form.Lib.Win32;
  6. namespace Lordeo.Framework
  7. {
  8. /// <summary>
  9. /// Window API enumerations
  10. /// </summary>
  11. #region Peek Message Flags
  12. public enum PeekMessageFlags
  13. {
  14. PM_NOREMOVE     = 0,
  15. PM_REMOVE       = 1,
  16. PM_NOYIELD      = 2
  17. }
  18. #endregion
  19. #region Windows Messages
  20. public enum WinMsg
  21. {
  22. WM_NULL                   = 0x0000,
  23. WM_CREATE                 = 0x0001,
  24. WM_DESTROY                = 0x0002,
  25. WM_MOVE                   = 0x0003,
  26. WM_SIZE                   = 0x0005,
  27. WM_ACTIVATE               = 0x0006,
  28. WM_SETFOCUS               = 0x0007,
  29. WM_KILLFOCUS              = 0x0008,
  30. WM_ENABLE                 = 0x000A,
  31. WM_SETREDRAW              = 0x000B,
  32. WM_SETTEXT                = 0x000C,
  33. WM_GETTEXT                = 0x000D,
  34. WM_GETTEXTLENGTH          = 0x000E,
  35. WM_PAINT                  = 0x000F,
  36. WM_CLOSE                  = 0x0010,
  37. WM_QUERYENDSESSION        = 0x0011,
  38. WM_QUIT                   = 0x0012,
  39. WM_QUERYOPEN              = 0x0013,
  40. WM_ERASEBKGND             = 0x0014,
  41. WM_SYSCOLORCHANGE         = 0x0015,
  42. WM_ENDSESSION             = 0x0016,
  43. WM_SHOWWINDOW             = 0x0018,
  44. WM_CTLCOLOR               = 0x0019,
  45. WM_WININICHANGE           = 0x001A,
  46. WM_SETTINGCHANGE          = 0x001A,
  47. WM_DEVMODECHANGE          = 0x001B,
  48. WM_ACTIVATEAPP            = 0x001C,
  49. WM_FONTCHANGE             = 0x001D,
  50. WM_TIMECHANGE             = 0x001E,
  51. WM_CANCELMODE             = 0x001F,
  52. WM_SETCURSOR              = 0x0020,
  53. WM_MOUSEACTIVATE          = 0x0021,
  54. WM_CHILDACTIVATE          = 0x0022,
  55. WM_QUEUESYNC              = 0x0023,
  56. WM_GETMINMAXINFO          = 0x0024,
  57. WM_PAINTICON              = 0x0026,
  58. WM_ICONERASEBKGND         = 0x0027,
  59. WM_NEXTDLGCTL             = 0x0028,
  60. WM_SPOOLERSTATUS          = 0x002A,
  61. WM_DRAWITEM               = 0x002B,
  62. WM_MEASUREITEM            = 0x002C,
  63. WM_DELETEITEM             = 0x002D,
  64. WM_VKEYTOITEM             = 0x002E,
  65. WM_CHARTOITEM             = 0x002F,
  66. WM_SETFONT                = 0x0030,
  67. WM_GETFONT                = 0x0031,
  68. WM_SETHOTKEY              = 0x0032,
  69. WM_GETHOTKEY              = 0x0033,
  70. WM_QUERYDRAGICON          = 0x0037,
  71. WM_COMPAREITEM            = 0x0039,
  72. WM_GETOBJECT              = 0x003D,
  73. WM_COMPACTING             = 0x0041,
  74. WM_COMMNOTIFY             = 0x0044 ,
  75. WM_WINDOWPOSCHANGING      = 0x0046,
  76. WM_WINDOWPOSCHANGED       = 0x0047,
  77. WM_POWER                  = 0x0048,
  78. WM_COPYDATA               = 0x004A,
  79. WM_CANCELJOURNAL          = 0x004B,
  80. WM_NOTIFY                 = 0x004E,
  81. WM_INPUTLANGCHANGEREQUEST = 0x0050,
  82. WM_INPUTLANGCHANGE        = 0x0051,
  83. WM_TCARD                  = 0x0052,
  84. WM_HELP                   = 0x0053,
  85. WM_USERCHANGED            = 0x0054,
  86. WM_NOTIFYFORMAT           = 0x0055,
  87. WM_CONTEXTMENU            = 0x007B,
  88. WM_STYLECHANGING          = 0x007C,
  89. WM_STYLECHANGED           = 0x007D,
  90. WM_DISPLAYCHANGE          = 0x007E,
  91. WM_GETICON                = 0x007F,
  92. WM_SETICON                = 0x0080,
  93. WM_NCCREATE               = 0x0081,
  94. WM_NCDESTROY              = 0x0082,
  95. WM_NCCALCSIZE             = 0x0083,
  96. WM_NCHITTEST              = 0x0084,
  97. WM_NCPAINT                = 0x0085,
  98. WM_NCACTIVATE             = 0x0086,
  99. WM_GETDLGCODE             = 0x0087,
  100. WM_SYNCPAINT              = 0x0088,
  101. WM_NCMOUSEMOVE            = 0x00A0,
  102. WM_NCLBUTTONDOWN          = 0x00A1,
  103. WM_NCLBUTTONUP            = 0x00A2,
  104. WM_NCLBUTTONDBLCLK        = 0x00A3,
  105. WM_NCRBUTTONDOWN          = 0x00A4,
  106. WM_NCRBUTTONUP            = 0x00A5,
  107. WM_NCRBUTTONDBLCLK        = 0x00A6,
  108. WM_NCMBUTTONDOWN          = 0x00A7,
  109. WM_NCMBUTTONUP            = 0x00A8,
  110. WM_NCMBUTTONDBLCLK        = 0x00A9,
  111. WM_KEYDOWN                = 0x0100,
  112. WM_KEYUP                  = 0x0101,
  113. WM_CHAR                   = 0x0102,
  114. WM_DEADCHAR               = 0x0103,
  115. WM_SYSKEYDOWN             = 0x0104,
  116. WM_SYSKEYUP               = 0x0105,
  117. WM_SYSCHAR                = 0x0106,
  118. WM_SYSDEADCHAR            = 0x0107,
  119. WM_KEYLAST                = 0x0108,
  120. WM_IME_STARTCOMPOSITION   = 0x010D,
  121. WM_IME_ENDCOMPOSITION     = 0x010E,
  122. WM_IME_COMPOSITION        = 0x010F,
  123. WM_IME_KEYLAST            = 0x010F,
  124. WM_INITDIALOG             = 0x0110,
  125. WM_COMMAND                = 0x0111,
  126. WM_SYSCOMMAND             = 0x0112,
  127. WM_TIMER                  = 0x0113,
  128. WM_HSCROLL                = 0x0114,
  129. WM_VSCROLL                = 0x0115,
  130. WM_INITMENU               = 0x0116,
  131. WM_INITMENUPOPUP          = 0x0117,
  132. WM_MENUSELECT             = 0x011F,
  133. WM_MENUCHAR               = 0x0120,
  134. WM_ENTERIDLE              = 0x0121,
  135. WM_MENURBUTTONUP          = 0x0122,
  136. WM_MENUDRAG               = 0x0123,
  137. WM_MENUGETOBJECT          = 0x0124,
  138. WM_UNINITMENUPOPUP        = 0x0125,
  139. WM_MENUCOMMAND            = 0x0126,
  140. WM_CTLCOLORWinMsgBOX      = 0x0132,
  141. WM_CTLCOLOREDIT           = 0x0133,
  142. WM_CTLCOLORLISTBOX        = 0x0134,
  143. WM_CTLCOLORBTN            = 0x0135,
  144. WM_CTLCOLORDLG            = 0x0136,
  145. WM_CTLCOLORSCROLLBAR      = 0x0137,
  146. WM_CTLCOLORSTATIC         = 0x0138,
  147. WM_MOUSEMOVE              = 0x0200,
  148. WM_LBUTTONDOWN            = 0x0201,
  149. WM_LBUTTONUP              = 0x0202,
  150. WM_LBUTTONDBLCLK          = 0x0203,
  151. WM_RBUTTONDOWN            = 0x0204,
  152. WM_RBUTTONUP              = 0x0205,
  153. WM_RBUTTONDBLCLK          = 0x0206,
  154. WM_MBUTTONDOWN            = 0x0207,
  155. WM_MBUTTONUP              = 0x0208,
  156. WM_MBUTTONDBLCLK          = 0x0209,
  157. WM_MOUSEWHEEL             = 0x020A,
  158. WM_PARENTNOTIFY           = 0x0210,
  159. WM_ENTERMENULOOP          = 0x0211,
  160. WM_EXITMENULOOP           = 0x0212,
  161. WM_NEXTMENU               = 0x0213,
  162. WM_SIZING                 = 0x0214,
  163. WM_CAPTURECHANGED         = 0x0215,
  164. WM_MOVING                 = 0x0216,
  165. WM_DEVICECHANGE           = 0x0219,
  166. WM_MDICREATE              = 0x0220,
  167. WM_MDIDESTROY             = 0x0221,
  168. WM_MDIACTIVATE            = 0x0222,
  169. WM_MDIRESTORE             = 0x0223,
  170. WM_MDINEXT                = 0x0224,
  171. WM_MDIMAXIMIZE            = 0x0225,
  172. WM_MDITILE                = 0x0226,
  173. WM_MDICASCADE             = 0x0227,
  174. WM_MDIICONARRANGE         = 0x0228,
  175. WM_MDIGETACTIVE           = 0x0229,
  176. WM_MDISETMENU             = 0x0230,
  177. WM_ENTERSIZEMOVE          = 0x0231,
  178. WM_EXITSIZEMOVE           = 0x0232,
  179. WM_DROPFILES              = 0x0233,
  180. WM_MDIREFRESHMENU         = 0x0234,
  181. WM_IME_SETCONTEXT         = 0x0281,
  182. WM_IME_NOTIFY             = 0x0282,
  183. WM_IME_CONTROL            = 0x0283,
  184. WM_IME_COMPOSITIONFULL    = 0x0284,
  185. WM_IME_SELECT             = 0x0285,
  186. WM_IME_CHAR               = 0x0286,
  187. WM_IME_REQUEST            = 0x0288,
  188. WM_IME_KEYDOWN            = 0x0290,
  189. WM_IME_KEYUP              = 0x0291,
  190. WM_MOUSEHOVER             = 0x02A1,
  191. WM_MOUSELEAVE             = 0x02A3,
  192. WM_CUT                    = 0x0300,
  193. WM_COPY                   = 0x0301,
  194. WM_PASTE                  = 0x0302,
  195. WM_CLEAR                  = 0x0303,
  196. WM_UNDO                   = 0x0304,
  197. WM_RENDERFORMAT           = 0x0305,
  198. WM_RENDERALLFORMATS       = 0x0306,
  199. WM_DESTROYCLIPBOARD       = 0x0307,
  200. WM_DRAWCLIPBOARD          = 0x0308,
  201. WM_PAINTCLIPBOARD         = 0x0309,
  202. WM_VSCROLLCLIPBOARD       = 0x030A,
  203. WM_SIZECLIPBOARD          = 0x030B,
  204. WM_ASKCBFORMATNAME        = 0x030C,
  205. WM_CHANGECBCHAIN          = 0x030D,
  206. WM_HSCROLLCLIPBOARD       = 0x030E,
  207. WM_QUERYNEWPALETTE        = 0x030F,
  208. WM_PALETTEISCHANGING      = 0x0310,
  209. WM_PALETTECHANGED         = 0x0311,
  210. WM_HOTKEY                 = 0x0312,
  211. WM_PRINT                  = 0x0317,
  212. WM_PRINTCLIENT            = 0x0318,
  213. WM_HANDHELDFIRST          = 0x0358,
  214. WM_HANDHELDLAST           = 0x035F,
  215. WM_AFXFIRST               = 0x0360,
  216. WM_AFXLAST                = 0x037F,
  217. WM_PENWINFIRST            = 0x0380,
  218. WM_PENWINLAST             = 0x038F,
  219. WM_APP                    = 0x8000,
  220. WM_USER                   = 0x0400,
  221. WM_REFLECT                = WM_USER + 0x1c00
  222. }
  223. #endregion
  224. #region Window Styles
  225. public enum WindowStyles : uint
  226. {
  227. WS_OVERLAPPED       = 0x00000000,
  228. WS_POPUP            = 0x80000000,
  229. WS_CHILD            = 0x40000000,
  230. WS_MINIMIZE         = 0x20000000,
  231. WS_VISIBLE          = 0x10000000,
  232. WS_DISABLED         = 0x08000000,
  233. WS_CLIPSIBLINGS     = 0x04000000,
  234. WS_CLIPCHILDREN     = 0x02000000,
  235. WS_MAXIMIZE         = 0x01000000,
  236. WS_CAPTION          = 0x00C00000,
  237. WS_BORDER           = 0x00800000,
  238. WS_DLGFRAME         = 0x00400000,
  239. WS_VSCROLL          = 0x00200000,
  240. WS_HSCROLL          = 0x00100000,
  241. WS_SYSMENU          = 0x00080000,
  242. WS_THICKFRAME       = 0x00040000,
  243. WS_GROUP            = 0x00020000,
  244. WS_TABSTOP          = 0x00010000,
  245. WS_MINIMIZEBOX      = 0x00020000,
  246. WS_MAXIMIZEBOX      = 0x00010000,
  247. WS_TILED            = 0x00000000,
  248. WS_ICONIC           = 0x20000000,
  249. WS_SIZEBOX          = 0x00040000,
  250. WS_POPUPWINDOW      = 0x80880000,
  251. WS_OVERLAPPEDWINDOW = 0x00CF0000,
  252. WS_TILEDWINDOW      = 0x00CF0000,
  253. WS_CHILDWINDOW      = 0x40000000
  254. }
  255. #endregion
  256. #region Window Extended Styles
  257. public enum WindowExStyles
  258. {
  259. WS_EX_DLGMODALFRAME     = 0x00000001,
  260. WS_EX_NOPARENTNOTIFY    = 0x00000004,
  261. WS_EX_TOPMOST           = 0x00000008,
  262. WS_EX_ACCEPTFILES       = 0x00000010,
  263. WS_EX_TRANSPARENT       = 0x00000020,
  264. WS_EX_MDICHILD          = 0x00000040,
  265. WS_EX_TOOLWINDOW        = 0x00000080,
  266. WS_EX_WINDOWEDGE        = 0x00000100,
  267. WS_EX_CLIENTEDGE        = 0x00000200,
  268. WS_EX_CONTEXTHELP       = 0x00000400,
  269. WS_EX_RIGHT             = 0x00001000,
  270. WS_EX_LEFT              = 0x00000000,
  271. WS_EX_RTLREADING        = 0x00002000,
  272. WS_EX_LTRREADING        = 0x00000000,
  273. WS_EX_LEFTSCROLLBAR     = 0x00004000,
  274. WS_EX_RIGHTSCROLLBAR    = 0x00000000,
  275. WS_EX_CONTROLPARENT     = 0x00010000,
  276. WS_EX_STATICEDGE        = 0x00020000,
  277. WS_EX_APPWINDOW         = 0x00040000,
  278. WS_EX_OVERLAPPEDWINDOW  = 0x00000300,
  279. WS_EX_PALETTEWINDOW     = 0x00000188,
  280. WS_EX_LAYERED           = 0x00080000
  281. }
  282. #endregion
  283. #region ShowWindow Styles
  284. public enum ShowWindowStyles : short
  285. {
  286. SW_HIDE             = 0,
  287. SW_SHOWNORMAL       = 1,
  288. SW_NORMAL           = 1,
  289. SW_SHOWMINIMIZED    = 2,
  290. SW_SHOWMAXIMIZED    = 3,
  291. SW_MAXIMIZE         = 3,
  292. SW_SHOWNOACTIVATE   = 4,
  293. SW_SHOW             = 5,
  294. SW_MINIMIZE         = 6,
  295. SW_SHOWMINNOACTIVE  = 7,
  296. SW_SHOWNA           = 8,
  297. SW_RESTORE          = 9,
  298. SW_SHOWDEFAULT      = 10,
  299. SW_FORCEMINIMIZE    = 11,
  300. SW_MAX              = 11
  301. }
  302. #endregion
  303. #region SetWindowPos Z Order
  304. public enum SetWindowPosZOrder
  305. {
  306. HWND_TOP        = 0,
  307. HWND_BOTTOM     = 1,
  308. HWND_TOPMOST    = -1,
  309. HWND_NOTOPMOST  = -2
  310. }
  311. #endregion
  312. #region SetWindowPosFlags
  313. public enum SetWindowPosFlags : uint
  314. {
  315. SWP_NOSIZE          = 0x0001,
  316. SWP_NOMOVE          = 0x0002,
  317. SWP_NOZORDER        = 0x0004,
  318. SWP_NOREDRAW        = 0x0008,
  319. SWP_NOACTIVATE      = 0x0010,
  320. SWP_FRAMECHANGED    = 0x0020,
  321. SWP_SHOWWINDOW      = 0x0040,
  322. SWP_HIDEWINDOW      = 0x0080,
  323. SWP_NOCOPYBITS      = 0x0100,
  324. SWP_NOOWNERZORDER   = 0x0200,
  325. SWP_NOSENDCHANGING  = 0x0400,
  326. SWP_DRAWFRAME       = 0x0020,
  327. SWP_NOREPOSITION    = 0x0200,
  328. SWP_DEFERERASE      = 0x2000,
  329. SWP_ASYNCWINDOWPOS  = 0x4000
  330. }
  331. #endregion
  332. #region Virtual Keys
  333. public enum VirtualKeys
  334. {
  335. VK_LBUTTON      = 0x01,
  336. VK_CANCEL       = 0x03,
  337. VK_BACK         = 0x08,
  338. VK_TAB          = 0x09,
  339. VK_CLEAR        = 0x0C,
  340. VK_RETURN       = 0x0D,
  341. VK_SHIFT        = 0x10,
  342. VK_CONTROL      = 0x11,
  343. VK_MENU         = 0x12,
  344. VK_CAPITAL      = 0x14,
  345. VK_ESCAPE       = 0x1B,
  346. VK_SPACE        = 0x20,
  347. VK_PRIOR        = 0x21,
  348. VK_NEXT         = 0x22,
  349. VK_END          = 0x23,
  350. VK_HOME         = 0x24,
  351. VK_LEFT         = 0x25,
  352. VK_UP           = 0x26,
  353. VK_RIGHT        = 0x27,
  354. VK_DOWN         = 0x28,
  355. VK_SELECT       = 0x29,
  356. VK_EXECUTE      = 0x2B,
  357. VK_SNAPSHOT     = 0x2C,
  358. VK_HELP         = 0x2F,
  359. VK_0            = 0x30,
  360. VK_1            = 0x31,
  361. VK_2            = 0x32,
  362. VK_3            = 0x33,
  363. VK_4            = 0x34,
  364. VK_5            = 0x35,
  365. VK_6            = 0x36,
  366. VK_7            = 0x37,
  367. VK_8            = 0x38,
  368. VK_9            = 0x39,
  369. VK_A            = 0x41,
  370. VK_B            = 0x42,
  371. VK_C            = 0x43,
  372. VK_D            = 0x44,
  373. VK_E            = 0x45,
  374. VK_F            = 0x46,
  375. VK_G            = 0x47,
  376. VK_H            = 0x48,
  377. VK_I            = 0x49,
  378. VK_J            = 0x4A,
  379. VK_K            = 0x4B,
  380. VK_L            = 0x4C,
  381. VK_M            = 0x4D,
  382. VK_N            = 0x4E,
  383. VK_O            = 0x4F,
  384. VK_P            = 0x50,
  385. VK_Q            = 0x51,
  386. VK_R            = 0x52,
  387. VK_S            = 0x53,
  388. VK_T            = 0x54,
  389. VK_U            = 0x55,
  390. VK_V            = 0x56,
  391. VK_W            = 0x57,
  392. VK_X            = 0x58,
  393. VK_Y            = 0x59,
  394. VK_Z            = 0x5A,
  395. VK_NUMPAD0      = 0x60,
  396. VK_NUMPAD1      = 0x61,
  397. VK_NUMPAD2      = 0x62,
  398. VK_NUMPAD3      = 0x63,
  399. VK_NUMPAD4      = 0x64,
  400. VK_NUMPAD5      = 0x65,
  401. VK_NUMPAD6      = 0x66,
  402. VK_NUMPAD7      = 0x67,
  403. VK_NUMPAD8      = 0x68,
  404. VK_NUMPAD9      = 0x69,
  405. VK_MULTIPLY     = 0x6A,
  406. VK_ADD          = 0x6B,
  407. VK_SEPARATOR    = 0x6C,
  408. VK_SUBTRACT     = 0x6D,
  409. VK_DECIMAL      = 0x6E,
  410. VK_DIVIDE       = 0x6F,
  411. VK_ATTN         = 0xF6,
  412. VK_CRSEL        = 0xF7,
  413. VK_EXSEL        = 0xF8,
  414. VK_EREOF        = 0xF9,
  415. VK_PLAY         = 0xFA,
  416. VK_ZOOM         = 0xFB,
  417. VK_NONAME       = 0xFC,
  418. VK_PA1          = 0xFD,
  419. VK_OEM_CLEAR    = 0xFE,
  420. VK_LWIN         = 0x5B,
  421. VK_RWIN         = 0x5C,
  422. VK_APPS         = 0x5D,
  423. VK_LSHIFT       = 0xA0,
  424. VK_RSHIFT       = 0xA1,
  425. VK_LCONTROL     = 0xA2,
  426. VK_RCONTROL     = 0xA3,
  427. VK_LMENU        = 0xA4,
  428. VK_RMENU        = 0xA5
  429. }
  430. #endregion
  431. #region PatBlt Types
  432. public enum PatBltTypes
  433. {
  434. SRCCOPY          =   0x00CC0020,
  435. SRCPAINT         =   0x00EE0086,
  436. SRCAND           =   0x008800C6,
  437. SRCINVERT        =   0x00660046,
  438. SRCERASE         =   0x00440328,
  439. NOTSRCCOPY       =   0x00330008,
  440. NOTSRCERASE      =   0x001100A6,
  441. MERGECOPY        =   0x00C000CA,
  442. MERGEPAINT       =   0x00BB0226,
  443. PATCOPY          =   0x00F00021,
  444. PATPAINT         =   0x00FB0A09,
  445. PATINVERT        =   0x005A0049,
  446. DSTINVERT        =   0x00550009,
  447. BLACKNESS        =   0x00000042,
  448. WHITENESS        =   0x00FF0062
  449. }
  450. #endregion
  451. #region Clipboard Formats
  452. public enum ClipboardFormats : uint
  453. {
  454. CF_TEXT             = 1,
  455. CF_BITMAP           = 2,
  456. CF_METAFILEPICT     = 3,
  457. CF_SYLK             = 4,
  458. CF_DIF              = 5,
  459. CF_TIFF             = 6,
  460. CF_OEMTEXT          = 7,
  461. CF_DIB              = 8,
  462. CF_PALETTE          = 9,
  463. CF_PENDATA          = 10,
  464. CF_RIFF             = 11,
  465. CF_WAVE             = 12,
  466. CF_UNICODETEXT      = 13,
  467. CF_ENHMETAFILE      = 14,
  468. CF_HDROP            = 15,
  469. CF_LOCALE           = 16,
  470. CF_MAX              = 17,
  471. CF_OWNERDISPLAY     = 0x0080,
  472. CF_DSPTEXT          = 0x0081,
  473. CF_DSPBITMAP        = 0x0082,
  474. CF_DSPMETAFILEPICT  = 0x0083,
  475. CF_DSPENHMETAFILE   = 0x008E,
  476. CF_PRIVATEFIRST     = 0x0200,
  477. CF_PRIVATELAST      = 0x02FF,
  478. CF_GDIOBJFIRST      = 0x0300,
  479. CF_GDIOBJLAST       = 0x03FF
  480. }
  481. #endregion
  482. #region Common Controls Initialization flags
  483. public enum CommonControlInitFlags
  484. {
  485. ICC_LISTVIEW_CLASSES   = 0x00000001,
  486. ICC_TREEVIEW_CLASSES   = 0x00000002,
  487. ICC_BAR_CLASSES        = 0x00000004,
  488. ICC_TAB_CLASSES        = 0x00000008,
  489. ICC_UPDOWN_CLASS       = 0x00000010,
  490. ICC_PROGRESS_CLASS     = 0x00000020,
  491. ICC_HOTKEY_CLASS       = 0x00000040,
  492. ICC_ANIMATE_CLASS      = 0x00000080,
  493. ICC_WIN95_CLASSES      = 0x000000FF,
  494. ICC_DATE_CLASSES       = 0x00000100,
  495. ICC_USEREX_CLASSES     = 0x00000200,
  496. ICC_COOL_CLASSES       = 0x00000400,
  497. ICC_INTERNET_CLASSES   = 0x00000800,
  498. ICC_PAGESCROLLER_CLASS = 0x00001000,
  499. ICC_NATIVEFNTCTL_CLASS = 0x00002000
  500. }
  501. #endregion
  502. #region Common Controls Styles
  503. public  enum CommonControlStyles
  504. {
  505. CCS_TOP                 = 0x00000001,
  506. CCS_NOMOVEY             = 0x00000002,
  507. CCS_BOTTOM              = 0x00000003,
  508. CCS_NORESIZE            = 0x00000004,
  509. CCS_NOPARENTALIGN       = 0x00000008,
  510. CCS_ADJUSTABLE          = 0x00000020,
  511. CCS_NODIVIDER           = 0x00000040,
  512. CCS_VERT                = 0x00000080,
  513. CCS_LEFT                = (CCS_VERT | CCS_TOP),
  514. CCS_RIGHT               = (CCS_VERT | CCS_BOTTOM),
  515. CCS_NOMOVEX             = (CCS_VERT | CCS_NOMOVEY)
  516. }
  517. #endregion
  518. #region ToolBar Styles
  519. public enum ToolBarStyles
  520. {
  521. TBSTYLE_BUTTON          = 0x0000,
  522. TBSTYLE_SEP             = 0x0001,
  523. TBSTYLE_CHECK           = 0x0002,
  524. TBSTYLE_GROUP           = 0x0004,
  525. TBSTYLE_CHECKGROUP      = (TBSTYLE_GROUP | TBSTYLE_CHECK),
  526. TBSTYLE_DROPDOWN        = 0x0008,
  527. TBSTYLE_AUTOSIZE        = 0x0010,
  528. TBSTYLE_NOPREFIX        = 0x0020,
  529. TBSTYLE_TOOLTIPS        = 0x0100,
  530. TBSTYLE_WRAPABLE        = 0x0200,
  531. TBSTYLE_ALTDRAG         = 0x0400,
  532. TBSTYLE_FLAT            = 0x0800,
  533. TBSTYLE_LIST            = 0x1000,
  534. TBSTYLE_CUSTOMERASE     = 0x2000,
  535. TBSTYLE_REGISTERDROP    = 0x4000,
  536. TBSTYLE_TRANSPARENT     = 0x8000,
  537. TBSTYLE_EX_DRAWDDARROWS = 0x00000001
  538. }
  539. #endregion
  540. #region ToolBar Ex Styles
  541. public enum ToolBarExStyles
  542. {
  543. TBSTYLE_EX_DRAWDDARROWS         = 0x1,
  544. TBSTYLE_EX_HIDECLIPPEDBUTTONS   = 0x10,
  545. TBSTYLE_EX_DOUBLEBUFFER         = 0x80
  546. }
  547. #endregion
  548. #region ToolBar Messages
  549. public enum ToolBarMessages
  550. {
  551. WM_USER                 =  0x0400,
  552. TB_ENABLEBUTTON         = (WM_USER + 1),
  553. TB_CHECKBUTTON          = (WM_USER + 2),
  554. TB_PRESSBUTTON          = (WM_USER + 3),
  555. TB_HIDEBUTTON           = (WM_USER + 4),
  556. TB_INDETERMINATE        = (WM_USER + 5),
  557. TB_MARKBUTTON           = (WM_USER + 6),
  558. TB_ISBUTTONENABLED      = (WM_USER + 9),
  559. TB_ISBUTTONCHECKED      = (WM_USER + 10),
  560. TB_ISBUTTONPRESSED      = (WM_USER + 11),
  561. TB_ISBUTTONHIDDEN       = (WM_USER + 12),
  562. TB_ISBUTTONINDETERMINATE= (WM_USER + 13),
  563. TB_ISBUTTONHIGHLIGHTED  = (WM_USER + 14),
  564. TB_SETSTATE             = (WM_USER + 17),
  565. TB_GETSTATE             = (WM_USER + 18),
  566. TB_ADDBITMAP            = (WM_USER + 19),
  567. TB_ADDBUTTONSA          = (WM_USER + 20),
  568. TB_INSERTBUTTONA        = (WM_USER + 21),
  569. TB_ADDBUTTONS           = (WM_USER + 20),
  570. TB_INSERTBUTTON         = (WM_USER + 21),
  571. TB_DELETEBUTTON         = (WM_USER + 22),
  572. TB_GETBUTTON            = (WM_USER + 23),
  573. TB_BUTTONCOUNT          = (WM_USER + 24),
  574. TB_COMMANDTOINDEX       = (WM_USER + 25),
  575. TB_SAVERESTOREA         = (WM_USER + 26),
  576. TB_CUSTOMIZE            = (WM_USER + 27),
  577. TB_ADDSTRINGA           = (WM_USER + 28),
  578. TB_GETITEMRECT          = (WM_USER + 29),
  579. TB_BUTTONSTRUCTSIZE     = (WM_USER + 30),
  580. TB_SETBUTTONSIZE        = (WM_USER + 31),
  581. TB_SETBITMAPSIZE        = (WM_USER + 32),
  582. TB_AUTOSIZE             = (WM_USER + 33),
  583. TB_GETTOOLTIPS          = (WM_USER + 35),
  584. TB_SETTOOLTIPS          = (WM_USER + 36),
  585. TB_SETPARENT            = (WM_USER + 37),
  586. TB_SETROWS              = (WM_USER + 39),
  587. TB_GETROWS              = (WM_USER + 40),
  588. TB_GETBITMAPFLAGS       = (WM_USER + 41),
  589. TB_SETCMDID             = (WM_USER + 42),
  590. TB_CHANGEBITMAP         = (WM_USER + 43),
  591. TB_GETBITMAP            = (WM_USER + 44),
  592. TB_GETBUTTONTEXTA       = (WM_USER + 45),
  593. TB_GETBUTTONTEXTW       = (WM_USER + 75),
  594. TB_REPLACEBITMAP        = (WM_USER + 46),
  595. TB_SETINDENT            = (WM_USER + 47),
  596. TB_SETIMAGELIST         = (WM_USER + 48),
  597. TB_GETIMAGELIST         = (WM_USER + 49),
  598. TB_LOADIMAGES           = (WM_USER + 50),
  599. TB_GETRECT              = (WM_USER + 51),
  600. TB_SETHOTIMAGELIST      = (WM_USER + 52),
  601. TB_GETHOTIMAGELIST      = (WM_USER + 53),
  602. TB_SETDISABLEDIMAGELIST = (WM_USER + 54),
  603. TB_GETDISABLEDIMAGELIST = (WM_USER + 55),
  604. TB_SETSTYLE             = (WM_USER + 56),
  605. TB_GETSTYLE             = (WM_USER + 57),
  606. TB_GETBUTTONSIZE        = (WM_USER + 58),
  607. TB_SETBUTTONWIDTH       = (WM_USER + 59),
  608. TB_SETMAXTEXTROWS       = (WM_USER + 60),
  609. TB_GETTEXTROWS          = (WM_USER + 61),
  610. TB_GETOBJECT            = (WM_USER + 62),
  611. TB_GETBUTTONINFOW       = (WM_USER + 63),
  612. TB_SETBUTTONINFOW       = (WM_USER + 64),
  613. TB_GETBUTTONINFOA       = (WM_USER + 65),
  614. TB_SETBUTTONINFOA       = (WM_USER + 66),
  615. TB_INSERTBUTTONW        = (WM_USER + 67),
  616. TB_ADDBUTTONSW          = (WM_USER + 68),
  617. TB_HITTEST              = (WM_USER + 69),
  618. TB_SETDRAWTEXTFLAGS     = (WM_USER + 70),
  619. TB_GETHOTITEM           = (WM_USER + 71),
  620. TB_SETHOTITEM           = (WM_USER + 72),
  621. TB_SETANCHORHIGHLIGHT   = (WM_USER + 73),
  622. TB_GETANCHORHIGHLIGHT   = (WM_USER + 74),
  623. TB_SAVERESTOREW         = (WM_USER + 76),
  624. TB_ADDSTRINGW           = (WM_USER + 77),
  625. TB_MAPACCELERATORA      = (WM_USER + 78),
  626. TB_GETINSERTMARK        = (WM_USER + 79),
  627. TB_SETINSERTMARK        = (WM_USER + 80),
  628. TB_INSERTMARKHITTEST    = (WM_USER + 81),
  629. TB_MOVEBUTTON           = (WM_USER + 82),
  630. TB_GETMAXSIZE           = (WM_USER + 83),
  631. TB_SETEXTENDEDSTYLE     = (WM_USER + 84),
  632. TB_GETEXTENDEDSTYLE     = (WM_USER + 85),
  633. TB_GETPADDING           = (WM_USER + 86),
  634. TB_SETPADDING           = (WM_USER + 87),
  635. TB_SETINSERTMARKCOLOR   = (WM_USER + 88),
  636. TB_GETINSERTMARKCOLOR   = (WM_USER + 89)
  637. }
  638. #endregion
  639. #region ToolBar Notifications
  640. public enum ToolBarNotifications
  641. {
  642. TTN_NEEDTEXTA       = ((0-520)-0),
  643. TTN_NEEDTEXTW       = ((0-520)-10),
  644. TBN_QUERYINSERT     = ((0-700)-6),
  645. TBN_DROPDOWN        = ((0-700)-10),
  646. TBN_HOTITEMCHANGE   = ((0 - 700) - 13)
  647. }
  648. #endregion
  649. #region Reflected Messages
  650. public enum ReflectedMessages
  651. {
  652. OCM__BASE               = (WinMsg.WM_USER+0x1c00),
  653. OCM_COMMAND             = (OCM__BASE + WinMsg.WM_COMMAND),
  654. OCM_CTLCOLORBTN         = (OCM__BASE + WinMsg.WM_CTLCOLORBTN),
  655. OCM_CTLCOLOREDIT        = (OCM__BASE + WinMsg.WM_CTLCOLOREDIT),
  656. OCM_CTLCOLORDLG         = (OCM__BASE + WinMsg.WM_CTLCOLORDLG),
  657. OCM_CTLCOLORLISTBOX     = (OCM__BASE + WinMsg.WM_CTLCOLORLISTBOX),
  658. OCM_CTLCOLORWinMsgBOX       = (OCM__BASE + WinMsg.WM_CTLCOLORWinMsgBOX),
  659. OCM_CTLCOLORSCROLLBAR   = (OCM__BASE + WinMsg.WM_CTLCOLORSCROLLBAR),
  660. OCM_CTLCOLORSTATIC      = (OCM__BASE + WinMsg.WM_CTLCOLORSTATIC),
  661. OCM_CTLCOLOR            = (OCM__BASE + WinMsg.WM_CTLCOLOR),
  662. OCM_DRAWITEM            = (OCM__BASE + WinMsg.WM_DRAWITEM),
  663. OCM_MEASUREITEM         = (OCM__BASE + WinMsg.WM_MEASUREITEM),
  664. OCM_DELETEITEM          = (OCM__BASE + WinMsg.WM_DELETEITEM),
  665. OCM_VKEYTOITEM          = (OCM__BASE + WinMsg.WM_VKEYTOITEM),
  666. OCM_CHARTOITEM          = (OCM__BASE + WinMsg.WM_CHARTOITEM),
  667. OCM_COMPAREITEM         = (OCM__BASE + WinMsg.WM_COMPAREITEM),
  668. OCM_HSCROLL             = (OCM__BASE + WinMsg.WM_HSCROLL),
  669. OCM_VSCROLL             = (OCM__BASE + WinMsg.WM_VSCROLL),
  670. OCM_PARENTNOTIFY        = (OCM__BASE + WinMsg.WM_PARENTNOTIFY),
  671. OCM_NOTIFY              = (OCM__BASE + WinMsg.WM_NOTIFY)
  672. }
  673. #endregion
  674. #region Notification Messages
  675. public enum NotificationMessages
  676. {
  677. NM_FIRST      = (0-0),
  678. NM_CUSTOMDRAW = (NM_FIRST-12),
  679. NM_NCHITTEST  = (NM_FIRST-14)
  680. }
  681. #endregion
  682. #region ToolTip Flags
  683. public enum ToolTipFlags
  684. {
  685. TTF_CENTERTIP           = 0x0002,
  686. TTF_RTLREADING          = 0x0004,
  687. TTF_SUBCLASS            = 0x0010,
  688. TTF_TRACK               = 0x0020,
  689. TTF_ABSOLUTE            = 0x0080,
  690. TTF_TRANSPARENT         = 0x0100,
  691. TTF_DI_SETITEM          = 0x8000
  692. }
  693. #endregion
  694. #region Custom Draw Return Flags
  695. public enum CustomDrawReturnFlags
  696. {
  697. CDRF_DODEFAULT          = 0x00000000,
  698. CDRF_NEWFONT            = 0x00000002,
  699. CDRF_SKIPDEFAULT        = 0x00000004,
  700. CDRF_NOTIFYPOSTPAINT    = 0x00000010,
  701. CDRF_NOTIFYITEMDRAW     = 0x00000020,
  702. CDRF_NOTIFYSUBITEMDRAW  = 0x00000020,
  703. CDRF_NOTIFYPOSTERASE    = 0x00000040
  704. }
  705. #endregion
  706. #region Custom Draw Item State Flags
  707. public enum CustomDrawItemStateFlags
  708. {
  709. CDIS_SELECTED       = 0x0001,
  710. CDIS_GRAYED         = 0x0002,
  711. CDIS_DISABLED       = 0x0004,
  712. CDIS_CHECKED        = 0x0008,
  713. CDIS_FOCUS          = 0x0010,
  714. CDIS_DEFAULT        = 0x0020,
  715. CDIS_HOT            = 0x0040,
  716. CDIS_MARKED         = 0x0080,
  717. CDIS_INDETERMINATE  = 0x0100
  718. }
  719. #endregion
  720. #region Custom Draw Draw State Flags
  721. public enum CustomDrawDrawStateFlags
  722. {
  723. CDDS_PREPAINT           = 0x00000001,
  724. CDDS_POSTPAINT          = 0x00000002,
  725. CDDS_PREERASE           = 0x00000003,
  726. CDDS_POSTERASE          = 0x00000004,
  727. CDDS_ITEM               = 0x00010000,
  728. CDDS_ITEMPREPAINT       = (CDDS_ITEM | CDDS_PREPAINT),
  729. CDDS_ITEMPOSTPAINT      = (CDDS_ITEM | CDDS_POSTPAINT),
  730. CDDS_ITEMPREERASE       = (CDDS_ITEM | CDDS_PREERASE),
  731. CDDS_ITEMPOSTERASE      = (CDDS_ITEM | CDDS_POSTERASE),
  732. CDDS_SUBITEM            = 0x00020000
  733. }
  734. #endregion
  735. #region Toolbar button info flags
  736. public enum ToolBarButtonInfoFlags
  737. {
  738. TBIF_IMAGE             = 0x00000001,
  739. TBIF_TEXT              = 0x00000002,
  740. TBIF_STATE             = 0x00000004,
  741. TBIF_STYLE             = 0x00000008,
  742. TBIF_LPARAM            = 0x00000010,
  743. TBIF_COMMAND           = 0x00000020,
  744. TBIF_SIZE              = 0x00000040,
  745. I_IMAGECALLBACK        = -1,
  746. I_IMAGENONE            = -2
  747. }
  748. #endregion
  749. #region Toolbar button styles
  750. public enum ToolBarButtonStyles
  751. {
  752. TBSTYLE_BUTTON          = 0x0000,
  753. TBSTYLE_SEP             = 0x0001,
  754. TBSTYLE_CHECK           = 0x0002,
  755. TBSTYLE_GROUP           = 0x0004,
  756. TBSTYLE_CHECKGROUP      = (TBSTYLE_GROUP | TBSTYLE_CHECK),
  757. TBSTYLE_DROPDOWN        = 0x0008,
  758. TBSTYLE_AUTOSIZE        = 0x0010,
  759. TBSTYLE_NOPREFIX        = 0x0020,
  760. TBSTYLE_TOOLTIPS        = 0x0100,
  761. TBSTYLE_WRAPABLE        = 0x0200,
  762. TBSTYLE_ALTDRAG         = 0x0400,
  763. TBSTYLE_FLAT            = 0x0800,
  764. TBSTYLE_LIST            = 0x1000,
  765. TBSTYLE_CUSTOMERASE     = 0x2000,
  766. TBSTYLE_REGISTERDROP    = 0x4000,
  767. TBSTYLE_TRANSPARENT     = 0x8000,
  768. TBSTYLE_EX_DRAWDDARROWS = 0x00000001
  769. }
  770. #endregion
  771. #region Toolbar button state
  772. public enum ToolBarButtonStates
  773. {
  774. TBSTATE_CHECKED         = 0x01,
  775. TBSTATE_PRESSED         = 0x02,
  776. TBSTATE_ENABLED         = 0x04,
  777. TBSTATE_HIDDEN          = 0x08,
  778. TBSTATE_INDETERMINATE   = 0x10,
  779. TBSTATE_WRAP            = 0x20,
  780. TBSTATE_ELLIPSES        = 0x40,
  781. TBSTATE_MARKED          = 0x80
  782. }
  783. #endregion
  784. #region Windows Hook Codes
  785. public enum WindowsHookCodes
  786. {
  787. WH_MSGFILTER        = (-1),
  788. WH_JOURNALRECORD    = 0,
  789. WH_JOURNALPLAYBACK  = 1,
  790. WH_KEYBOARD         = 2,
  791. WH_GETMESSAGE       = 3,
  792. WH_CALLWNDPROC      = 4,
  793. WH_CBT              = 5,
  794. WH_SYSMSGFILTER     = 6,
  795. WH_MOUSE            = 7,
  796. WH_HARDWARE         = 8,
  797. WH_DEBUG            = 9,
  798. WH_SHELL            = 10,
  799. WH_FOREGROUNDIDLE   = 11,
  800. WH_CALLWNDPROCRET   = 12,
  801. WH_KEYBOARD_LL      = 13,
  802. WH_MOUSE_LL         = 14
  803. }
  804. #endregion
  805. #region Mouse Hook Filters
  806. public enum MouseHookFilters
  807. {
  808. MSGF_DIALOGBOX      = 0,
  809. MSGF_MESSAGEBOX     = 1,
  810. MSGF_MENU           = 2,
  811. MSGF_SCROLLBAR      = 5,
  812. MSGF_NEXTWINDOW     = 6
  813. }
  814. #endregion
  815. #region Draw Text format flags
  816. public enum DrawTextFormatFlags
  817. {
  818. DT_TOP              = 0x00000000,
  819. DT_LEFT             = 0x00000000,
  820. DT_CENTER           = 0x00000001,
  821. DT_RIGHT            = 0x00000002,
  822. DT_VCENTER          = 0x00000004,
  823. DT_BOTTOM           = 0x00000008,
  824. DT_WORDBREAK        = 0x00000010,
  825. DT_SINGLELINE       = 0x00000020,
  826. DT_EXPANDTABS       = 0x00000040,
  827. DT_TABSTOP          = 0x00000080,
  828. DT_NOCLIP           = 0x00000100,
  829. DT_EXTERNALLEADING  = 0x00000200,
  830. DT_CALCRECT         = 0x00000400,
  831. DT_NOPREFIX         = 0x00000800,
  832. DT_INTERNAL         = 0x00001000,
  833. DT_EDITCONTROL      = 0x00002000,
  834. DT_PATH_ELLIPSIS    = 0x00004000,
  835. DT_END_ELLIPSIS     = 0x00008000,
  836. DT_MODIFYSTRING     = 0x00010000,
  837. DT_RTLREADING       = 0x00020000,
  838. DT_WORD_ELLIPSIS    = 0x00040000
  839. }
  840. #endregion
  841. #region Rebar Styles
  842. public enum RebarStyles
  843. {
  844. RBS_TOOLTIPS        = 0x0100,
  845. RBS_VARHEIGHT       = 0x0200,
  846. RBS_BANDBORDERS     = 0x0400,
  847. RBS_FIXEDORDER      = 0x0800,
  848. RBS_REGISTERDROP    = 0x1000,
  849. RBS_AUTOSIZE        = 0x2000,
  850. RBS_VERTICALGRIPPER = 0x4000,
  851. RBS_DBLCLKTOGGLE    = 0x8000,
  852. }
  853. #endregion
  854. #region Rebar Notifications
  855. public enum RebarNotifications
  856. {
  857. RBN_FIRST           = (0-831),
  858. RBN_HEIGHTCHANGE    = (RBN_FIRST - 0),
  859. RBN_GETOBJECT       = (RBN_FIRST - 1),
  860. RBN_LAYOUTCHANGED   = (RBN_FIRST - 2),
  861. RBN_AUTOSIZE        = (RBN_FIRST - 3),
  862. RBN_BEGINDRAG       = (RBN_FIRST - 4),
  863. RBN_ENDDRAG         = (RBN_FIRST - 5),
  864. RBN_DELETINGBAND    = (RBN_FIRST - 6),
  865. RBN_DELETEDBAND     = (RBN_FIRST - 7),
  866. RBN_CHILDSIZE       = (RBN_FIRST - 8),
  867. RBN_CHEVRONPUSHED   = (RBN_FIRST - 10)
  868. }
  869. #endregion
  870. #region Rebar Messages
  871. public enum RebarMessages
  872. {
  873. CCM_FIRST           =    0x2000,
  874. WM_USER             =    0x0400,
  875. RB_INSERTBANDA      =   (WM_USER +  1),
  876. RB_DELETEBAND       =   (WM_USER +  2),
  877. RB_GETBARINFO       =   (WM_USER +  3),
  878. RB_SETBARINFO       =   (WM_USER +  4),
  879. RB_GETBANDINFO      =   (WM_USER +  5),
  880. RB_SETBANDINFOA     =   (WM_USER +  6),
  881. RB_SETPARENT        =   (WM_USER +  7),
  882. RB_HITTEST          =   (WM_USER +  8),
  883. RB_GETRECT          =   (WM_USER +  9),
  884. RB_INSERTBANDW      =   (WM_USER +  10),
  885. RB_SETBANDINFOW     =   (WM_USER +  11),
  886. RB_GETBANDCOUNT     =   (WM_USER +  12),
  887. RB_GETROWCOUNT      =   (WM_USER +  13),
  888. RB_GETROWHEIGHT     =   (WM_USER +  14),
  889. RB_IDTOINDEX        =   (WM_USER +  16),
  890. RB_GETTOOLTIPS      =   (WM_USER +  17),
  891. RB_SETTOOLTIPS      =   (WM_USER +  18),
  892. RB_SETBKCOLOR       =   (WM_USER +  19),
  893. RB_GETBKCOLOR       =   (WM_USER +  20),
  894. RB_SETTEXTCOLOR     =   (WM_USER +  21),
  895. RB_GETTEXTCOLOR     =   (WM_USER +  22),
  896. RB_SIZETORECT       =   (WM_USER +  23),
  897. RB_SETCOLORSCHEME   =   (CCM_FIRST + 2),
  898. RB_GETCOLORSCHEME   =   (CCM_FIRST + 3),
  899. RB_BEGINDRAG        =   (WM_USER + 24),
  900. RB_ENDDRAG          =   (WM_USER + 25),
  901. RB_DRAGMOVE         =   (WM_USER + 26),
  902. RB_GETBARHEIGHT     =   (WM_USER + 27),
  903. RB_GETBANDINFOW     =   (WM_USER + 28),
  904. RB_GETBANDINFOA     =   (WM_USER + 29),
  905. RB_MINIMIZEBAND     =   (WM_USER + 30),
  906. RB_MAXIMIZEBAND     =   (WM_USER + 31),
  907. RB_GETDROPTARGET    =   (CCM_FIRST + 4),
  908. RB_GETBANDBORDERS   =   (WM_USER + 34),
  909. RB_SHOWBAND         =   (WM_USER + 35),
  910. RB_SETPALETTE       =   (WM_USER + 37),
  911. RB_GETPALETTE       =   (WM_USER + 38),
  912. RB_MOVEBAND         =   (WM_USER + 39),
  913. RB_SETUNICODEFORMAT =   (CCM_FIRST + 5),
  914. RB_GETUNICODEFORMAT =   (CCM_FIRST + 6)
  915. }
  916. #endregion
  917. #region Rebar Info Mask
  918. public enum RebarInfoMask
  919. {
  920. RBBIM_STYLE         = 0x00000001,
  921. RBBIM_COLORS        = 0x00000002,
  922. RBBIM_TEXT          = 0x00000004,
  923. RBBIM_IMAGE         = 0x00000008,
  924. RBBIM_CHILD         = 0x00000010,
  925. RBBIM_CHILDSIZE     = 0x00000020,
  926. RBBIM_SIZE          = 0x00000040,
  927. RBBIM_BACKGROUND    = 0x00000080,
  928. RBBIM_ID            = 0x00000100,
  929. RBBIM_IDEALSIZE     = 0x00000200,
  930. RBBIM_LPARAM        = 0x00000400,
  931. BBIM_HEADERSIZE     = 0x00000800
  932. }
  933. #endregion
  934. #region Rebar Styles
  935. public enum RebarStylesEx
  936. {
  937. RBBS_BREAK          =   0x1,
  938. RBBS_CHILDEDGE      =   0x4,
  939. RBBS_FIXEDBMP       =   0x20,
  940. RBBS_GRIPPERALWAYS  =   0x80,
  941. RBBS_USECHEVRON     =   0x200
  942. }
  943. #endregion
  944. #region Object types
  945. public enum ObjectTypes
  946. {
  947. OBJ_PEN             = 1,
  948. OBJ_BRUSH           = 2,
  949. OBJ_DC              = 3,
  950. OBJ_METADC          = 4,
  951. OBJ_PAL             = 5,
  952. OBJ_FONT            = 6,
  953. OBJ_BITMAP          = 7,
  954. OBJ_REGION          = 8,
  955. OBJ_METAFILE        = 9,
  956. OBJ_MEMDC           = 10,
  957. OBJ_EXTPEN          = 11,
  958. OBJ_ENHMETADC       = 12,
  959. OBJ_ENHMETAFILE     = 13
  960. }
  961. #endregion
  962. #region WM_MENUCHAR return values
  963. public enum MenuCharReturnValues
  964. {
  965. MNC_IGNORE  = 0,
  966. MNC_CLOSE   = 1,
  967. MNC_EXECUTE = 2,
  968. MNC_SELECT  = 3
  969. }
  970. #endregion
  971. #region Background Mode
  972. public enum BackgroundMode
  973. {
  974. TRANSPARENT = 1,
  975. OPAQUE = 2
  976. }
  977. #endregion
  978. #region ListView Messages
  979. public enum ListViewMessages
  980. {
  981. LVM_FIRST           =    0x1000,
  982. LVM_GETSUBITEMRECT  = (LVM_FIRST + 56),
  983. LVM_GETITEMSTATE    = (LVM_FIRST + 44),
  984. LVM_GETITEMTEXTW    = (LVM_FIRST + 115)
  985. }
  986. #endregion
  987. #region Header Control Messages
  988. public enum HeaderControlMessages : int
  989. {
  990. HDM_FIRST        =  0x1200,
  991. HDM_GETITEMRECT  = (HDM_FIRST + 7),
  992. HDM_HITTEST      = (HDM_FIRST + 6),
  993. HDM_SETIMAGELIST = (HDM_FIRST + 8),
  994. HDM_GETITEMW     = (HDM_FIRST + 11),
  995. HDM_ORDERTOINDEX = (HDM_FIRST + 15)
  996. }
  997. #endregion
  998. #region Header Control Notifications
  999. public enum HeaderControlNotifications
  1000. {
  1001. HDN_FIRST       = (0-300),
  1002. HDN_BEGINTRACKW = (HDN_FIRST-26),
  1003. HDN_ENDTRACKW   = (HDN_FIRST-27),
  1004. HDN_ITEMCLICKW  = (HDN_FIRST-22),
  1005. }
  1006. #endregion
  1007. #region Header Control HitTest Flags
  1008. public enum HeaderControlHitTestFlags : uint
  1009. {
  1010. HHT_NOWHERE             = 0x0001,
  1011. HHT_ONHEADER            = 0x0002,
  1012. HHT_ONDIVIDER           = 0x0004,
  1013. HHT_ONDIVOPEN           = 0x0008,
  1014. HHT_ABOVE               = 0x0100,
  1015. HHT_BELOW               = 0x0200,
  1016. HHT_TORIGHT             = 0x0400,
  1017. HHT_TOLEFT              = 0x0800
  1018. }
  1019. #endregion
  1020. #region List View sub item portion
  1021. public enum SubItemPortion
  1022. {
  1023. LVIR_BOUNDS = 0,
  1024. LVIR_ICON   = 1,
  1025. LVIR_LABEL  = 2
  1026. }
  1027. #endregion
  1028. #region Cursor Type
  1029. public enum CursorType : uint
  1030. {
  1031. IDC_ARROW       = 32512U,
  1032. IDC_IBEAM       = 32513U,
  1033. IDC_WAIT        = 32514U,
  1034. IDC_CROSS       = 32515U,
  1035. IDC_UPARROW     = 32516U,
  1036. IDC_SIZE        = 32640U,
  1037. IDC_ICON        = 32641U,
  1038. IDC_SIZENWSE    = 32642U,
  1039. IDC_SIZENESW    = 32643U,
  1040. IDC_SIZEWE      = 32644U,
  1041. IDC_SIZENS      = 32645U,
  1042. IDC_SIZEALL     = 32646U,
  1043. IDC_NO          = 32648U,
  1044. IDC_HAND        = 32649U,
  1045. IDC_APPSTARTING = 32650U,
  1046. IDC_HELP        = 32651U
  1047. }
  1048. #endregion
  1049. #region Tracker Event Flags
  1050. public enum TrackerEventFlags : uint
  1051. {
  1052. TME_HOVER   = 0x00000001,
  1053. TME_LEAVE   = 0x00000002,
  1054. TME_QUERY   = 0x40000000,
  1055. TME_CANCEL  = 0x80000000
  1056. }
  1057. #endregion
  1058. #region Mouse Activate Flags
  1059. public enum MouseActivateFlags
  1060. {
  1061. MA_ACTIVATE         = 1,
  1062. MA_ACTIVATEANDEAT   = 2,
  1063. MA_NOACTIVATE       = 3,
  1064. MA_NOACTIVATEANDEAT = 4
  1065. }
  1066. #endregion
  1067. #region Dialog Codes
  1068. public enum DialogCodes
  1069. {
  1070. DLGC_WANTARROWS         = 0x0001,
  1071. DLGC_WANTTAB            = 0x0002,
  1072. DLGC_WANTALLKEYS        = 0x0004,
  1073. DLGC_WANTMESSAGE        = 0x0004,
  1074. DLGC_HASSETSEL          = 0x0008,
  1075. DLGC_DEFPUSHBUTTON      = 0x0010,
  1076. DLGC_UNDEFPUSHBUTTON    = 0x0020,
  1077. DLGC_RADIOBUTTON        = 0x0040,
  1078. DLGC_WANTCHARS          = 0x0080,
  1079. DLGC_STATIC             = 0x0100,
  1080. DLGC_BUTTON             = 0x2000
  1081. }
  1082. #endregion
  1083. #region Update Layered Windows Flags
  1084. public enum UpdateLayeredWindowsFlags
  1085. {
  1086. ULW_COLORKEY = 0x00000001,
  1087. ULW_ALPHA    = 0x00000002,
  1088. ULW_OPAQUE   = 0x00000004
  1089. }
  1090. #endregion
  1091. #region Alpha Flags
  1092. public enum AlphaFlags : byte
  1093. {
  1094. AC_SRC_OVER  = 0x00,
  1095. AC_SRC_ALPHA = 0x01
  1096. }
  1097. #endregion
  1098. #region ComboBox messages
  1099. public enum ComboBoxMessages
  1100. {
  1101. CB_GETDROPPEDSTATE = 0x0157
  1102. }
  1103. #endregion
  1104. #region SetWindowLong indexes
  1105. public enum SetWindowLongOffsets
  1106. {
  1107. GWL_WNDPROC     = (-4),
  1108. GWL_HINSTANCE   = (-6),
  1109. GWL_HWNDPARENT  = (-8),
  1110. GWL_STYLE       = (-16),
  1111. GWL_EXSTYLE     = (-20),
  1112. GWL_USERDATA    = (-21),
  1113. GWL_ID          = (-12)
  1114. }
  1115. #endregion
  1116. #region TreeView Messages
  1117. public enum TreeViewMessages
  1118. {
  1119. TV_FIRST        =  0x1100,
  1120. TVM_GETITEMRECT = (TV_FIRST + 4),
  1121. TVM_GETITEMW    = (TV_FIRST + 62)
  1122. }
  1123. #endregion
  1124. #region TreeViewItem Flags
  1125. public enum TreeViewItemFlags
  1126. {
  1127. TVIF_TEXT               = 0x0001,
  1128. TVIF_IMAGE              = 0x0002,
  1129. TVIF_PARAM              = 0x0004,
  1130. TVIF_STATE              = 0x0008,
  1131. TVIF_HANDLE             = 0x0010,
  1132. TVIF_SELECTEDIMAGE      = 0x0020,
  1133. TVIF_CHILDREN           = 0x0040,
  1134. TVIF_INTEGRAL           = 0x0080
  1135. }
  1136. #endregion
  1137. #region ListViewItem flags
  1138. public enum ListViewItemFlags
  1139. {
  1140. LVIF_TEXT               = 0x0001,
  1141. LVIF_IMAGE              = 0x0002,
  1142. LVIF_PARAM              = 0x0004,
  1143. LVIF_STATE              = 0x0008,
  1144. LVIF_INDENT             = 0x0010,
  1145. LVIF_NORECOMPUTE        = 0x0800
  1146. }
  1147. #endregion
  1148. #region HeaderItem flags
  1149. public enum HeaderItemFlags
  1150. {
  1151. HDI_WIDTH               = 0x0001,
  1152. HDI_HEIGHT              = HDI_WIDTH,
  1153. HDI_TEXT                = 0x0002,
  1154. HDI_FORMAT              = 0x0004,
  1155. HDI_LPARAM              = 0x0008,
  1156. HDI_BITMAP              = 0x0010,
  1157. HDI_IMAGE               = 0x0020,
  1158. HDI_DI_SETITEM          = 0x0040,
  1159. HDI_ORDER               = 0x0080
  1160. }
  1161. #endregion
  1162. #region GetDCExFlags
  1163. public enum GetDCExFlags
  1164. {
  1165. DCX_WINDOW           = 0x00000001,
  1166. DCX_CACHE            = 0x00000002,
  1167. DCX_NORESETATTRS     = 0x00000004,
  1168. DCX_CLIPCHILDREN     = 0x00000008,
  1169. DCX_CLIPSIBLINGS     = 0x00000010,
  1170. DCX_PARENTCLIP       = 0x00000020,
  1171. DCX_EXCLUDERGN       = 0x00000040,
  1172. DCX_INTERSECTRGN     = 0x00000080,
  1173. DCX_EXCLUDEUPDATE    = 0x00000100,
  1174. DCX_INTERSECTUPDATE  = 0x00000200,
  1175. DCX_LOCKWINDOWUPDATE = 0x00000400,
  1176. DCX_VALIDATE         = 0x00200000
  1177. }
  1178. #endregion
  1179. #region HitTest
  1180. public enum HitTest
  1181. {
  1182. HTERROR             = (-2),
  1183. HTTRANSPARENT       = (-1),
  1184. HTNOWHERE           =   0,
  1185. HTCLIENT            =   1,
  1186. HTCAPTION           =   2,
  1187. HTSYSMENU           =   3,
  1188. HTGROWBOX           =   4,
  1189. HTSIZE              =   HTGROWBOX,
  1190. HTMENU              =   5,
  1191. HTHSCROLL           =   6,
  1192. HTVSCROLL           =   7,
  1193. HTMINBUTTON         =   8,
  1194. HTMAXBUTTON         =   9,
  1195. HTLEFT              =   10,
  1196. HTRIGHT             =   11,
  1197. HTTOP               =   12,
  1198. HTTOPLEFT           =   13,
  1199. HTTOPRIGHT          =   14,
  1200. HTBOTTOM            =   15,
  1201. HTBOTTOMLEFT        =   16,
  1202. HTBOTTOMRIGHT       =   17,
  1203. HTBORDER            =   18,
  1204. HTREDUCE            =   HTMINBUTTON,
  1205. HTZOOM              =   HTMAXBUTTON,
  1206. HTSIZEFIRST         =   HTLEFT,
  1207. HTSIZELAST          =   HTBOTTOMRIGHT,
  1208. HTOBJECT            =   19,
  1209. HTCLOSE             =   20,
  1210. HTHELP              =   21
  1211. }
  1212. #endregion
  1213. #region ActivateFlags
  1214. public enum ActivateState
  1215. {
  1216. WA_INACTIVE     = 0,
  1217. WA_ACTIVE       = 1,
  1218. WA_CLICKACTIVE  = 2
  1219. }
  1220. #endregion
  1221. #region StrechModeFlags
  1222. public enum StrechModeFlags
  1223. {
  1224. BLACKONWHITE        = 1,
  1225. WHITEONBLACK        = 2,
  1226. COLORONCOLOR        = 3,
  1227. HALFTONE            = 4,
  1228. MAXSTRETCHBLTMODE   = 4
  1229. }
  1230. #endregion
  1231. #region ScrollBarFlags
  1232. public enum ScrollBarFlags
  1233. {
  1234. SBS_HORZ                    = 0x0000,
  1235. SBS_VERT                    = 0x0001,
  1236. SBS_TOPALIGN                = 0x0002,
  1237. SBS_LEFTALIGN               = 0x0002,
  1238. SBS_BOTTOMALIGN             = 0x0004,
  1239. SBS_RIGHTALIGN              = 0x0004,
  1240. SBS_SIZEBOXTOPLEFTALIGN     = 0x0002,
  1241. SBS_SIZEBOXBOTTOMRIGHTALIGN = 0x0004,
  1242. SBS_SIZEBOX                 = 0x0008,
  1243. SBS_SIZEGRIP                = 0x0010
  1244. }
  1245. #endregion
  1246. #region System Metrics Codes
  1247. public enum SystemMetricsCodes
  1248. {
  1249. SM_CXSCREEN             = 0,
  1250. SM_CYSCREEN             = 1,
  1251. SM_CXVSCROLL            = 2,
  1252. SM_CYHSCROLL            = 3,
  1253. SM_CYCAPTION            = 4,
  1254. SM_CXBORDER             = 5,
  1255. SM_CYBORDER             = 6,
  1256. SM_CXDLGFRAME           = 7,
  1257. SM_CYDLGFRAME           = 8,
  1258. SM_CYVTHUMB             = 9,
  1259. SM_CXHTHUMB             = 10,
  1260. SM_CXICON               = 11,
  1261. SM_CYICON               = 12,
  1262. SM_CXCURSOR             = 13,
  1263. SM_CYCURSOR             = 14,
  1264. SM_CYMENU               = 15,
  1265. SM_CXFULLSCREEN         = 16,
  1266. SM_CYFULLSCREEN         = 17,
  1267. SM_CYKANJIWINDOW        = 18,
  1268. SM_MOUSEPRESENT         = 19,
  1269. SM_CYVSCROLL            = 20,
  1270. SM_CXHSCROLL            = 21,
  1271. SM_DEBUG                = 22,
  1272. SM_SWAPBUTTON           = 23,
  1273. SM_RESERVED1            = 24,
  1274. SM_RESERVED2            = 25,
  1275. SM_RESERVED3            = 26,
  1276. SM_RESERVED4            = 27,
  1277. SM_CXMIN                = 28,
  1278. SM_CYMIN                = 29,
  1279. SM_CXSIZE               = 30,
  1280. SM_CYSIZE               = 31,
  1281. SM_CXFRAME              = 32,
  1282. SM_CYFRAME              = 33,
  1283. SM_CXMINTRACK           = 34,
  1284. SM_CYMINTRACK           = 35,
  1285. SM_CXDOUBLECLK          = 36,
  1286. SM_CYDOUBLECLK          = 37,
  1287. SM_CXICONSPACING        = 38,
  1288. SM_CYICONSPACING        = 39,
  1289. SM_MENUDROPALIGNMENT    = 40,
  1290. SM_PENWINDOWS           = 41,
  1291. SM_DBCSENABLED          = 42,
  1292. SM_CMOUSEBUTTONS        = 43,
  1293. SM_CXFIXEDFRAME         = SM_CXDLGFRAME,
  1294. SM_CYFIXEDFRAME         = SM_CYDLGFRAME,
  1295. SM_CXSIZEFRAME          = SM_CXFRAME,
  1296. SM_CYSIZEFRAME          = SM_CYFRAME,
  1297. SM_SECURE               = 44,
  1298. SM_CXEDGE               = 45,
  1299. SM_CYEDGE               = 46,
  1300. SM_CXMINSPACING         = 47,
  1301. SM_CYMINSPACING         = 48,
  1302. SM_CXSMICON             = 49,
  1303. SM_CYSMICON             = 50,
  1304. SM_CYSMCAPTION          = 51,
  1305. SM_CXSMSIZE             = 52,
  1306. SM_CYSMSIZE             = 53,
  1307. SM_CXMENUSIZE           = 54,
  1308. SM_CYMENUSIZE           = 55,
  1309. SM_ARRANGE              = 56,
  1310. SM_CXMINIMIZED          = 57,
  1311. SM_CYMINIMIZED          = 58,
  1312. SM_CXMAXTRACK           = 59,
  1313. SM_CYMAXTRACK           = 60,
  1314. SM_CXMAXIMIZED          = 61,
  1315. SM_CYMAXIMIZED          = 62,
  1316. SM_NETWORK              = 63,
  1317. SM_CLEANBOOT            = 67,
  1318. SM_CXDRAG               = 68,
  1319. SM_CYDRAG               = 69,
  1320. SM_SHOWSOUNDS           = 70,
  1321. SM_CXMENUCHECK          = 71,
  1322. SM_CYMENUCHECK          = 72,
  1323. SM_SLOWMACHINE          = 73,
  1324. SM_MIDEASTENABLED       = 74,
  1325. SM_MOUSEWHEELPRESENT    = 75,
  1326. SM_XVIRTUALSCREEN       = 76,
  1327. SM_YVIRTUALSCREEN       = 77,
  1328. SM_CXVIRTUALSCREEN      = 78,
  1329. SM_CYVIRTUALSCREEN      = 79,
  1330. SM_CMONITORS            = 80,
  1331. SM_SAMEDISPLAYFORMAT    = 81,
  1332. SM_CMETRICS             = 83
  1333. }
  1334. #endregion
  1335. #region ScrollBarTypes
  1336. public enum ScrollBarTypes
  1337. {
  1338. SB_HORZ  = 0,
  1339. SB_VERT  = 1,
  1340. SB_CTL   = 2,
  1341. SB_BOTH  = 3
  1342. }
  1343. #endregion
  1344. #region SrollBarInfoFlags
  1345. public enum ScrollBarInfoFlags
  1346. {
  1347. SIF_RANGE           = 0x0001,
  1348. SIF_PAGE            = 0x0002,
  1349. SIF_POS             = 0x0004,
  1350. SIF_DISABLENOSCROLL = 0x0008,
  1351. SIF_TRACKPOS        = 0x0010,
  1352. SIF_ALL             = (SIF_RANGE | SIF_PAGE | SIF_POS | SIF_TRACKPOS)
  1353. }
  1354. #endregion
  1355. #region Enable ScrollBar flags
  1356. public enum EnableScrollBarFlags
  1357. {
  1358. ESB_ENABLE_BOTH     = 0x0000,
  1359. ESB_DISABLE_BOTH    = 0x0003,
  1360. ESB_DISABLE_LEFT    = 0x0001,
  1361. ESB_DISABLE_RIGHT   = 0x0002,
  1362. ESB_DISABLE_UP      = 0x0001,
  1363. ESB_DISABLE_DOWN    = 0x0002,
  1364. ESB_DISABLE_LTUP    = ESB_DISABLE_LEFT,
  1365. ESB_DISABLE_RTDN    = ESB_DISABLE_RIGHT
  1366. }
  1367. #endregion
  1368. #region Scroll Requests
  1369. public enum ScrollBarRequests
  1370. {
  1371. SB_LINEUP           = 0,
  1372. SB_LINELEFT         = 0,
  1373. SB_LINEDOWN         = 1,
  1374. SB_LINERIGHT        = 1,
  1375. SB_PAGEUP           = 2,
  1376. SB_PAGELEFT         = 2,
  1377. SB_PAGEDOWN         = 3,
  1378. SB_PAGERIGHT        = 3,
  1379. SB_THUMBPOSITION    = 4,
  1380. SB_THUMBTRACK       = 5,
  1381. SB_TOP              = 6,
  1382. SB_LEFT             = 6,
  1383. SB_BOTTOM           = 7,
  1384. SB_RIGHT            = 7,
  1385. SB_ENDSCROLL        = 8
  1386. }
  1387. #endregion
  1388. #region SrollWindowEx flags
  1389. public enum ScrollWindowExFlags
  1390. {
  1391. SW_SCROLLCHILDREN   = 0x0001,
  1392. SW_INVALIDATE       = 0x0002,
  1393. SW_ERASE            = 0x0004,
  1394. SW_SMOOTHSCROLL     = 0x0010
  1395. }
  1396. #endregion
  1397. #region ImageListFlags
  1398. public enum  ImageListFlags
  1399. {
  1400. ILC_MASK             = 0x0001,
  1401. ILC_COLOR            = 0x0000,
  1402. ILC_COLORDDB         = 0x00FE,
  1403. ILC_COLOR4           = 0x0004,
  1404. ILC_COLOR8           = 0x0008,
  1405. ILC_COLOR16          = 0x0010,
  1406. ILC_COLOR24          = 0x0018,
  1407. ILC_COLOR32          = 0x0020,
  1408. ILC_PALETTE          = 0x0800
  1409. }
  1410. #endregion
  1411. #region List View Notifications
  1412. public enum ListViewNotifications
  1413. {
  1414. LVN_FIRST             =  (0-100),
  1415. LVN_GETDISPINFOW      = (LVN_FIRST-77),
  1416. LVN_SETDISPINFOA      = (LVN_FIRST-51)
  1417. }
  1418. #endregion
  1419. }

Structs.cs分别如下

  1. using System;
  2. using System.Drawing;
  3. using System.Runtime.InteropServices;
  4. namespace Lordeo.Framework
  5. {
  6. /// <summary>
  7. /// Structures to interoperate with the Windows 32 API
  8. /// </summary>
  9. #region SIZE
  10. [StructLayout(LayoutKind.Sequential)]
  11. public struct SIZE
  12. {
  13. public int cx;
  14. public int cy;
  15. }
  16. #endregion
  17. #region RECT
  18. [StructLayout(LayoutKind.Sequential)]
  19. public struct RECT
  20. {
  21. public int left;
  22. public int top;
  23. public int right;
  24. public int bottom;
  25. }
  26. #endregion
  27. #region INITCOMMONCONTROLSEX
  28. [StructLayout(LayoutKind.Sequential, Pack=1)]
  29. public class INITCOMMONCONTROLSEX
  30. {
  31. public int dwSize;
  32. public int dwICC;
  33. }
  34. #endregion
  35. #region TBBUTTON
  36. [StructLayout(LayoutKind.Sequential, Pack=1)]
  37. public struct TBBUTTON
  38. {
  39. public int iBitmap;
  40. public int idCommand;
  41. public byte fsState;
  42. public byte fsStyle;
  43. public byte bReserved0;
  44. public byte bReserved1;
  45. public int dwData;
  46. public int iString;
  47. }
  48. #endregion
  49. #region POINT
  50. [StructLayout(LayoutKind.Sequential)]
  51. public struct POINT
  52. {
  53. public int x;
  54. public int y;
  55. }
  56. #endregion
  57. #region NMHDR
  58. [StructLayout(LayoutKind.Sequential)]
  59. public struct NMHDR
  60. {
  61. public IntPtr hwndFrom;
  62. public int idFrom;
  63. public int code;
  64. }
  65. #endregion
  66. #region TOOLTIPTEXTA
  67. [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Ansi)]
  68. public struct TOOLTIPTEXTA
  69. {
  70. public NMHDR hdr;
  71. public IntPtr lpszText;
  72. [MarshalAs(UnmanagedType.ByValTStr, SizeConst=80)]
  73. public string szText;
  74. public IntPtr hinst;
  75. public int uFlags;
  76. }
  77. #endregion
  78. #region TOOLTIPTEXT
  79. [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Auto)]
  80. public struct TOOLTIPTEXT
  81. {
  82. public NMHDR hdr;
  83. public IntPtr lpszText;
  84. [MarshalAs(UnmanagedType.ByValTStr, SizeConst=80)]
  85. public string szText;
  86. public IntPtr hinst;
  87. public int uFlags;
  88. }
  89. #endregion
  90. #region NMCUSTOMDRAW
  91. [StructLayout(LayoutKind.Sequential)]
  92. public struct NMCUSTOMDRAW
  93. {
  94. public NMHDR hdr;
  95. public int dwDrawStage;
  96. public IntPtr hdc;
  97. public RECT rc;
  98. public int dwItemSpec;
  99. public int uItemState;
  100. public int lItemlParam;
  101. }
  102. #endregion
  103. #region NMTBCUSTOMDRAW
  104. [StructLayout(LayoutKind.Sequential)]
  105. public struct NMTBCUSTOMDRAW
  106. {
  107. public NMCUSTOMDRAW nmcd;
  108. public IntPtr hbrMonoDither;
  109. public IntPtr hbrLines;
  110. public IntPtr hpenLines;
  111. public int clrText;
  112. public int clrMark;
  113. public int clrTextHighlight;
  114. public int clrBtnFace;
  115. public int clrBtnHighlight;
  116. public int clrHighlightHotTrack;
  117. public RECT rcText;
  118. public int nStringBkMode;
  119. public int nHLStringBkMode;
  120. }
  121. #endregion
  122. #region NMLVCUSTOMDRAW
  123. [StructLayout(LayoutKind.Sequential)]
  124. public struct NMLVCUSTOMDRAW
  125. {
  126. public NMCUSTOMDRAW nmcd;
  127. public uint clrText;
  128. public uint clrTextBk;
  129. public int iSubItem;
  130. }
  131. #endregion
  132. #region TBBUTTONINFO
  133. [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Auto)]
  134. public struct TBBUTTONINFO
  135. {
  136. public int cbSize;
  137. public int dwMask;
  138. public int idCommand;
  139. public int iImage;
  140. public byte fsState;
  141. public byte fsStyle;
  142. public short cx;
  143. public IntPtr lParam;
  144. public IntPtr pszText;
  145. public int cchText;
  146. }
  147. #endregion
  148. #region REBARBANDINFO
  149. [StructLayout(LayoutKind.Sequential)]
  150. public struct REBARBANDINFO
  151. {
  152. public int cbSize;
  153. public int fMask;
  154. public int fStyle;
  155. public int clrFore;
  156. public int clrBack;
  157. public IntPtr lpText;
  158. public int cch;
  159. public int iImage;
  160. public IntPtr hwndChild;
  161. public int cxMinChild;
  162. public int cyMinChild;
  163. public int cx;
  164. public IntPtr hbmBack;
  165. public int wID;
  166. public int cyChild;
  167. public int cyMaxChild;
  168. public int cyIntegral;
  169. public int cxIdeal;
  170. public int lParam;
  171. public int cxHeader;
  172. }
  173. #endregion
  174. #region MOUSEHOOKSTRUCT
  175. [StructLayout(LayoutKind.Sequential)]
  176. public struct MOUSEHOOKSTRUCT
  177. {
  178. public POINT     pt;
  179. public IntPtr    hwnd;
  180. public int       wHitTestCode;
  181. public IntPtr    dwExtraInfo;
  182. }
  183. #endregion
  184. #region NMTOOLBAR
  185. [StructLayout(LayoutKind.Sequential)]
  186. public struct NMTOOLBAR
  187. {
  188. public NMHDR        hdr;
  189. public int          iItem;
  190. public TBBUTTON     tbButton;
  191. public int          cchText;
  192. public IntPtr       pszText;
  193. public RECT         rcButton;
  194. }
  195. #endregion
  196. #region NMREBARCHEVRON
  197. [StructLayout(LayoutKind.Sequential)]
  198. public struct NMREBARCHEVRON
  199. {
  200. public NMHDR hdr;
  201. public int uBand;
  202. public int wID;
  203. public int lParam;
  204. public RECT rc;
  205. public int lParamNM;
  206. }
  207. #endregion
  208. #region BITMAP
  209. [StructLayout(LayoutKind.Sequential)]
  210. public struct BITMAP
  211. {
  212. public long   bmType;
  213. public long   bmWidth;
  214. public long   bmHeight;
  215. public long   bmWidthBytes;
  216. public short  bmPlanes;
  217. public short  bmBitsPixel;
  218. public IntPtr bmBits;
  219. }
  220. #endregion
  221. #region BITMAPINFO_FLAT
  222. [StructLayout(LayoutKind.Sequential)]
  223. public struct BITMAPINFO_FLAT
  224. {
  225. public int      bmiHeader_biSize;
  226. public int      bmiHeader_biWidth;
  227. public int      bmiHeader_biHeight;
  228. public short    bmiHeader_biPlanes;
  229. public short    bmiHeader_biBitCount;
  230. public int      bmiHeader_biCompression;
  231. public int      bmiHeader_biSizeImage;
  232. public int      bmiHeader_biXPelsPerMeter;
  233. public int      bmiHeader_biYPelsPerMeter;
  234. public int      bmiHeader_biClrUsed;
  235. public int      bmiHeader_biClrImportant;
  236. [MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst=1024)]
  237. public byte[] bmiColors;
  238. }
  239. #endregion
  240. #region RGBQUAD
  241. public struct RGBQUAD
  242. {
  243. public byte     rgbBlue;
  244. public byte     rgbGreen;
  245. public byte     rgbRed;
  246. public byte     rgbReserved;
  247. }
  248. #endregion
  249. #region BITMAPINFOHEADER
  250. [StructLayout(LayoutKind.Sequential)]
  251. public class BITMAPINFOHEADER
  252. {
  253. public int      biSize = Marshal.SizeOf(typeof(BITMAPINFOHEADER));
  254. public int      biWidth;
  255. public int      biHeight;
  256. public short    biPlanes;
  257. public short    biBitCount;
  258. public int      biCompression;
  259. public int      biSizeImage;
  260. public int      biXPelsPerMeter;
  261. public int      biYPelsPerMeter;
  262. public int      biClrUsed;
  263. public int      biClrImportant;
  264. }
  265. #endregion
  266. #region BITMAPINFO
  267. [StructLayout(LayoutKind.Sequential)]
  268. public class BITMAPINFO
  269. {
  270. public BITMAPINFOHEADER bmiHeader = new BITMAPINFOHEADER();
  271. [MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValArray, SizeConst=1024)]
  272. public byte[] bmiColors;
  273. }
  274. #endregion
  275. #region PALETTEENTRY
  276. [StructLayout(LayoutKind.Sequential)]
  277. public struct PALETTEENTRY
  278. {
  279. public byte     peRed;
  280. public byte     peGreen;
  281. public byte     peBlue;
  282. public byte     peFlags;
  283. }
  284. #endregion
  285. #region MSG
  286. [StructLayout(LayoutKind.Sequential)]
  287. public struct MSG
  288. {
  289. public IntPtr hwnd;
  290. public int message;
  291. public IntPtr wParam;
  292. public IntPtr lParam;
  293. public int time;
  294. public int pt_x;
  295. public int pt_y;
  296. }
  297. #endregion
  298. #region HD_HITTESTINFO
  299. [StructLayout(LayoutKind.Sequential)]
  300. public struct HD_HITTESTINFO
  301. {
  302. public POINT pt;
  303. public uint flags;
  304. public int iItem;
  305. }
  306. #endregion
  307. #region DLLVERSIONINFO
  308. [StructLayout(LayoutKind.Sequential)]
  309. public struct DLLVERSIONINFO
  310. {
  311. public int cbSize;
  312. public int dwMajorVersion;
  313. public int dwMinorVersion;
  314. public int dwBuildNumber;
  315. public int dwPlatformID;
  316. }
  317. #endregion
  318. #region PAINTSTRUCT
  319. [StructLayout(LayoutKind.Sequential)]
  320. public struct PAINTSTRUCT
  321. {
  322. public IntPtr hdc;
  323. public int fErase;
  324. public Rectangle rcPaint;
  325. public int fRestore;
  326. public int fIncUpdate;
  327. public int Reserved1;
  328. public int Reserved2;
  329. public int Reserved3;
  330. public int Reserved4;
  331. public int Reserved5;
  332. public int Reserved6;
  333. public int Reserved7;
  334. public int Reserved8;
  335. }
  336. #endregion
  337. #region BLENDFUNCTION
  338. [StructLayout(LayoutKind.Sequential, Pack=1)]
  339. public struct BLENDFUNCTION
  340. {
  341. public byte BlendOp;
  342. public byte BlendFlags;
  343. public byte SourceConstantAlpha;
  344. public byte AlphaFormat;
  345. }
  346. #endregion
  347. #region TRACKMOUSEEVENTS
  348. [StructLayout(LayoutKind.Sequential)]
  349. public struct TRACKMOUSEEVENTS
  350. {
  351. public uint cbSize;
  352. public uint dwFlags;
  353. public IntPtr hWnd;
  354. public uint dwHoverTime;
  355. }
  356. #endregion
  357. #region STRINGBUFFER
  358. [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Auto)]
  359. public struct STRINGBUFFER
  360. {
  361. [MarshalAs(UnmanagedType.ByValTStr, SizeConst=512)]
  362. public string szText;
  363. }
  364. #endregion
  365. #region NMTVCUSTOMDRAW
  366. [StructLayout(LayoutKind.Sequential)]
  367. public struct NMTVCUSTOMDRAW
  368. {
  369. public NMCUSTOMDRAW nmcd;
  370. public uint clrText;
  371. public uint clrTextBk;
  372. public int iLevel;
  373. }
  374. #endregion
  375. #region TVITEM
  376. [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Auto)]
  377. public struct TVITEM
  378. {
  379. public  uint      mask;
  380. public  IntPtr    hItem;
  381. public  uint      state;
  382. public  uint      stateMask;
  383. public  IntPtr    pszText;
  384. public  int       cchTextMax;
  385. public  int       iImage;
  386. public  int       iSelectedImage;
  387. public  int       cChildren;
  388. public  int       lParam;
  389. }
  390. #endregion
  391. #region LVITEM
  392. [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Auto)]
  393. public struct LVITEM
  394. {
  395. public  uint mask;
  396. public  int iItem;
  397. public  int iSubItem;
  398. public  uint state;
  399. public  uint stateMask;
  400. public  IntPtr pszText;
  401. public  int cchTextMax;
  402. public  int iImage;
  403. public  int lParam;
  404. public  int iIndent;
  405. }
  406. #endregion
  407. #region HDITEM
  408. [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Auto)]
  409. public struct HDITEM
  410. {
  411. public  uint    mask;
  412. public  int     cxy;
  413. public  IntPtr  pszText;
  414. public  IntPtr  hbm;
  415. public  int     cchTextMax;
  416. public  int     fmt;
  417. public  int     lParam;
  418. public  int     iImage;
  419. public  int     iOrder;
  420. }
  421. #endregion
  422. #region WINDOWPLACEMENT
  423. [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Auto)]
  424. public struct WINDOWPLACEMENT
  425. {
  426. public uint length;
  427. public uint flags;
  428. public uint showCmd;
  429. public POINT ptMinPosition;
  430. public POINT ptMaxPosition;
  431. public RECT  rcNormalPosition;
  432. }
  433. #endregion
  434. #region SCROLLINFO
  435. [StructLayout(LayoutKind.Sequential, CharSet=CharSet.Auto)]
  436. public struct SCROLLINFO
  437. {
  438. public  uint   cbSize;
  439. public  uint   fMask;
  440. public  int    nMin;
  441. public  int    nMax;
  442. public  uint   nPage;
  443. public  int    nPos;
  444. public  int    nTrackPos;
  445. }
  446. #endregion
  447. #region MouseHookStruct
  448. [StructLayout(LayoutKind.Sequential)]
  449. public class MouseHookStruct
  450. {
  451. public POINT pt;
  452. public int hwnd;
  453. public int wHitTestCode;
  454. public int dwExtraInfo;
  455. }
  456. #endregion
  457. #region KeyBoardHook
  458. [StructLayout(LayoutKind.Sequential)]
  459. public class KeyboardHookStruct
  460. {
  461. public int vkCode;  //Specifies a virtual-key code. The code must be a value in the range 1 to 254.
  462. public int scanCode; // Specifies a hardware scan code for the key.
  463. public int flags;  // Specifies the extended-key flag, event-injected flag, context code, and transition-state flag.
  464. public int time; // Specifies the time stamp for this message.
  465. public int dwExtraInfo; // Specifies extra information associated with the message.
  466. }
  467. #endregion
  468. }

http://blog.csdn.net/jiangxinyu/article/details/8099006