TOOLINFO.cs 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. using System;
  2. using System.Runtime.InteropServices;
  3. namespace Microsoft.Win32
  4. {
  5. /// <summary>
  6. /// TOOLINFO定义
  7. /// </summary>
  8. public static partial class NativeMethods
  9. {
  10. /// <summary>
  11. /// The TOOLINFO structure contains information about a tool in a tooltip control.
  12. /// </summary>
  13. [StructLayout(LayoutKind.Sequential)]
  14. public struct TOOLINFO
  15. {
  16. /// <summary>
  17. /// Size of this structure, in bytes. This member must be specified.
  18. /// </summary>
  19. public int cbSize;
  20. /// <summary>
  21. /// Flags that control the tooltip display. This member can be a combination of the following values:TTF_
  22. /// </summary>
  23. public int uFlags;
  24. /// <summary>
  25. /// Handle to the window that contains the tool. If lpszText includes the LPSTR_TEXTCALLBACK value, this member identifies the window that receives the TTN_GETDISPINFO notification codes.
  26. /// </summary>
  27. public IntPtr hwnd;
  28. /// <summary>
  29. /// Application-defined identifier of the tool. If uFlags includes the TTF_IDISHWND flag, uId must specify the window handle to the tool.
  30. /// </summary>
  31. public IntPtr uId;
  32. /// <summary>
  33. /// The bounding rectangle coordinates of the tool. The coordinates are relative to the upper-left corner of the client area of the window identified by hwnd. If uFlags includes the TTF_IDISHWND flag, this member is ignored.
  34. /// </summary>
  35. public RECT rect;
  36. /// <summary>
  37. /// Handle to the instance that contains the string resource for the tool. If lpszText specifies the identifier of a string resource, this member is used.
  38. /// </summary>
  39. public IntPtr hinst;
  40. /// <summary>
  41. /// Pointer to the buffer that contains the text for the tool, or identifier of the string resource that contains the text. This member is sometimes used to return values. If you need to examine the returned value, must point to a valid buffer of sufficient size. Otherwise, it can be set to NULL. If lpszText is set to LPSTR_TEXTCALLBACK, the control sends the TTN_GETDISPINFO notification code to the owner window to retrieve the text.
  42. /// </summary>
  43. [MarshalAs(UnmanagedType.LPTStr)]
  44. public string lpszText;
  45. /// <summary>
  46. /// Version 4.70 and later. A 32-bit application-defined value that is associated with the tool.
  47. /// </summary>
  48. public int lParam;
  49. /// <summary>
  50. /// Windows XP and later. Reserved. Must be set to NULL.
  51. /// </summary>
  52. public IntPtr lpReserved;
  53. }
  54. }
  55. }