home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2005 November / PCWELT_11_2005.ISO / pcwsoft / Commandbar-Source.z.exe / BandObjects / ComInterop.cs < prev   
Encoding:
Text File  |  2002-06-10  |  4.7 KB  |  194 lines

  1. // Pavel Zolnikov[http://www.codeproject.com/script/profile/whos_who.asp?id=35980], 2002
  2.  
  3. using System;
  4. using System.Drawing;
  5. using System.Windows.Forms;
  6. using System.Runtime.InteropServices;
  7.  
  8. namespace BandObjects
  9. {
  10.     public abstract class ExplorerGUIDs
  11.     {
  12.         public static readonly Guid IID_IWebBrowserApp = new Guid("{0002DF05-0000-0000-C000-000000000046}");
  13.         public static readonly Guid IID_IUnknown =         new Guid("{00000000-0000-0000-C000-000000000046}");
  14.     }
  15.  
  16.     [Flags]
  17.     public enum DBIM
  18.     {
  19.         MINSIZE   =0x0001,
  20.         MAXSIZE   =0x0002,
  21.         INTEGRAL  =0x0004,
  22.         ACTUAL    =0x0008,
  23.         TITLE     =0x0010,
  24.         MODEFLAGS =0x0020,
  25.         BKCOLOR   =0x0040
  26.     }
  27.  
  28.     [Flags]
  29.     public enum DBIMF
  30.     {
  31.         DBIMF_NORMAL           =0x0000,
  32.         DBIMF_FIXED            =0x0001,
  33.         DBIMF_FIXEDBMP         =0x0004,
  34.         DBIMF_VARIABLEHEIGHT   =0x0008,
  35.         DBIMF_UNDELETEABLE     =0x0010,
  36.         DBIMF_DEBOSSED         =0x0020,
  37.         DBIMF_BKCOLOR          =0x0040,
  38.         DBIMF_USECHEVRON       =0x0080,
  39.         DBIMF_BREAK            =0x0100,
  40.         DBIMF_ADDTOFRONT       =0x0200,
  41.         DBIMF_TOPALIGN         =0x0400
  42.     }
  43.  
  44.  
  45.     [StructLayout(LayoutKind.Sequential,CharSet=CharSet.Unicode)]
  46.     public struct DESKBANDINFO
  47.     {
  48.         public DBIM            dwMask;
  49.         public Point        ptMinSize;
  50.         public Point        ptMaxSize;
  51.         public Point        ptIntegral;
  52.         public Point        ptActual;
  53.         [MarshalAs(UnmanagedType.ByValTStr, SizeConst=255)]
  54.         public String        wszTitle;
  55.         public DBIMF        dwModeFlags;
  56.         public Int32        crBkgnd;
  57.     };
  58.  
  59.     [ComImport]
  60.     [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
  61.     [Guid("FC4801A3-2BA9-11CF-A229-00AA003D7352")] 
  62.     public interface IObjectWithSite
  63.     {
  64.         void SetSite([In ,MarshalAs(UnmanagedType.IUnknown)] Object site);
  65.         void GetSite(ref Guid riid, [MarshalAs(UnmanagedType.IUnknown)] out Object site);
  66.     }
  67.  
  68.     [ComImport]
  69.     [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
  70.     [Guid("00000114-0000-0000-C000-000000000046")] 
  71.     public interface IOleWindow
  72.     {
  73.         void GetWindow(out System.IntPtr hwnd);   
  74.         void ContextSensitiveHelp([In] bool enterMode);
  75.     }
  76.  
  77.     [ComImport]
  78.     [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
  79.     [Guid("012dd920-7b26-11d0-8ca9-00a0c92dbfe8")] 
  80.     public interface IDockingWindow
  81.     {
  82.         void GetWindow(out System.IntPtr hwnd);   
  83.         void ContextSensitiveHelp([In] bool enterMode);
  84.  
  85.         void ShowDW([In] bool show);
  86.         void CloseDW([In] Int32  reserved);
  87.         void ResizeBorderDW(
  88.             IntPtr borderRectangle,
  89.             [In, MarshalAs(UnmanagedType.IUnknown)] Object toolbarSite,
  90.             bool reserved);
  91.     }
  92.  
  93.  
  94.     [ComImport]
  95.     [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
  96.     [Guid("EB0FE172-1A3A-11D0-89B3-00A0C90A90AC")] 
  97.     public interface IDeskBand
  98.     {
  99.         void GetWindow(out System.IntPtr hwnd);   
  100.         void ContextSensitiveHelp([In] bool enterMode);
  101.  
  102.         void ShowDW([In] bool show);
  103.         void CloseDW([In] Int32  reserved);
  104.         
  105.         void ResizeBorderDW(
  106.             IntPtr borderRectangle,
  107.             [In, MarshalAs(UnmanagedType.IUnknown)] Object toolbarSite,
  108.             bool reserved);
  109.  
  110.         void GetBandInfo(
  111.             Int32 bandID,
  112.             Int32 viewMode,
  113.             ref DESKBANDINFO info);
  114.     }
  115.  
  116.  
  117.     [ComImport]
  118.     [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
  119.     [Guid("0000010c-0000-0000-C000-000000000046")]
  120.     public interface IPersist
  121.     {
  122.         void GetClassID(out Guid classID);
  123.     }
  124.  
  125.     
  126.     [ComImport]
  127.     [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
  128.     [Guid("00000109-0000-0000-C000-000000000046")]
  129.     public interface IPersistStream
  130.     {
  131.         void GetClassID(out Guid classID);
  132.  
  133.         void IsDirty ();
  134.  
  135.         void Load ([In, MarshalAs(UnmanagedType.Interface)] Object stream);
  136.  
  137.         void Save ([In, MarshalAs(UnmanagedType.Interface)] Object stream,
  138.             [In] bool clearDirty);
  139.  
  140.         void GetSizeMax ([Out] out Int64 size);
  141.     }
  142.  
  143.  
  144.     [ComImport]
  145.     [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
  146.     [Guid("6d5140c1-7436-11ce-8034-00aa006009fa")]
  147.     public interface IServiceProviderCOM
  148.     {
  149.         void QueryService(
  150.             ref Guid guid, 
  151.             ref Guid riid, 
  152.             [MarshalAs(UnmanagedType.Interface)] out Object obj);
  153.     }
  154.  
  155.  
  156.     [ComImport]
  157.     [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
  158.     [Guid("68284faa-6a48-11d0-8c78-00c04fd918b4")]
  159.     public interface IInputObject
  160.     {
  161.         void UIActivateIO(Int32 activate, ref MSG  msg);
  162.         
  163.         [PreserveSig]
  164.         Int32 HasFocusIO();
  165.  
  166.         [PreserveSig]
  167.         Int32 TranslateAcceleratorIO(ref MSG msg);
  168.     }
  169.  
  170.     [ComImport]
  171.     [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
  172.     [Guid("f1db8392-7331-11d0-8c99-00a0c92dbfe8")]
  173.     public interface IInputObjectSite
  174.     {
  175.         [PreserveSig]
  176.         Int32 OnFocusChangeIS( [MarshalAs(UnmanagedType.IUnknown)] Object obj, Int32 setFocus);
  177.     }
  178.  
  179.     public struct POINT
  180.     {
  181.         public Int32        x;
  182.         public Int32        y;
  183.     }
  184.  
  185.     public struct MSG 
  186.     {
  187.         public IntPtr        hwnd;
  188.         public Int32        message;
  189.         public Int32        wParam;
  190.         public Int32        lParam;
  191.         public Int32        time;
  192.         public POINT        pt;
  193.     }
  194. }