PageRenderTime 74ms CodeModel.GetById 28ms RepoModel.GetById 0ms app.codeStats 1ms

/QuickMon4/QuickMonUICoreForWinForms/Controls/API/APIsUser32.cs

#
C# | 182 lines | 181 code | 1 blank | 0 comment | 0 complexity | c19798bb0dbd035070f6a06cf01088df MD5 | raw file
  1. using System;
  2. using System.Runtime.InteropServices;
  3. namespace HenIT.Runtime.InteropServices.APIs
  4. {
  5. public class APIsUser32
  6. {
  7. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  8. static public extern uint SendInput(uint nInputs, APIsStructs.INPUT[] inputs, int cbSize);
  9. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  10. static public extern bool ScreenToClient(IntPtr hWnd, ref APIsStructs.POINTAPI point);
  11. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  12. static public extern int DrawFrameControl(IntPtr hDc, APIsStructs.RECT rect, APIsEnums.DrawFrameControlFlags nType, APIsEnums.DrawFrameControlStateFlags nState);
  13. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  14. static public extern int GetSysColor(APIsEnums.SystemColors nIndex);
  15. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  16. static public extern bool DestroyIcon(IntPtr hIcon);
  17. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  18. static public extern bool GetComboBoxInfo(IntPtr hWnd, ref APIsStructs.PCOMBOBOXINFO cbi);
  19. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  20. static public extern bool DestroyWindow(IntPtr hWnd);
  21. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  22. static public extern IntPtr GetDC(IntPtr hWnd);
  23. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  24. static public extern int ReleaseDC(IntPtr hWnd, IntPtr hDC);
  25. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  26. static public extern IntPtr GetDesktopWindow();
  27. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  28. static public extern bool ShowWindow(IntPtr hWnd, APIsEnums.ShowWindowStyles State);
  29. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  30. static public extern bool UpdateWindow(IntPtr hWnd);
  31. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  32. static public extern bool SetForegroundWindow(IntPtr hWnd);
  33. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  34. static public extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int x, int y, int Width, int Height, uint flags);
  35. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  36. static public extern bool OpenClipboard(IntPtr hWndNewOwner);
  37. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  38. static public extern bool CloseClipboard();
  39. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  40. static public extern bool EmptyClipboard();
  41. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  42. static public extern IntPtr SetClipboardData( uint Format, IntPtr hData);
  43. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  44. static public extern bool GetMenuItemRect(IntPtr hWnd, IntPtr hMenu, uint Item, ref APIsStructs.RECT rc);
  45. [DllImport("user32.dll", ExactSpelling=true, CharSet=CharSet.Auto)]
  46. public static extern IntPtr GetParent(IntPtr hWnd);
  47. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  48. public static extern int SendMessage(IntPtr hWnd, APIsEnums.HeaderControlMessages msg, int wParam, ref APIsStructs.HDITEM lParam);
  49. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  50. public static extern int SendMessage(IntPtr hWnd, int msg, int wParam, int lParam);
  51. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  52. public static extern int SendMessage(IntPtr hWnd, APIsEnums.HeaderControlMessages msg, IntPtr wParam, ref APIsStructs.HD_HITTESTINFO hd_hittestinfo);
  53. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  54. public static extern int SendMessage(IntPtr hWnd, APIsEnums.WindowMessages msg, int wParam, int lParam);
  55. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  56. public static extern IntPtr SendMessage(IntPtr hWnd, int msg, int wParam, IntPtr lParam);
  57. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  58. public static extern void SendMessage(IntPtr hWnd, int msg, IntPtr wParam, ref APIsStructs.NMHDR lParam);
  59. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  60. public static extern void SendMessage(IntPtr hWnd, int msg, IntPtr wParam, ref APIsStructs.NMLVDISPINFO lParam);
  61. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  62. public static extern void SendMessage(IntPtr hWnd, int msg, int wParam, ref APIsStructs.RECT lParam);
  63. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  64. public static extern int SendMessage(IntPtr hWnd, int msg, int wParam, ref APIsStructs.POINTAPI lParam);
  65. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  66. public static extern IntPtr PostMessage(IntPtr hWnd, int msg, int wParam, int lParam);
  67. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  68. public static extern IntPtr PostMessage(IntPtr hWnd, APIsEnums.WindowMessages msg, int wParam, int lParam);
  69. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  70. public static extern IntPtr SetFocus(IntPtr hWnd);
  71. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  72. public extern static int DrawText(IntPtr hdc, string lpString, int nCount, ref APIsStructs.RECT lpRect, APIsEnums.DrawTextFormatFlags flags);
  73. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  74. public extern static IntPtr SetParent(IntPtr hChild, IntPtr hParent);
  75. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  76. public extern static IntPtr GetDlgItem(IntPtr hDlg, int nControlID);
  77. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  78. public extern static int GetClientRect(IntPtr hWnd, ref APIsStructs.RECT rc);
  79. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  80. public extern static int InvalidateRect(IntPtr hWnd, ref APIsStructs.RECT rc, int bErase);
  81. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  82. public extern static int InvalidateRect(IntPtr hWnd, IntPtr rc, int bErase);
  83. [DllImport("User32.dll", CharSet=CharSet.Auto)]
  84. public static extern bool WaitMessage();
  85. [DllImport("User32.dll", CharSet=CharSet.Auto)]
  86. public static extern bool PeekMessage(ref APIsStructs.MSG msg, int hWnd, uint wFilterMin, uint wFilterMax, APIsEnums.PeekMessageFlags flags);
  87. [DllImport("User32.dll", CharSet=CharSet.Auto)]
  88. public static extern bool GetMessage(ref APIsStructs.MSG msg, int hWnd, uint wFilterMin, uint wFilterMax);
  89. [DllImport("User32.dll", CharSet=CharSet.Auto)]
  90. public static extern bool TranslateMessage(ref APIsStructs.MSG msg);
  91. [DllImport("User32.dll", CharSet=CharSet.Auto)]
  92. public static extern bool DispatchMessage(ref APIsStructs.MSG msg);
  93. [DllImport("User32.dll", CharSet=CharSet.Auto)]
  94. public static extern IntPtr LoadCursor(IntPtr hInstance, APIsEnums.CursorTypes cursor);
  95. [DllImport("User32.dll", CharSet=CharSet.Auto)]
  96. public static extern IntPtr SetCursor(IntPtr hCursor);
  97. [DllImport("User32.dll", CharSet=CharSet.Auto)]
  98. public static extern IntPtr GetFocus();
  99. [DllImport("User32.dll", CharSet=CharSet.Auto)]
  100. public static extern bool ReleaseCapture();
  101. [DllImport("User32.dll", CharSet=CharSet.Auto)]
  102. public static extern IntPtr SetCapture(IntPtr hWnd);
  103. [DllImport("User32.dll", CharSet=CharSet.Auto)]
  104. public static extern IntPtr BeginPaint(IntPtr hWnd, ref APIsStructs.PAINTSTRUCT ps);
  105. [DllImport("User32.dll", CharSet=CharSet.Auto)]
  106. public static extern bool EndPaint(IntPtr hWnd, ref APIsStructs.PAINTSTRUCT ps);
  107. [DllImport("User32.dll", CharSet=CharSet.Auto)]
  108. public static extern bool UpdateLayeredWindow(IntPtr hwnd, IntPtr hdcDst, ref APIsStructs.POINTAPI pptDst, ref APIsStructs.SIZE psize,
  109. IntPtr hdcSrc, ref APIsStructs.POINTAPI pprSrc, Int32 crKey, ref APIsStructs.BLENDFUNCTION pblend, APIsEnums.UpdateLayeredWindowFlags dwFlags);
  110. [DllImport("User32.dll", CharSet=CharSet.Auto)]
  111. public static extern bool GetWindowRect(IntPtr hWnd, ref APIsStructs.RECT rect);
  112. [DllImport("User32.dll", CharSet=CharSet.Auto)]
  113. public static extern bool ClientToScreen(IntPtr hWnd, ref APIsStructs.POINTAPI pt);
  114. [DllImport("User32.dll", CharSet=CharSet.Auto)]
  115. public static extern bool TrackMouseEvent(ref APIsStructs.TRACKMOUSEEVENTS tme);
  116. [DllImport("User32.dll", CharSet=CharSet.Auto)]
  117. public static extern bool SetWindowRgn(IntPtr hWnd, IntPtr hRgn, bool redraw);
  118. [DllImport("User32.dll", CharSet=CharSet.Auto)]
  119. public static extern ushort GetKeyState(int virtKey);
  120. [DllImport("User32.dll", CharSet=CharSet.Auto)]
  121. public static extern bool MoveWindow(IntPtr hWnd, int x, int y, int width, int height, bool repaint);
  122. [DllImport("User32.dll", CharSet=CharSet.Auto)]
  123. public static extern int GetClassName(IntPtr hWnd, System.Text.StringBuilder ClassName, int nMaxCount);
  124. [DllImport("User32.dll", CharSet=CharSet.Auto)]
  125. public static extern IntPtr GetDCEx(IntPtr hWnd, IntPtr hRegion, uint flags);
  126. [DllImport("User32.dll", CharSet=CharSet.Auto)]
  127. public static extern IntPtr GetWindowDC(IntPtr hWnd);
  128. [DllImport("User32.dll", CharSet=CharSet.Auto)]
  129. public static extern int FillRect(IntPtr hDC, ref APIsStructs.RECT rect, IntPtr hBrush);
  130. [DllImport("User32.dll", CharSet=CharSet.Auto)]
  131. public static extern int GetWindowPlacement(IntPtr hWnd, ref APIsStructs.WINDOWPLACEMENT wp);
  132. [DllImport("User32.dll", CharSet=CharSet.Auto)]
  133. public static extern int SetWindowText(IntPtr hWnd, string text);
  134. [DllImport("User32.dll", CharSet=CharSet.Auto)]
  135. public static extern int GetWindowText(IntPtr hWnd, System.Text.StringBuilder text, int maxCount);
  136. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  137. static public extern int SendMessage(IntPtr hWnd, int Msg, IntPtr wParam, IntPtr lParam);
  138. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  139. static public extern IntPtr SetClipboardViewer(IntPtr hWndNewViewer);
  140. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  141. static public extern int ChangeClipboardChain(IntPtr hWndRemove, IntPtr hWndNewNext);
  142. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  143. static public extern int GetSystemMetrics(APIsEnums.SystemMetricsCodes code);
  144. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  145. static public extern int SetScrollInfo(IntPtr hwnd, int bar, ref APIsStructs.SCROLLINFO si, int fRedraw);
  146. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  147. static public extern int ShowScrollBar(IntPtr hWnd, int bar, int show);
  148. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  149. static public extern int EnableScrollBar(IntPtr hWnd, uint flags, uint arrows);
  150. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  151. static public extern int BringWindowToTop(IntPtr hWnd);
  152. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  153. static public extern int GetScrollInfo(IntPtr hwnd, int bar, ref APIsStructs.SCROLLINFO si);
  154. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  155. static public extern int ScrollWindowEx(IntPtr hWnd, int dx, int dy,
  156. ref APIsStructs.RECT rcScroll, ref APIsStructs.RECT rcClip, IntPtr UpdateRegion, ref APIsStructs.RECT rcInvalidated, uint flags);
  157. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  158. static public extern bool IsWindow(IntPtr hWnd);
  159. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  160. static public extern int LockWindowUpdate(IntPtr hWnd);
  161. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  162. static public extern bool ValidateRect(IntPtr hWnd, ref APIsStructs.RECT rcInvalidated);
  163. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  164. static public extern bool ValidateRect(IntPtr hWnd, IntPtr rc);
  165. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  166. static public extern int GetScrollBarInfo(IntPtr hWnd, APIsEnums.SystemObjects id, ref APIsStructs.SCROLLBARINFO sbi);
  167. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  168. static public extern int SetProp(IntPtr hWnd, IntPtr atom, IntPtr hData);
  169. [DllImport("user32.dll", CharSet=CharSet.Auto)]
  170. static public extern int CallWindowProc(IntPtr hOldProc, IntPtr hWnd, uint message, int wParam, int lParam);
  171. [DllImport("user32.dll")]
  172. public static extern bool SendMessage(IntPtr hWnd, APIsEnums.ListViewMessages msg,
  173. Int32 wParam, ref APIsStructs.LV_ITEM lParam);
  174. [DllImport("user32.dll")]
  175. public static extern int SendMessage(IntPtr hWnd, Int32 msg, Int32 wParam, ref
  176. APIsStructs.LVHITTESTINFO lParam);
  177. [DllImport("user32.dll")]
  178. public static extern bool SendMessage(IntPtr hWnd, int msg,
  179. IntPtr wParam, ref IntPtr lParam);
  180. }
  181. }