Interfaces.cs
Upload User: nnpulika
Upload Date: 2013-02-15
Package Size: 597k
Code Size: 3k
Category:

StatusBar

Development Platform:

C#

  1. using System;
  2. using System.Runtime.InteropServices;
  3. namespace UtilityLibrary.Win32
  4. {
  5. #region IUnknown
  6. [ComImport, Guid("00000000-0000-0000-c000-000000000046")]
  7. [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
  8. public interface IUnknown
  9. {
  10. [PreserveSig]
  11. IntPtr QueryInterface(REFIID riid, out IntPtr pVoid);
  12. [PreserveSig]
  13. IntPtr AddRef();
  14. [PreserveSig]
  15. IntPtr Release();
  16. }
  17. #endregion
  18. #region IMalloc
  19. [ComImport, Guid("00000002-0000-0000-C000-000000000046")]
  20. [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
  21. public interface IMalloc
  22. {
  23. [PreserveSig]
  24. IntPtr Alloc(uint cb);
  25. [PreserveSig]
  26. IntPtr Realloc(IntPtr pv, uint cb);
  27. [PreserveSig]
  28. void Free(IntPtr pv);
  29. [PreserveSig]
  30. uint GetSize(IntPtr pv);
  31. [PreserveSig]
  32. int DidAlloc(IntPtr pv);
  33. [PreserveSig]
  34. void HeapMinimize();
  35. }
  36. #endregion
  37. #region IShellFolder
  38. [ComImport, Guid("000214E6-0000-0000-c000-000000000046")]
  39. [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
  40. public interface IShellFolder
  41. {
  42. [PreserveSig]
  43. int ParseDisplayName(IntPtr hWnd, IntPtr bindingContext, 
  44. IntPtr OLEString, out uint chEaten, ref IntPtr idList, ref uint attributes);
  45. [PreserveSig]
  46. int EnumObjects(IntPtr hWnd, ShellEnumFlags flags,  ref IEnumIDList enumList);
  47. [PreserveSig]
  48.         int BindToObject(IntPtr idList, IntPtr bindingContext, ref REFIID refiid, ref IShellFolder folder);
  49.         
  50. [PreserveSig]
  51. int BindToStorage(ref IntPtr idList, IntPtr bindingContext, ref REFIID riid, IntPtr pVoid);
  52. [PreserveSig]
  53. int CompareIDs(int lparam, IntPtr idList1, IntPtr idList2);
  54.         
  55. [PreserveSig]
  56. int CreateViewObject(IntPtr hWnd, REFIID riid, IntPtr pVoid);
  57.         
  58. [PreserveSig]
  59. int GetAttributesOf(uint count, ref IntPtr idList, out GetAttributeOfFlags attributes);
  60. [PreserveSig]
  61. int GetUIObjectOf(IntPtr hWnd, uint count, ref IntPtr idList, 
  62. ref REFIID riid, out uint arrayInOut, ref IUnknown iUnknown);
  63. [PreserveSig]
  64. int GetDisplayNameOf(IntPtr idList, ShellGetDisplayNameOfFlags flags, out STRRET strRet);
  65. [PreserveSig]
  66. int SetNameOf(IntPtr hWnd, ref IntPtr idList,
  67. IntPtr pOLEString, uint flags, ref IntPtr pItemIDList);
  68.         
  69. }
  70.     #endregion
  71. #region IEnumIDList
  72. [ComImport, Guid("000214f2-0000-0000-c000-000000000046")]
  73. [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
  74. public interface IEnumIDList
  75. {
  76. [PreserveSig]
  77.         int Next(uint count, ref IntPtr idList, out uint fetched);
  78.  
  79. [PreserveSig]
  80. int Skip(uint count);
  81. [PreserveSig]
  82. int Reset();
  83. [PreserveSig]
  84. int Clone(ref IEnumIDList list);
  85. }
  86. #endregion
  87. #region IContextMenu
  88. [ComImport, Guid("000214e4-0000-0000-c000-000000000046")]
  89. [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
  90. public interface IContextMenu
  91. {
  92. [PreserveSig]
  93.         int QueryContextMenu(IntPtr hMenu, uint indexMenu, uint idFirstCommand, uint idLastCommand, QueryContextMenuFlags flags);
  94.     
  95. [PreserveSig]
  96. int InvokeCommand(ref CMINVOKECOMMANDINFO ici);
  97. [PreserveSig]
  98.         int GetCommandString(uint idCommand, uint type, uint reserved, string commandName, uint cchMax);
  99. }
  100. #endregion
  101. #region IContextMenu2
  102. [ComImport, Guid("000214f4-0000-0000-c000-000000000046")]
  103. [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
  104. public interface IContextMenu2
  105. {
  106. [PreserveSig]
  107. int HandleMenuMsg(uint message, int wParam, int lParam);
  108. }
  109. #endregion
  110.     
  111. }