From 7666127106724a536f9c57cfffc655e4112b1bb5 Mon Sep 17 00:00:00 2001 From: RKrom Date: Tue, 6 Mar 2012 17:41:19 +0000 Subject: [PATCH] Refactoring the interop code to a separate project. Still need to add the interop DLL to the final exe... or maybe I want to use references inside the projects... git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@1688 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4 --- Greenshot/Helpers/AviHelper.cs | 4 +- Greenshot/Helpers/CaptureHelper.cs | 2 +- Greenshot/Helpers/ClipboardHelper.cs | 2 +- Greenshot/Helpers/EnvironmentInfo.cs | 2 +- Greenshot/Helpers/FilenameHelper.cs | 2 +- Greenshot/Helpers/IECaptureHelper.cs | 4 +- Greenshot/Helpers/IEInterop/IEContainer.cs | 6 +- .../Helpers/IEInterop/IHTMLBodyElement.cs | 35 - .../Helpers/IEInterop/IHTMLCurrentStyle.cs | 67 - Greenshot/Helpers/IEInterop/IHTMLDocument.cs | 36 - Greenshot/Helpers/IEInterop/IHTMLDocument2.cs | 77 -- Greenshot/Helpers/IEInterop/IHTMLDocument3.cs | 47 - Greenshot/Helpers/IEInterop/IHTMLDocument4.cs | 33 - Greenshot/Helpers/IEInterop/IHTMLDocument5.cs | 34 - Greenshot/Helpers/IEInterop/IHTMLElement.cs | 117 -- Greenshot/Helpers/IEInterop/IHTMLElement2.cs | 39 - .../IEInterop/IHTMLElementCollection.cs | 33 - Greenshot/Helpers/IEInterop/IHTMLFrameBase.cs | 104 -- .../IEInterop/IHTMLFramesCollection2.cs | 39 - Greenshot/Helpers/IEInterop/IHTMLRect.cs | 49 - Greenshot/Helpers/IEInterop/IHTMLScreen.cs | 38 - Greenshot/Helpers/IEInterop/IHTMLScreen2.cs | 49 - .../Helpers/IEInterop/IHTMLSelectionObject.cs | 40 - Greenshot/Helpers/IEInterop/IHTMLStyle.cs | 1188 ----------------- Greenshot/Helpers/IEInterop/IHTMLTxtRange.cs | 138 -- Greenshot/Helpers/IEInterop/IHTMLWindow2.cs | 46 - Greenshot/Helpers/IEInterop/IHTMLWindow3.cs | 35 - Greenshot/Helpers/IEInterop/IHTMLWindow4.cs | 35 - Greenshot/Helpers/IEInterop/IOleWindow.cs | 32 - .../Helpers/IEInterop/IServiceProvider.cs | 32 - Greenshot/Helpers/IEInterop/IWebBrowser2.cs | 154 --- Greenshot/Helpers/ImageOutput.cs | 2 +- Greenshot/Helpers/MailHelper.cs | 4 +- .../Helpers/OfficeInterop/ExcelWrapper.cs | 131 -- .../Helpers/OfficeInterop/OfficeWrappers.cs | 325 ----- .../Helpers/OfficeInterop/OutlookUtils.cs | 854 ------------ .../Helpers/OfficeInterop/OutlookWrapper.cs | 510 ------- .../OfficeInterop/PowerpointWrapper.cs | 236 ---- .../Helpers/OfficeInterop/WordWrapper.cs | 171 --- Greenshot/Helpers/PluginHelper.cs | 2 +- Greenshot/Helpers/PrintHelper.cs | 2 +- Greenshot/Helpers/ScreenCaptureHelper.cs | 45 +- Greenshot/Helpers/UpdateHelper.cs | 2 +- 43 files changed, 51 insertions(+), 4752 deletions(-) delete mode 100644 Greenshot/Helpers/IEInterop/IHTMLBodyElement.cs delete mode 100644 Greenshot/Helpers/IEInterop/IHTMLCurrentStyle.cs delete mode 100644 Greenshot/Helpers/IEInterop/IHTMLDocument.cs delete mode 100644 Greenshot/Helpers/IEInterop/IHTMLDocument2.cs delete mode 100644 Greenshot/Helpers/IEInterop/IHTMLDocument3.cs delete mode 100644 Greenshot/Helpers/IEInterop/IHTMLDocument4.cs delete mode 100644 Greenshot/Helpers/IEInterop/IHTMLDocument5.cs delete mode 100644 Greenshot/Helpers/IEInterop/IHTMLElement.cs delete mode 100644 Greenshot/Helpers/IEInterop/IHTMLElement2.cs delete mode 100644 Greenshot/Helpers/IEInterop/IHTMLElementCollection.cs delete mode 100644 Greenshot/Helpers/IEInterop/IHTMLFrameBase.cs delete mode 100644 Greenshot/Helpers/IEInterop/IHTMLFramesCollection2.cs delete mode 100644 Greenshot/Helpers/IEInterop/IHTMLRect.cs delete mode 100644 Greenshot/Helpers/IEInterop/IHTMLScreen.cs delete mode 100644 Greenshot/Helpers/IEInterop/IHTMLScreen2.cs delete mode 100644 Greenshot/Helpers/IEInterop/IHTMLSelectionObject.cs delete mode 100644 Greenshot/Helpers/IEInterop/IHTMLStyle.cs delete mode 100644 Greenshot/Helpers/IEInterop/IHTMLTxtRange.cs delete mode 100644 Greenshot/Helpers/IEInterop/IHTMLWindow2.cs delete mode 100644 Greenshot/Helpers/IEInterop/IHTMLWindow3.cs delete mode 100644 Greenshot/Helpers/IEInterop/IHTMLWindow4.cs delete mode 100644 Greenshot/Helpers/IEInterop/IOleWindow.cs delete mode 100644 Greenshot/Helpers/IEInterop/IServiceProvider.cs delete mode 100644 Greenshot/Helpers/IEInterop/IWebBrowser2.cs delete mode 100644 Greenshot/Helpers/OfficeInterop/ExcelWrapper.cs delete mode 100644 Greenshot/Helpers/OfficeInterop/OfficeWrappers.cs delete mode 100644 Greenshot/Helpers/OfficeInterop/OutlookUtils.cs delete mode 100644 Greenshot/Helpers/OfficeInterop/OutlookWrapper.cs delete mode 100644 Greenshot/Helpers/OfficeInterop/PowerpointWrapper.cs delete mode 100644 Greenshot/Helpers/OfficeInterop/WordWrapper.cs diff --git a/Greenshot/Helpers/AviHelper.cs b/Greenshot/Helpers/AviHelper.cs index 8c7a95e75..ba8b623cb 100644 --- a/Greenshot/Helpers/AviHelper.cs +++ b/Greenshot/Helpers/AviHelper.cs @@ -321,9 +321,9 @@ namespace Greenshot.Helpers { } } - public void AddEmptyFrame() { + public void AddEmptyFrames(int frames) { lock (this) { - position++; + position += frames; } } diff --git a/Greenshot/Helpers/CaptureHelper.cs b/Greenshot/Helpers/CaptureHelper.cs index 632caaa03..2842e07c4 100644 --- a/Greenshot/Helpers/CaptureHelper.cs +++ b/Greenshot/Helpers/CaptureHelper.cs @@ -35,7 +35,7 @@ using Greenshot.Helpers; using Greenshot.Plugin; using GreenshotPlugin.Core; using GreenshotPlugin.UnmanagedHelpers; -using IniFile; +using Greenshot.IniFile; namespace Greenshot.Helpers { /// diff --git a/Greenshot/Helpers/ClipboardHelper.cs b/Greenshot/Helpers/ClipboardHelper.cs index d516ef276..47540779c 100644 --- a/Greenshot/Helpers/ClipboardHelper.cs +++ b/Greenshot/Helpers/ClipboardHelper.cs @@ -31,7 +31,7 @@ using System.Windows.Forms; using Greenshot.Configuration; using GreenshotPlugin.UnmanagedHelpers; using GreenshotPlugin.Core; -using IniFile; +using Greenshot.IniFile; namespace Greenshot.Helpers { /// diff --git a/Greenshot/Helpers/EnvironmentInfo.cs b/Greenshot/Helpers/EnvironmentInfo.cs index a217b9c6b..8f3e52f21 100644 --- a/Greenshot/Helpers/EnvironmentInfo.cs +++ b/Greenshot/Helpers/EnvironmentInfo.cs @@ -27,7 +27,7 @@ using System.Windows.Forms; using GreenshotPlugin.UnmanagedHelpers; using GreenshotPlugin.Core; -using IniFile; +using Greenshot.IniFile; namespace Greenshot.Helpers { /// diff --git a/Greenshot/Helpers/FilenameHelper.cs b/Greenshot/Helpers/FilenameHelper.cs index d6e3029b2..1d1ebffdc 100644 --- a/Greenshot/Helpers/FilenameHelper.cs +++ b/Greenshot/Helpers/FilenameHelper.cs @@ -26,7 +26,7 @@ using System.Windows.Forms; using Greenshot.Plugin; using GreenshotPlugin.Core; -using IniFile; +using Greenshot.IniFile; namespace Greenshot.Helpers { public static class FilenameHelper { diff --git a/Greenshot/Helpers/IECaptureHelper.cs b/Greenshot/Helpers/IECaptureHelper.cs index 5db370354..30f49abe5 100644 --- a/Greenshot/Helpers/IECaptureHelper.cs +++ b/Greenshot/Helpers/IECaptureHelper.cs @@ -26,11 +26,13 @@ using System.Drawing.Imaging; using Greenshot.Configuration; using Greenshot.Drawing.Filters; using Greenshot.Helpers.IEInterop; +using Greenshot.Interop; +using Greenshot.Interop.IE; using Greenshot.Plugin; using GreenshotPlugin.UnmanagedHelpers; using GreenshotPlugin.Controls; using GreenshotPlugin.Core; -using IniFile; +using Greenshot.IniFile; namespace Greenshot.Helpers { /// diff --git a/Greenshot/Helpers/IEInterop/IEContainer.cs b/Greenshot/Helpers/IEInterop/IEContainer.cs index 7e9dcfd00..1fd4b5132 100644 --- a/Greenshot/Helpers/IEInterop/IEContainer.cs +++ b/Greenshot/Helpers/IEInterop/IEContainer.cs @@ -26,7 +26,9 @@ using System.Runtime.InteropServices; using GreenshotPlugin.Core; using Greenshot.Plugin; -using IniFile; +using Greenshot.Interop; +using Greenshot.Interop.IE; +using Greenshot.IniFile; namespace Greenshot.Helpers.IEInterop { public class ElementContainer { @@ -302,7 +304,7 @@ namespace Greenshot.Helpers.IEInterop { // IE tries to prevent a cross frame scripting security issue. try { // Convert IHTMLWindow2 to IWebBrowser2 using IServiceProvider. - IServiceProvider sp = (IServiceProvider)htmlWindow; + Interop.IServiceProvider sp = (Interop.IServiceProvider)htmlWindow; // Use IServiceProvider.QueryService to get IWebBrowser2 object. Object brws = null; diff --git a/Greenshot/Helpers/IEInterop/IHTMLBodyElement.cs b/Greenshot/Helpers/IEInterop/IHTMLBodyElement.cs deleted file mode 100644 index 29709aa8e..000000000 --- a/Greenshot/Helpers/IEInterop/IHTMLBodyElement.cs +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom - * - * For more information see: http://getgreenshot.org/ - * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 1 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -using System; -using System.Runtime.InteropServices; - -namespace Greenshot.Helpers.IEInterop { - [ComImport, Guid("3050F1D8-98B5-11CF-BB82-00AA00BDCE0B"), - TypeLibType(TypeLibTypeFlags.FDual), - InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)] - public interface IHTMLBodyElement { - string scroll { - set; - [return: MarshalAs(UnmanagedType.BStr)] - get; - } - } -} diff --git a/Greenshot/Helpers/IEInterop/IHTMLCurrentStyle.cs b/Greenshot/Helpers/IEInterop/IHTMLCurrentStyle.cs deleted file mode 100644 index aa62ba201..000000000 --- a/Greenshot/Helpers/IEInterop/IHTMLCurrentStyle.cs +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom - * - * For more information see: http://getgreenshot.org/ - * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 1 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -using System; -using System.Runtime.InteropServices; - -namespace Greenshot.Helpers.IEInterop { - [ComImport, Guid("3050f3db-98b5-11cf-bb82-00aa00bdce0b"), - TypeLibType(TypeLibTypeFlags.FDual), - InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)] - public interface IHTMLCurrentStyle { - /// styleFloat property of IHTMLStyle interface. - string styleFloat { - [DispId(-2147413042)] - [return: MarshalAs(UnmanagedType.BStr)] - get; - } - - string left { - [DispId(-2147418112 + 3)] - [return: MarshalAs(UnmanagedType.BStr)] - get; - } - string top { - [DispId(-2147418112 + 4)] - [return: MarshalAs(UnmanagedType.BStr)] - get; - } - string width { - [DispId(-2147418112 + 5)] - [return: MarshalAs(UnmanagedType.BStr)] - get; - } - string height { - [DispId(-2147418112 + 6)] - [return: MarshalAs(UnmanagedType.BStr)] - get; - } - string right { - [DispId(-2147418112 + 0x4d)] - [return: MarshalAs(UnmanagedType.BStr)] - get; - } - string bottom { - [DispId(-2147418112 + 0x4e)] - [return: MarshalAs(UnmanagedType.BStr)] - get; - } - } -} diff --git a/Greenshot/Helpers/IEInterop/IHTMLDocument.cs b/Greenshot/Helpers/IEInterop/IHTMLDocument.cs deleted file mode 100644 index 9dc1fa09c..000000000 --- a/Greenshot/Helpers/IEInterop/IHTMLDocument.cs +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom - * - * For more information see: http://getgreenshot.org/ - * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 1 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -using System; -using System.Runtime.InteropServices; - -namespace Greenshot.Helpers.IEInterop { - /// IHTMLDocument interface. - [Guid("626FC520-A41E-11CF-A731-00A0C9082637")] - [ComImport] - [TypeLibType(TypeLibTypeFlags.FDual)] - [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)] - public interface IHTMLDocument { - object Script { - [return: MarshalAs(UnmanagedType.IDispatch)] - get; - } - } -} \ No newline at end of file diff --git a/Greenshot/Helpers/IEInterop/IHTMLDocument2.cs b/Greenshot/Helpers/IEInterop/IHTMLDocument2.cs deleted file mode 100644 index 3bb87301d..000000000 --- a/Greenshot/Helpers/IEInterop/IHTMLDocument2.cs +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom - * - * For more information see: http://getgreenshot.org/ - * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 1 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -using System; -using System.Runtime.InteropServices; - -namespace Greenshot.Helpers.IEInterop { - /// IHTMLDocument2 interface. - [Guid("332C4425-26CB-11D0-B483-00C04FD90119")] - [ComImport] - [TypeLibType(TypeLibTypeFlags.FDual)] - [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)] - public interface IHTMLDocument2 { - IHTMLElement body { - [DispId(1004)] - [return: MarshalAs(UnmanagedType.IDispatch)] - get; - } - string title { - [DispId(1012)] - [return: MarshalAs(UnmanagedType.BStr)] - get; - } - object frames { - [DispId(1019)] - [return: MarshalAs(UnmanagedType.IDispatch)] - get; - } - string url { - [DispId(1025)] - [return: MarshalAs(UnmanagedType.BStr)] - get; - } - - IHTMLWindow2 parentWindow { - [DispId(1034)] - [return: MarshalAs(UnmanagedType.IDispatch)] - get; - } - - object bgColor { - [DispId(-501)] - get; - } - - IHTMLSelectionObject selection { - [DispId(1017)] - [return: MarshalAs(UnmanagedType.IDispatch)] - get; - } - - string designMode { - [DispId(1014)] - [return: MarshalAs(UnmanagedType.BStr)] - get; - [DispId(1014)] - set; - } - } -} diff --git a/Greenshot/Helpers/IEInterop/IHTMLDocument3.cs b/Greenshot/Helpers/IEInterop/IHTMLDocument3.cs deleted file mode 100644 index 61a8bb864..000000000 --- a/Greenshot/Helpers/IEInterop/IHTMLDocument3.cs +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom - * - * For more information see: http://getgreenshot.org/ - * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 1 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -using System; -using System.Runtime.InteropServices; - -namespace Greenshot.Helpers.IEInterop { - /// IHTMLDocument3 interface. - [Guid("3050F485-98B5-11CF-BB82-00AA00BDCE0B")] - [ComImport] - [TypeLibType(TypeLibTypeFlags.FDual)] - [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)] - public interface IHTMLDocument3 { - IHTMLElement documentElement { - [DispId(1075)] - [return: MarshalAs(UnmanagedType.IDispatch)] - get; - } - - [DispId(1086)] - [return: MarshalAs(UnmanagedType.IDispatch)] - IHTMLElementCollection getElementsByName([MarshalAs(UnmanagedType.BStr)] string v); - - [DispId(1088)] - IHTMLElement getElementById([MarshalAs(UnmanagedType.BStr)] string v); - - [DispId(1087)] - IHTMLElementCollection getElementsByTagName([MarshalAs(UnmanagedType.BStr)] string v); - } -} \ No newline at end of file diff --git a/Greenshot/Helpers/IEInterop/IHTMLDocument4.cs b/Greenshot/Helpers/IEInterop/IHTMLDocument4.cs deleted file mode 100644 index 7810123a4..000000000 --- a/Greenshot/Helpers/IEInterop/IHTMLDocument4.cs +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom - * - * For more information see: http://getgreenshot.org/ - * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 1 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -using System; -using System.Runtime.InteropServices; - -namespace Greenshot.Helpers.IEInterop { - [ComVisible(true), Guid("3050f69a-98b5-11cf-bb82-00aa00bdce0b"), - InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch), - TypeLibType(TypeLibTypeFlags.FDual)] - public interface IHTMLDocument4 { - [DispId(1090)] - [return: MarshalAs(UnmanagedType.VariantBool)] - bool hasFocus(); - } -} \ No newline at end of file diff --git a/Greenshot/Helpers/IEInterop/IHTMLDocument5.cs b/Greenshot/Helpers/IEInterop/IHTMLDocument5.cs deleted file mode 100644 index 9e3f703a2..000000000 --- a/Greenshot/Helpers/IEInterop/IHTMLDocument5.cs +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom - * - * For more information see: http://getgreenshot.org/ - * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 1 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -using System; -using System.Runtime.InteropServices; - -namespace Greenshot.Helpers.IEInterop { - [ComImport, ComVisible(true), Guid("3050f80c-98b5-11cf-bb82-00aa00bdce0b"), - InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch), - TypeLibType(TypeLibTypeFlags.FDual)] - public interface IHTMLDocument5 { - [DispId(1102)] - string compatMode { - [return: MarshalAs(UnmanagedType.BStr)] get; - } - } -} \ No newline at end of file diff --git a/Greenshot/Helpers/IEInterop/IHTMLElement.cs b/Greenshot/Helpers/IEInterop/IHTMLElement.cs deleted file mode 100644 index c15326c8f..000000000 --- a/Greenshot/Helpers/IEInterop/IHTMLElement.cs +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom - * - * For more information see: http://getgreenshot.org/ - * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 1 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -using System; -using System.Runtime.InteropServices; - -namespace Greenshot.Helpers.IEInterop { - [ComImport, Guid("3050F1FF-98B5-11CF-BB82-00AA00BDCE0B"), - TypeLibType(TypeLibTypeFlags.FDual), - InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)] - public interface IHTMLElement { - [DispId(-2147417611)] - void setAttribute([MarshalAs(UnmanagedType.BStr)] string strAttributeName, object AttributeValue, int lFlags); - - [DispId(-2147417610)] - object getAttribute([MarshalAs(UnmanagedType.BStr)] string strAttributeName, int lFlags); - - long offsetLeft { - [DispId(-2147417104)] - get; - } - - long offsetTop { - [DispId(-2147417103)] - get; - } - - long offsetWidth { - [DispId(-2147417102)] - get; - } - - long offsetHeight { - [DispId(-2147417101)] - get; - } - - IHTMLElement offsetParent { - [DispId(-2147417100)] - get; - } - - string className { - [DispId(-2147417111)] - [return: MarshalAs(UnmanagedType.BStr)] - get; - } - - IHTMLDocument2 document { - [DispId(-2147417094)] - [return: MarshalAs(UnmanagedType.IDispatch)] - get; - } - - string id { - [DispId(-2147417110)] - [return: MarshalAs(UnmanagedType.BStr)] - get; - } - - string innerHTML { - [DispId(-2147417086)] - [return: MarshalAs(UnmanagedType.BStr)] - get; - } - - string innerText { - [DispId(-2147417085)] - [return: MarshalAs(UnmanagedType.BStr)] - get; - } - - IHTMLStyle style { - [DispId(-2147418038)] - [return: MarshalAs(UnmanagedType.IDispatch)] - get; - } - - string tagName { - [DispId(-2147417108)] - [return: MarshalAs(UnmanagedType.BStr)] - get; - } - - string title { - [DispId(-2147418043)] - [return: MarshalAs(UnmanagedType.BStr)] - get; - } - - [DispId(-2147417093)] - void scrollIntoView(bool varargStart); - - IHTMLElementCollection children { - [DispId(-2147417075)] - [return: MarshalAs(UnmanagedType.IDispatch)] - get; - } - } -} \ No newline at end of file diff --git a/Greenshot/Helpers/IEInterop/IHTMLElement2.cs b/Greenshot/Helpers/IEInterop/IHTMLElement2.cs deleted file mode 100644 index abadf04d6..000000000 --- a/Greenshot/Helpers/IEInterop/IHTMLElement2.cs +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom - * - * For more information see: http://getgreenshot.org/ - * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 1 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -using System; -using System.Runtime.InteropServices; - -namespace Greenshot.Helpers.IEInterop { - [ComImport, Guid("3050F434-98B5-11CF-BB82-00AA00BDCE0B"), - TypeLibType(TypeLibTypeFlags.FDual), - InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)] - public interface IHTMLElement2 { - [DispId(-2147417067)] - [return: MarshalAs(UnmanagedType.IDispatch)] - IHTMLRect getBoundingClientRect(); - - IHTMLCurrentStyle currentStyle { - [DispId(-2147417105)] - [return: MarshalAs(UnmanagedType.Interface)] //IHTMLCurrentStyle - get; - } - } -} \ No newline at end of file diff --git a/Greenshot/Helpers/IEInterop/IHTMLElementCollection.cs b/Greenshot/Helpers/IEInterop/IHTMLElementCollection.cs deleted file mode 100644 index 323d22fa5..000000000 --- a/Greenshot/Helpers/IEInterop/IHTMLElementCollection.cs +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom - * - * For more information see: http://getgreenshot.org/ - * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 1 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -using System; -using System.Collections; -using System.Runtime.InteropServices; - -namespace Greenshot.Helpers.IEInterop { - [ComImport(), ComVisible(true), - Guid("3050F21F-98B5-11CF-BB82-00AA00BDCE0B"), - InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch), - TypeLibType(TypeLibTypeFlags.FDispatchable)] - public interface IHTMLElementCollection : IEnumerable { - new IEnumerator GetEnumerator(); - } -} \ No newline at end of file diff --git a/Greenshot/Helpers/IEInterop/IHTMLFrameBase.cs b/Greenshot/Helpers/IEInterop/IHTMLFrameBase.cs deleted file mode 100644 index 9e7f75403..000000000 --- a/Greenshot/Helpers/IEInterop/IHTMLFrameBase.cs +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom - * - * For more information see: http://getgreenshot.org/ - * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 1 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -using System; -using System.Runtime.InteropServices; - -namespace Greenshot.Helpers.IEInterop { - [ComVisible(true), ComImport(), Guid("3050f311-98b5-11cf-bb82-00aa00bdce0b"), - TypeLibType(TypeLibTypeFlags.FDual), - InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)] - public interface IHTMLFrameBase { -//dispinterface IHTMLFrameBase { -// properties: -// methods: -// [id(0x80010bb8), propput] -// void src([in] BSTR rhs); -// [id(0x80010bb8), propget] -// BSTR src(); -// [id(0x80010000), propput] -// void name([in] BSTR rhs); -// [id(0x80010000), propget] -// BSTR name(); -// [id(0x80010bba), propput] -// void border([in] VARIANT rhs); -// [id(0x80010bba), propget] -// VARIANT border(); -// [id(0x80010bbb), propput] -// void frameBorder([in] BSTR rhs); -// [id(0x80010bbb), propget] -// BSTR frameBorder(); -// [id(0x80010bbc), propput] -// void frameSpacing([in] VARIANT rhs); -// [id(0x80010bbc), propget] -// VARIANT frameSpacing(); -// [id(0x80010bbd), propput] -// void marginWidth([in] VARIANT rhs); -// [id(0x80010bbd), propget] -// VARIANT marginWidth(); -// [id(0x80010bbe), propput] -// void marginHeight([in] VARIANT rhs); -// [id(0x80010bbe), propget] -// VARIANT marginHeight(); -// [id(0x80010bbf), propput] -// void noResize([in] VARIANT_BOOL rhs); -// [id(0x80010bbf), propget] -// VARIANT_BOOL noResize(); -// [id(0x80010bc0), propput] -// void scrolling([in] BSTR rhs); -// [id(0x80010bc0), propget] -// BSTR scrolling(); -//}; -// [DispId(HTMLDispIDs.DISPID_IHTMLFRAMEBASE_SRC)] - string src { - [return: MarshalAs(UnmanagedType.BStr)] - get; - } - string name { - [return: MarshalAs(UnmanagedType.BStr)] - get; - } - object border { - get; - } - string frameBorder { - [return: MarshalAs(UnmanagedType.BStr)] - get; - } - object frameSpacing { - get; - } - object marginWidth { - get; - } - object marginHeight { - get; - } - bool noResize { - [return: MarshalAs(UnmanagedType.VariantBool)] - get; - } - string scrolling { - [return: MarshalAs(UnmanagedType.BStr)] - get; - } - } - -} diff --git a/Greenshot/Helpers/IEInterop/IHTMLFramesCollection2.cs b/Greenshot/Helpers/IEInterop/IHTMLFramesCollection2.cs deleted file mode 100644 index 61c76a924..000000000 --- a/Greenshot/Helpers/IEInterop/IHTMLFramesCollection2.cs +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom - * - * For more information see: http://getgreenshot.org/ - * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 1 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -using System; -using System.Runtime.InteropServices; - -namespace Greenshot.Helpers.IEInterop { - [ComImport(), ComVisible(true), - Guid("332C4426-26CB-11D0-B483-00C04FD90119"), - InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch), - TypeLibType(TypeLibTypeFlags.FDispatchable)] - public interface IHTMLFramesCollection2 { - [DispId(0)] - [return: MarshalAs(UnmanagedType.IDispatch)] - IHTMLWindow2 item(int pvarIndex); - - long length { - [DispId(1001)] - get; - } - } -} \ No newline at end of file diff --git a/Greenshot/Helpers/IEInterop/IHTMLRect.cs b/Greenshot/Helpers/IEInterop/IHTMLRect.cs deleted file mode 100644 index 478eae79e..000000000 --- a/Greenshot/Helpers/IEInterop/IHTMLRect.cs +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom - * - * For more information see: http://getgreenshot.org/ - * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 1 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -using System; -using System.Runtime.InteropServices; - -namespace Greenshot.Helpers.IEInterop { - [ComImport, Guid("3050F4A3-98B5-11CF-BB82-00AA00BDCE0B"), - TypeLibType(TypeLibTypeFlags.FDual), - InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)] - public interface IHTMLRect { - int bottom { - [DispId(1004)] - get; - } - - int left { - [DispId(1001)] - get; - } - - int right { - [DispId(1003)] - get; - } - - int top { - [DispId(1002)] - get; - } - } -} diff --git a/Greenshot/Helpers/IEInterop/IHTMLScreen.cs b/Greenshot/Helpers/IEInterop/IHTMLScreen.cs deleted file mode 100644 index 104fd5d6f..000000000 --- a/Greenshot/Helpers/IEInterop/IHTMLScreen.cs +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom - * - * For more information see: http://getgreenshot.org/ - * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 1 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -using System; -using System.Runtime.InteropServices; - -namespace Greenshot.Helpers.IEInterop { - [ComImport, Guid("3050F35C-98B5-11CF-BB82-00AA00BDCE0B"), - TypeLibType(TypeLibTypeFlags.FDual), - InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)] - public interface IHTMLScreen { - [DispId(1003)] - int width { - get; - } - [DispId(1004)] - int height { - get; - } - } -} diff --git a/Greenshot/Helpers/IEInterop/IHTMLScreen2.cs b/Greenshot/Helpers/IEInterop/IHTMLScreen2.cs deleted file mode 100644 index 105fb982b..000000000 --- a/Greenshot/Helpers/IEInterop/IHTMLScreen2.cs +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom - * - * For more information see: http://getgreenshot.org/ - * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 1 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -using System; -using System.Runtime.InteropServices; - -namespace Greenshot.Helpers.IEInterop { - [ComImport, Guid("3050F84A-98B5-11CF-BB82-00AA00BDCE0B"), - TypeLibType(TypeLibTypeFlags.FDual), - InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)] - public interface IHTMLScreen2 { - int logicalXDPI { - [DispId(1009)] - get; - } - - int logicalYDPI { - [DispId(1010)] - get; - } - - int deviceXDPI { - [DispId(1011)] - get; - } - - int deviceYDPI { - [DispId(1012)] - get; - } - }; -} diff --git a/Greenshot/Helpers/IEInterop/IHTMLSelectionObject.cs b/Greenshot/Helpers/IEInterop/IHTMLSelectionObject.cs deleted file mode 100644 index a6029d0fd..000000000 --- a/Greenshot/Helpers/IEInterop/IHTMLSelectionObject.cs +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom - * - * For more information see: http://getgreenshot.org/ - * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 1 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -using System; -using System.Runtime.InteropServices; - -namespace Greenshot.Helpers.IEInterop { - // See: http://msdn.microsoft.com/en-us/library/aa768849%28v=vs.85%29.aspx - [ComImport, Guid("3050f25A-98b5-11cf-bb82-00aa00bdce0b"), - TypeLibType(TypeLibTypeFlags.FDual), - InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)] - public interface IHTMLSelectionObject { - [return: MarshalAs(UnmanagedType.IDispatch)] - [DispId(1001)] - IHTMLTxtRange createRange(); - [DispId(1002)] - void empty(); - [DispId(1003)] - void clear(); - [DispId(1004)] - string EventType { [return: MarshalAs(UnmanagedType.BStr)] get;} - } -} diff --git a/Greenshot/Helpers/IEInterop/IHTMLStyle.cs b/Greenshot/Helpers/IEInterop/IHTMLStyle.cs deleted file mode 100644 index 81a99babe..000000000 --- a/Greenshot/Helpers/IEInterop/IHTMLStyle.cs +++ /dev/null @@ -1,1188 +0,0 @@ -/* - * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom - * - * For more information see: http://getgreenshot.org/ - * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 1 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -using System; -using System.Runtime.InteropServices; - -namespace Greenshot.Helpers.IEInterop { - [ComImport, Guid("3050F25E-98B5-11CF-BB82-00AA00BDCE0B"), - TypeLibType(TypeLibTypeFlags.FDual), - InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)] - public interface IHTMLStyle { - /// setAttribute method of IHTMLStyle interface. - /// An original IDL definition of setAttribute method was the following: HRESULT setAttribute (BSTR strAttributeName, VARIANT AttributeValue, [optional, defaultvalue(1)] long lFlags); - // IDL: HRESULT setAttribute (BSTR strAttributeName, VARIANT AttributeValue, [optional, defaultvalue(1)] long lFlags); - // VB6: Sub setAttribute (ByVal strAttributeName As String, ByVal AttributeValue As Any, [ByVal lFlags As Long = 1]) - [DispId(-2147417611)] - void setAttribute([MarshalAs(UnmanagedType.BStr)] string strAttributeName, object AttributeValue, int lFlags); - - /// getAttribute method of IHTMLStyle interface. - /// An original IDL definition of getAttribute method was the following: HRESULT getAttribute (BSTR strAttributeName, [optional, defaultvalue(0)] long lFlags, [out, retval] VARIANT* ReturnValue); - // IDL: HRESULT getAttribute (BSTR strAttributeName, [optional, defaultvalue(0)] long lFlags, [out, retval] VARIANT* ReturnValue); - // VB6: Function getAttribute (ByVal strAttributeName As String, [ByVal lFlags As Long = 0]) As Any - [DispId(-2147417610)] - object getAttribute([MarshalAs(UnmanagedType.BStr)] string strAttributeName, int lFlags); - - /// removeAttribute method of IHTMLStyle interface. - /// An original IDL definition of removeAttribute method was the following: HRESULT removeAttribute (BSTR strAttributeName, [optional, defaultvalue(1)] long lFlags, [out, retval] VARIANT_BOOL* ReturnValue); - // IDL: HRESULT removeAttribute (BSTR strAttributeName, [optional, defaultvalue(1)] long lFlags, [out, retval] VARIANT_BOOL* ReturnValue); - // VB6: Function removeAttribute (ByVal strAttributeName As String, [ByVal lFlags As Long = 1]) As Boolean - [DispId(-2147417609)] - [return: MarshalAs(UnmanagedType.VariantBool)] - bool removeAttribute([MarshalAs(UnmanagedType.BStr)] string strAttributeName, int lFlags); - - /// toString method of IHTMLStyle interface. - /// An original IDL definition of toString method was the following: HRESULT toString ([out, retval] BSTR* ReturnValue); - // IDL: HRESULT toString ([out, retval] BSTR* ReturnValue); - // VB6: Function toString As String - [DispId(-2147414104)] - [return: MarshalAs(UnmanagedType.BStr)] - string toString(); - - /// background property of IHTMLStyle interface. - /// An original IDL definition of background property was the following: BSTR background; - // IDL: BSTR background; - // VB6: background As String - string background { - // IDL: HRESULT background ([out, retval] BSTR* ReturnValue); - // VB6: Function background As String - [DispId(-2147413080)] - [return: MarshalAs(UnmanagedType.BStr)] - get; - // IDL: HRESULT background (BSTR value); - // VB6: Sub background (ByVal value As String) - [DispId(-2147413080)] - set; - } - - /// backgroundAttachment property of IHTMLStyle interface. - /// An original IDL definition of backgroundAttachment property was the following: BSTR backgroundAttachment; - // IDL: BSTR backgroundAttachment; - // VB6: backgroundAttachment As String - string backgroundAttachment { - // IDL: HRESULT backgroundAttachment ([out, retval] BSTR* ReturnValue); - // VB6: Function backgroundAttachment As String - [DispId(-2147413067)] - [return: MarshalAs(UnmanagedType.BStr)] - get; - // IDL: HRESULT backgroundAttachment (BSTR value); - // VB6: Sub backgroundAttachment (ByVal value As String) - [DispId(-2147413067)] - set; - } - - /// backgroundColor property of IHTMLStyle interface. - /// An original IDL definition of backgroundColor property was the following: VARIANT backgroundColor; - // IDL: VARIANT backgroundColor; - // VB6: backgroundColor As Any - object backgroundColor { - // IDL: HRESULT backgroundColor ([out, retval] VARIANT* ReturnValue); - // VB6: Function backgroundColor As Any - [DispId(-501)] - get; - // IDL: HRESULT backgroundColor (VARIANT value); - // VB6: Sub backgroundColor (ByVal value As Any) - [DispId(-501)] - set; - } - - /// backgroundImage property of IHTMLStyle interface. - /// An original IDL definition of backgroundImage property was the following: BSTR backgroundImage; - // IDL: BSTR backgroundImage; - // VB6: backgroundImage As String - string backgroundImage { - // IDL: HRESULT backgroundImage ([out, retval] BSTR* ReturnValue); - // VB6: Function backgroundImage As String - [DispId(-2147413111)] - [return: MarshalAs(UnmanagedType.BStr)] - get; - // IDL: HRESULT backgroundImage (BSTR value); - // VB6: Sub backgroundImage (ByVal value As String) - [DispId(-2147413111)] - set; - } - - /// backgroundPosition property of IHTMLStyle interface. - /// An original IDL definition of backgroundPosition property was the following: BSTR backgroundPosition; - // IDL: BSTR backgroundPosition; - // VB6: backgroundPosition As String - string backgroundPosition { - // IDL: HRESULT backgroundPosition ([out, retval] BSTR* ReturnValue); - // VB6: Function backgroundPosition As String - [DispId(-2147413066)] - [return: MarshalAs(UnmanagedType.BStr)] - get; - // IDL: HRESULT backgroundPosition (BSTR value); - // VB6: Sub backgroundPosition (ByVal value As String) - [DispId(-2147413066)] - set; - } - - /// backgroundPositionX property of IHTMLStyle interface. - /// An original IDL definition of backgroundPositionX property was the following: VARIANT backgroundPositionX; - // IDL: VARIANT backgroundPositionX; - // VB6: backgroundPositionX As Any - object backgroundPositionX { - // IDL: HRESULT backgroundPositionX ([out, retval] VARIANT* ReturnValue); - // VB6: Function backgroundPositionX As Any - [DispId(-2147413079)] - get; - // IDL: HRESULT backgroundPositionX (VARIANT value); - // VB6: Sub backgroundPositionX (ByVal value As Any) - [DispId(-2147413079)] - set; - } - - /// backgroundPositionY property of IHTMLStyle interface. - /// An original IDL definition of backgroundPositionY property was the following: VARIANT backgroundPositionY; - // IDL: VARIANT backgroundPositionY; - // VB6: backgroundPositionY As Any - object backgroundPositionY { - // IDL: HRESULT backgroundPositionY ([out, retval] VARIANT* ReturnValue); - // VB6: Function backgroundPositionY As Any - [DispId(-2147413078)] - get; - // IDL: HRESULT backgroundPositionY (VARIANT value); - // VB6: Sub backgroundPositionY (ByVal value As Any) - [DispId(-2147413078)] - set; - } - - /// backgroundRepeat property of IHTMLStyle interface. - /// An original IDL definition of backgroundRepeat property was the following: BSTR backgroundRepeat; - // IDL: BSTR backgroundRepeat; - // VB6: backgroundRepeat As String - string backgroundRepeat { - // IDL: HRESULT backgroundRepeat ([out, retval] BSTR* ReturnValue); - // VB6: Function backgroundRepeat As String - [DispId(-2147413068)] - [return: MarshalAs(UnmanagedType.BStr)] - get; - // IDL: HRESULT backgroundRepeat (BSTR value); - // VB6: Sub backgroundRepeat (ByVal value As String) - [DispId(-2147413068)] - set; - } - - /// border property of IHTMLStyle interface. - /// An original IDL definition of border property was the following: BSTR border; - // IDL: BSTR border; - // VB6: border As String - string border { - // IDL: HRESULT border ([out, retval] BSTR* ReturnValue); - // VB6: Function border As String - [DispId(-2147413063)] - [return: MarshalAs(UnmanagedType.BStr)] - get; - // IDL: HRESULT border (BSTR value); - // VB6: Sub border (ByVal value As String) - [DispId(-2147413063)] - set; - } - - /// borderBottom property of IHTMLStyle interface. - /// An original IDL definition of borderBottom property was the following: BSTR borderBottom; - // IDL: BSTR borderBottom; - // VB6: borderBottom As String - string borderBottom { - // IDL: HRESULT borderBottom ([out, retval] BSTR* ReturnValue); - // VB6: Function borderBottom As String - [DispId(-2147413060)] - [return: MarshalAs(UnmanagedType.BStr)] - get; - // IDL: HRESULT borderBottom (BSTR value); - // VB6: Sub borderBottom (ByVal value As String) - [DispId(-2147413060)] - set; - } - - /// borderBottomColor property of IHTMLStyle interface. - /// An original IDL definition of borderBottomColor property was the following: VARIANT borderBottomColor; - // IDL: VARIANT borderBottomColor; - // VB6: borderBottomColor As Any - object borderBottomColor { - // IDL: HRESULT borderBottomColor ([out, retval] VARIANT* ReturnValue); - // VB6: Function borderBottomColor As Any - [DispId(-2147413055)] - get; - // IDL: HRESULT borderBottomColor (VARIANT value); - // VB6: Sub borderBottomColor (ByVal value As Any) - [DispId(-2147413055)] - set; - } - - /// borderBottomStyle property of IHTMLStyle interface. - /// An original IDL definition of borderBottomStyle property was the following: BSTR borderBottomStyle; - // IDL: BSTR borderBottomStyle; - // VB6: borderBottomStyle As String - string borderBottomStyle { - // IDL: HRESULT borderBottomStyle ([out, retval] BSTR* ReturnValue); - // VB6: Function borderBottomStyle As String - [DispId(-2147413045)] - [return: MarshalAs(UnmanagedType.BStr)] - get; - // IDL: HRESULT borderBottomStyle (BSTR value); - // VB6: Sub borderBottomStyle (ByVal value As String) - [DispId(-2147413045)] - set; - } - - /// borderBottomWidth property of IHTMLStyle interface. - /// An original IDL definition of borderBottomWidth property was the following: VARIANT borderBottomWidth; - // IDL: VARIANT borderBottomWidth; - // VB6: borderBottomWidth As Any - object borderBottomWidth { - // IDL: HRESULT borderBottomWidth ([out, retval] VARIANT* ReturnValue); - // VB6: Function borderBottomWidth As Any - [DispId(-2147413050)] - get; - // IDL: HRESULT borderBottomWidth (VARIANT value); - // VB6: Sub borderBottomWidth (ByVal value As Any) - [DispId(-2147413050)] - set; - } - - /// borderColor property of IHTMLStyle interface. - /// An original IDL definition of borderColor property was the following: BSTR borderColor; - // IDL: BSTR borderColor; - // VB6: borderColor As String - string borderColor { - // IDL: HRESULT borderColor ([out, retval] BSTR* ReturnValue); - // VB6: Function borderColor As String - [DispId(-2147413058)] - [return: MarshalAs(UnmanagedType.BStr)] - get; - // IDL: HRESULT borderColor (BSTR value); - // VB6: Sub borderColor (ByVal value As String) - [DispId(-2147413058)] - set; - } - - /// borderLeft property of IHTMLStyle interface. - /// An original IDL definition of borderLeft property was the following: BSTR borderLeft; - // IDL: BSTR borderLeft; - // VB6: borderLeft As String - string borderLeft { - // IDL: HRESULT borderLeft ([out, retval] BSTR* ReturnValue); - // VB6: Function borderLeft As String - [DispId(-2147413059)] - [return: MarshalAs(UnmanagedType.BStr)] - get; - // IDL: HRESULT borderLeft (BSTR value); - // VB6: Sub borderLeft (ByVal value As String) - [DispId(-2147413059)] - set; - } - - /// borderLeftColor property of IHTMLStyle interface. - /// An original IDL definition of borderLeftColor property was the following: VARIANT borderLeftColor; - // IDL: VARIANT borderLeftColor; - // VB6: borderLeftColor As Any - object borderLeftColor { - // IDL: HRESULT borderLeftColor ([out, retval] VARIANT* ReturnValue); - // VB6: Function borderLeftColor As Any - [DispId(-2147413054)] - get; - // IDL: HRESULT borderLeftColor (VARIANT value); - // VB6: Sub borderLeftColor (ByVal value As Any) - [DispId(-2147413054)] - set; - } - - /// borderLeftStyle property of IHTMLStyle interface. - /// An original IDL definition of borderLeftStyle property was the following: BSTR borderLeftStyle; - // IDL: BSTR borderLeftStyle; - // VB6: borderLeftStyle As String - string borderLeftStyle { - // IDL: HRESULT borderLeftStyle ([out, retval] BSTR* ReturnValue); - // VB6: Function borderLeftStyle As String - [DispId(-2147413044)] - [return: MarshalAs(UnmanagedType.BStr)] - get; - // IDL: HRESULT borderLeftStyle (BSTR value); - // VB6: Sub borderLeftStyle (ByVal value As String) - [DispId(-2147413044)] - set; - } - - /// borderLeftWidth property of IHTMLStyle interface. - /// An original IDL definition of borderLeftWidth property was the following: VARIANT borderLeftWidth; - // IDL: VARIANT borderLeftWidth; - // VB6: borderLeftWidth As Any - object borderLeftWidth { - // IDL: HRESULT borderLeftWidth ([out, retval] VARIANT* ReturnValue); - // VB6: Function borderLeftWidth As Any - [DispId(-2147413049)] - get; - // IDL: HRESULT borderLeftWidth (VARIANT value); - // VB6: Sub borderLeftWidth (ByVal value As Any) - [DispId(-2147413049)] - set; - } - - /// borderRight property of IHTMLStyle interface. - /// An original IDL definition of borderRight property was the following: BSTR borderRight; - // IDL: BSTR borderRight; - // VB6: borderRight As String - string borderRight { - // IDL: HRESULT borderRight ([out, retval] BSTR* ReturnValue); - // VB6: Function borderRight As String - [DispId(-2147413061)] - [return: MarshalAs(UnmanagedType.BStr)] - get; - // IDL: HRESULT borderRight (BSTR value); - // VB6: Sub borderRight (ByVal value As String) - [DispId(-2147413061)] - set; - } - - /// borderRightColor property of IHTMLStyle interface. - /// An original IDL definition of borderRightColor property was the following: VARIANT borderRightColor; - // IDL: VARIANT borderRightColor; - // VB6: borderRightColor As Any - object borderRightColor { - // IDL: HRESULT borderRightColor ([out, retval] VARIANT* ReturnValue); - // VB6: Function borderRightColor As Any - [DispId(-2147413056)] - get; - // IDL: HRESULT borderRightColor (VARIANT value); - // VB6: Sub borderRightColor (ByVal value As Any) - [DispId(-2147413056)] - set; - } - - /// borderRightStyle property of IHTMLStyle interface. - /// An original IDL definition of borderRightStyle property was the following: BSTR borderRightStyle; - // IDL: BSTR borderRightStyle; - // VB6: borderRightStyle As String - string borderRightStyle { - // IDL: HRESULT borderRightStyle ([out, retval] BSTR* ReturnValue); - // VB6: Function borderRightStyle As String - [DispId(-2147413046)] - [return: MarshalAs(UnmanagedType.BStr)] - get; - // IDL: HRESULT borderRightStyle (BSTR value); - // VB6: Sub borderRightStyle (ByVal value As String) - [DispId(-2147413046)] - set; - } - - /// borderRightWidth property of IHTMLStyle interface. - /// An original IDL definition of borderRightWidth property was the following: VARIANT borderRightWidth; - // IDL: VARIANT borderRightWidth; - // VB6: borderRightWidth As Any - object borderRightWidth { - // IDL: HRESULT borderRightWidth ([out, retval] VARIANT* ReturnValue); - // VB6: Function borderRightWidth As Any - [DispId(-2147413051)] - get; - // IDL: HRESULT borderRightWidth (VARIANT value); - // VB6: Sub borderRightWidth (ByVal value As Any) - [DispId(-2147413051)] - set; - } - - /// borderStyle property of IHTMLStyle interface. - /// An original IDL definition of borderStyle property was the following: BSTR borderStyle; - // IDL: BSTR borderStyle; - // VB6: borderStyle As String - string borderStyle { - // IDL: HRESULT borderStyle ([out, retval] BSTR* ReturnValue); - // VB6: Function borderStyle As String - [DispId(-2147413048)] - [return: MarshalAs(UnmanagedType.BStr)] - get; - // IDL: HRESULT borderStyle (BSTR value); - // VB6: Sub borderStyle (ByVal value As String) - [DispId(-2147413048)] - set; - } - - /// borderTop property of IHTMLStyle interface. - /// An original IDL definition of borderTop property was the following: BSTR borderTop; - // IDL: BSTR borderTop; - // VB6: borderTop As String - string borderTop { - // IDL: HRESULT borderTop ([out, retval] BSTR* ReturnValue); - // VB6: Function borderTop As String - [DispId(-2147413062)] - [return: MarshalAs(UnmanagedType.BStr)] - get; - // IDL: HRESULT borderTop (BSTR value); - // VB6: Sub borderTop (ByVal value As String) - [DispId(-2147413062)] - set; - } - - /// borderTopColor property of IHTMLStyle interface. - /// An original IDL definition of borderTopColor property was the following: VARIANT borderTopColor; - // IDL: VARIANT borderTopColor; - // VB6: borderTopColor As Any - object borderTopColor { - // IDL: HRESULT borderTopColor ([out, retval] VARIANT* ReturnValue); - // VB6: Function borderTopColor As Any - [DispId(-2147413057)] - get; - // IDL: HRESULT borderTopColor (VARIANT value); - // VB6: Sub borderTopColor (ByVal value As Any) - [DispId(-2147413057)] - set; - } - - /// borderTopStyle property of IHTMLStyle interface. - /// An original IDL definition of borderTopStyle property was the following: BSTR borderTopStyle; - // IDL: BSTR borderTopStyle; - // VB6: borderTopStyle As String - string borderTopStyle { - // IDL: HRESULT borderTopStyle ([out, retval] BSTR* ReturnValue); - // VB6: Function borderTopStyle As String - [DispId(-2147413047)] - [return: MarshalAs(UnmanagedType.BStr)] - get; - // IDL: HRESULT borderTopStyle (BSTR value); - // VB6: Sub borderTopStyle (ByVal value As String) - [DispId(-2147413047)] - set; - } - - /// borderTopWidth property of IHTMLStyle interface. - /// An original IDL definition of borderTopWidth property was the following: VARIANT borderTopWidth; - // IDL: VARIANT borderTopWidth; - // VB6: borderTopWidth As Any - object borderTopWidth { - // IDL: HRESULT borderTopWidth ([out, retval] VARIANT* ReturnValue); - // VB6: Function borderTopWidth As Any - [DispId(-2147413052)] - get; - // IDL: HRESULT borderTopWidth (VARIANT value); - // VB6: Sub borderTopWidth (ByVal value As Any) - [DispId(-2147413052)] - set; - } - - /// borderWidth property of IHTMLStyle interface. - /// An original IDL definition of borderWidth property was the following: BSTR borderWidth; - // IDL: BSTR borderWidth; - // VB6: borderWidth As String - string borderWidth { - // IDL: HRESULT borderWidth ([out, retval] BSTR* ReturnValue); - // VB6: Function borderWidth As String - [DispId(-2147413053)] - [return: MarshalAs(UnmanagedType.BStr)] - get; - // IDL: HRESULT borderWidth (BSTR value); - // VB6: Sub borderWidth (ByVal value As String) - [DispId(-2147413053)] - set; - } - - /// clear property of IHTMLStyle interface. - /// An original IDL definition of clear property was the following: BSTR clear; - // IDL: BSTR clear; - // VB6: clear As String - string clear - { - // IDL: HRESULT clear ([out, retval] BSTR* ReturnValue); - // VB6: Function clear As String - [DispId(-2147413096)] - [return: MarshalAs(UnmanagedType.BStr)] - get; - // IDL: HRESULT clear (BSTR value); - // VB6: Sub clear (ByVal value As String) - [DispId(-2147413096)] - set; - } - - /// clip property of IHTMLStyle interface. - /// An original IDL definition of clip property was the following: BSTR clip; - // IDL: BSTR clip; - // VB6: clip As String - string clip - { - // IDL: HRESULT clip ([out, retval] BSTR* ReturnValue); - // VB6: Function clip As String - [DispId(-2147413020)] - [return: MarshalAs(UnmanagedType.BStr)] - get; - // IDL: HRESULT clip (BSTR value); - // VB6: Sub clip (ByVal value As String) - [DispId(-2147413020)] - set; - } - - /// color property of IHTMLStyle interface. - /// An original IDL definition of color property was the following: VARIANT color; - // IDL: VARIANT color; - // VB6: color As Any - object color - { - // IDL: HRESULT color ([out, retval] VARIANT* ReturnValue); - // VB6: Function color As Any - [DispId(-2147413110)] - get; - // IDL: HRESULT color (VARIANT value); - // VB6: Sub color (ByVal value As Any) - [DispId(-2147413110)] - set; - } - - /// cssText property of IHTMLStyle interface. - /// An original IDL definition of cssText property was the following: BSTR cssText; - // IDL: BSTR cssText; - // VB6: cssText As String - string cssText - { - // IDL: HRESULT cssText ([out, retval] BSTR* ReturnValue); - // VB6: Function cssText As String - [DispId(-2147413013)] - [return: MarshalAs(UnmanagedType.BStr)] - get; - // IDL: HRESULT cssText (BSTR value); - // VB6: Sub cssText (ByVal value As String) - [DispId(-2147413013)] - set; - } - - /// cursor property of IHTMLStyle interface. - /// An original IDL definition of cursor property was the following: BSTR cursor; - // IDL: BSTR cursor; - // VB6: cursor As String - string cursor - { - // IDL: HRESULT cursor ([out, retval] BSTR* ReturnValue); - // VB6: Function cursor As String - [DispId(-2147413010)] - [return: MarshalAs(UnmanagedType.BStr)] - get; - // IDL: HRESULT cursor (BSTR value); - // VB6: Sub cursor (ByVal value As String) - [DispId(-2147413010)] - set; - } - - /// display property of IHTMLStyle interface. - /// An original IDL definition of display property was the following: BSTR display; - // IDL: BSTR display; - // VB6: display As String - string display - { - // IDL: HRESULT display ([out, retval] BSTR* ReturnValue); - // VB6: Function display As String - [DispId(-2147413041)] - [return: MarshalAs(UnmanagedType.BStr)] - get; - // IDL: HRESULT display (BSTR value); - // VB6: Sub display (ByVal value As String) - [DispId(-2147413041)] - set; - } - - /// filter property of IHTMLStyle interface. - /// An original IDL definition of filter property was the following: BSTR filter; - // IDL: BSTR filter; - // VB6: filter As String - string filter - { - // IDL: HRESULT filter ([out, retval] BSTR* ReturnValue); - // VB6: Function filter As String - [DispId(-2147413030)] - [return: MarshalAs(UnmanagedType.BStr)] - get; - // IDL: HRESULT filter (BSTR value); - // VB6: Sub filter (ByVal value As String) - [DispId(-2147413030)] - set; - } - - /// font property of IHTMLStyle interface. - /// An original IDL definition of font property was the following: BSTR font; - // IDL: BSTR font; - // VB6: font As String - string font - { - // IDL: HRESULT font ([out, retval] BSTR* ReturnValue); - // VB6: Function font As String - [DispId(-2147413071)] - [return: MarshalAs(UnmanagedType.BStr)] - get; - // IDL: HRESULT font (BSTR value); - // VB6: Sub font (ByVal value As String) - [DispId(-2147413071)] - set; - } - - /// fontFamily property of IHTMLStyle interface. - /// An original IDL definition of fontFamily property was the following: BSTR fontFamily; - // IDL: BSTR fontFamily; - // VB6: fontFamily As String - string fontFamily - { - // IDL: HRESULT fontFamily ([out, retval] BSTR* ReturnValue); - // VB6: Function fontFamily As String - [DispId(-2147413094)] - [return: MarshalAs(UnmanagedType.BStr)] - get; - // IDL: HRESULT fontFamily (BSTR value); - // VB6: Sub fontFamily (ByVal value As String) - [DispId(-2147413094)] - set; - } - - /// fontSize property of IHTMLStyle interface. - /// An original IDL definition of fontSize property was the following: VARIANT fontSize; - // IDL: VARIANT fontSize; - // VB6: fontSize As Any - object fontSize - { - // IDL: HRESULT fontSize ([out, retval] VARIANT* ReturnValue); - // VB6: Function fontSize As Any - [DispId(-2147413093)] - get; - // IDL: HRESULT fontSize (VARIANT value); - // VB6: Sub fontSize (ByVal value As Any) - [DispId(-2147413093)] - set; - } - - /// fontStyle property of IHTMLStyle interface. - /// An original IDL definition of fontStyle property was the following: BSTR fontStyle; - // IDL: BSTR fontStyle; - // VB6: fontStyle As String - string fontStyle - { - // IDL: HRESULT fontStyle ([out, retval] BSTR* ReturnValue); - // VB6: Function fontStyle As String - [DispId(-2147413088)] - [return: MarshalAs(UnmanagedType.BStr)] - get; - // IDL: HRESULT fontStyle (BSTR value); - // VB6: Sub fontStyle (ByVal value As String) - [DispId(-2147413088)] - set; - } - - /// fontVariant property of IHTMLStyle interface. - /// An original IDL definition of fontVariant property was the following: BSTR fontVariant; - // IDL: BSTR fontVariant; - // VB6: fontVariant As String - string fontVariant - { - // IDL: HRESULT fontVariant ([out, retval] BSTR* ReturnValue); - // VB6: Function fontVariant As String - [DispId(-2147413087)] - [return: MarshalAs(UnmanagedType.BStr)] - get; - // IDL: HRESULT fontVariant (BSTR value); - // VB6: Sub fontVariant (ByVal value As String) - [DispId(-2147413087)] - set; - } - - /// fontWeight property of IHTMLStyle interface. - /// An original IDL definition of fontWeight property was the following: BSTR fontWeight; - // IDL: BSTR fontWeight; - // VB6: fontWeight As String - string fontWeight - { - // IDL: HRESULT fontWeight ([out, retval] BSTR* ReturnValue); - // VB6: Function fontWeight As String - [DispId(-2147413085)] - [return: MarshalAs(UnmanagedType.BStr)] - get; - // IDL: HRESULT fontWeight (BSTR value); - // VB6: Sub fontWeight (ByVal value As String) - [DispId(-2147413085)] - set; - } - - /// height property of IHTMLStyle interface. - /// An original IDL definition of height property was the following: VARIANT height; - // IDL: VARIANT height; - // VB6: height As Any - object height - { - // IDL: HRESULT height ([out, retval] VARIANT* ReturnValue); - // VB6: Function height As Any - [DispId(-2147418106)] - get; - // IDL: HRESULT height (VARIANT value); - // VB6: Sub height (ByVal value As Any) - [DispId(-2147418106)] - set; - } - - /// left property of IHTMLStyle interface. - /// An original IDL definition of left property was the following: VARIANT left; - // IDL: VARIANT left; - // VB6: left As Any - object left - { - // IDL: HRESULT left ([out, retval] VARIANT* ReturnValue); - // VB6: Function left As Any - [DispId(-2147418109)] - get; - // IDL: HRESULT left (VARIANT value); - // VB6: Sub left (ByVal value As Any) - [DispId(-2147418109)] - set; - } - - /// letterSpacing property of IHTMLStyle interface. - /// An original IDL definition of letterSpacing property was the following: VARIANT letterSpacing; - // IDL: VARIANT letterSpacing; - // VB6: letterSpacing As Any - object letterSpacing - { - // IDL: HRESULT letterSpacing ([out, retval] VARIANT* ReturnValue); - // VB6: Function letterSpacing As Any - [DispId(-2147413104)] - get; - // IDL: HRESULT letterSpacing (VARIANT value); - // VB6: Sub letterSpacing (ByVal value As Any) - [DispId(-2147413104)] - set; - } - - /// lineHeight property of IHTMLStyle interface. - /// An original IDL definition of lineHeight property was the following: VARIANT lineHeight; - // IDL: VARIANT lineHeight; - // VB6: lineHeight As Any - object lineHeight - { - // IDL: HRESULT lineHeight ([out, retval] VARIANT* ReturnValue); - // VB6: Function lineHeight As Any - [DispId(-2147413106)] - get; - // IDL: HRESULT lineHeight (VARIANT value); - // VB6: Sub lineHeight (ByVal value As Any) - [DispId(-2147413106)] - set; - } - - /// listStyle property of IHTMLStyle interface. - /// An original IDL definition of listStyle property was the following: BSTR listStyle; - // IDL: BSTR listStyle; - // VB6: listStyle As String - string listStyle - { - // IDL: HRESULT listStyle ([out, retval] BSTR* ReturnValue); - // VB6: Function listStyle As String - [DispId(-2147413037)] - [return: MarshalAs(UnmanagedType.BStr)] - get; - // IDL: HRESULT listStyle (BSTR value); - // VB6: Sub listStyle (ByVal value As String) - [DispId(-2147413037)] - set; - } - - /// listStyleImage property of IHTMLStyle interface. - /// An original IDL definition of listStyleImage property was the following: BSTR listStyleImage; - // IDL: BSTR listStyleImage; - // VB6: listStyleImage As String - string listStyleImage - { - // IDL: HRESULT listStyleImage ([out, retval] BSTR* ReturnValue); - // VB6: Function listStyleImage As String - [DispId(-2147413038)] - [return: MarshalAs(UnmanagedType.BStr)] - get; - // IDL: HRESULT listStyleImage (BSTR value); - // VB6: Sub listStyleImage (ByVal value As String) - [DispId(-2147413038)] - set; - } - - /// listStylePosition property of IHTMLStyle interface. - /// An original IDL definition of listStylePosition property was the following: BSTR listStylePosition; - // IDL: BSTR listStylePosition; - // VB6: listStylePosition As String - string listStylePosition - { - // IDL: HRESULT listStylePosition ([out, retval] BSTR* ReturnValue); - // VB6: Function listStylePosition As String - [DispId(-2147413039)] - [return: MarshalAs(UnmanagedType.BStr)] - get; - // IDL: HRESULT listStylePosition (BSTR value); - // VB6: Sub listStylePosition (ByVal value As String) - [DispId(-2147413039)] - set; - } - - /// listStyleType property of IHTMLStyle interface. - /// An original IDL definition of listStyleType property was the following: BSTR listStyleType; - // IDL: BSTR listStyleType; - // VB6: listStyleType As String - string listStyleType - { - // IDL: HRESULT listStyleType ([out, retval] BSTR* ReturnValue); - // VB6: Function listStyleType As String - [DispId(-2147413040)] - [return: MarshalAs(UnmanagedType.BStr)] - get; - // IDL: HRESULT listStyleType (BSTR value); - // VB6: Sub listStyleType (ByVal value As String) - [DispId(-2147413040)] - set; - } - - /// margin property of IHTMLStyle interface. - /// An original IDL definition of margin property was the following: BSTR margin; - // IDL: BSTR margin; - // VB6: margin As String - string margin - { - // IDL: HRESULT margin ([out, retval] BSTR* ReturnValue); - // VB6: Function margin As String - [DispId(-2147413076)] - [return: MarshalAs(UnmanagedType.BStr)] - get; - // IDL: HRESULT margin (BSTR value); - // VB6: Sub margin (ByVal value As String) - [DispId(-2147413076)] - set; - } - - /// marginBottom property of IHTMLStyle interface. - /// An original IDL definition of marginBottom property was the following: VARIANT marginBottom; - // IDL: VARIANT marginBottom; - // VB6: marginBottom As Any - object marginBottom - { - // IDL: HRESULT marginBottom ([out, retval] VARIANT* ReturnValue); - // VB6: Function marginBottom As Any - [DispId(-2147413073)] - get; - // IDL: HRESULT marginBottom (VARIANT value); - // VB6: Sub marginBottom (ByVal value As Any) - [DispId(-2147413073)] - set; - } - - /// marginLeft property of IHTMLStyle interface. - /// An original IDL definition of marginLeft property was the following: VARIANT marginLeft; - // IDL: VARIANT marginLeft; - // VB6: marginLeft As Any - object marginLeft - { - // IDL: HRESULT marginLeft ([out, retval] VARIANT* ReturnValue); - // VB6: Function marginLeft As Any - [DispId(-2147413072)] - get; - // IDL: HRESULT marginLeft (VARIANT value); - // VB6: Sub marginLeft (ByVal value As Any) - [DispId(-2147413072)] - set; - } - - /// marginRight property of IHTMLStyle interface. - /// An original IDL definition of marginRight property was the following: VARIANT marginRight; - // IDL: VARIANT marginRight; - // VB6: marginRight As Any - object marginRight - { - // IDL: HRESULT marginRight ([out, retval] VARIANT* ReturnValue); - // VB6: Function marginRight As Any - [DispId(-2147413074)] - get; - // IDL: HRESULT marginRight (VARIANT value); - // VB6: Sub marginRight (ByVal value As Any) - [DispId(-2147413074)] - set; - } - - /// marginTop property of IHTMLStyle interface. - /// An original IDL definition of marginTop property was the following: VARIANT marginTop; - // IDL: VARIANT marginTop; - // VB6: marginTop As Any - object marginTop - { - // IDL: HRESULT marginTop ([out, retval] VARIANT* ReturnValue); - // VB6: Function marginTop As Any - [DispId(-2147413075)] - get; - // IDL: HRESULT marginTop (VARIANT value); - // VB6: Sub marginTop (ByVal value As Any) - [DispId(-2147413075)] - set; - } - - /// overflow property of IHTMLStyle interface. - /// An original IDL definition of overflow property was the following: BSTR overflow; - // IDL: BSTR overflow; - // VB6: overflow As String - string overflow - { - // IDL: HRESULT overflow ([out, retval] BSTR* ReturnValue); - // VB6: Function overflow As String - [DispId(-2147413102)] - [return: MarshalAs(UnmanagedType.BStr)] - get; - // IDL: HRESULT overflow (BSTR value); - // VB6: Sub overflow (ByVal value As String) - [DispId(-2147413102)] - set; - } - - /// padding property of IHTMLStyle interface. - /// An original IDL definition of padding property was the following: BSTR padding; - // IDL: BSTR padding; - // VB6: padding As String - string padding - { - // IDL: HRESULT padding ([out, retval] BSTR* ReturnValue); - // VB6: Function padding As String - [DispId(-2147413101)] - [return: MarshalAs(UnmanagedType.BStr)] - get; - // IDL: HRESULT padding (BSTR value); - // VB6: Sub padding (ByVal value As String) - [DispId(-2147413101)] - set; - } - - /// paddingBottom property of IHTMLStyle interface. - /// An original IDL definition of paddingBottom property was the following: VARIANT paddingBottom; - // IDL: VARIANT paddingBottom; - // VB6: paddingBottom As Any - object paddingBottom - { - // IDL: HRESULT paddingBottom ([out, retval] VARIANT* ReturnValue); - // VB6: Function paddingBottom As Any - [DispId(-2147413098)] - get; - // IDL: HRESULT paddingBottom (VARIANT value); - // VB6: Sub paddingBottom (ByVal value As Any) - [DispId(-2147413098)] - set; - } - - /// paddingLeft property of IHTMLStyle interface. - /// An original IDL definition of paddingLeft property was the following: VARIANT paddingLeft; - // IDL: VARIANT paddingLeft; - // VB6: paddingLeft As Any - object paddingLeft - { - // IDL: HRESULT paddingLeft ([out, retval] VARIANT* ReturnValue); - // VB6: Function paddingLeft As Any - [DispId(-2147413097)] - get; - // IDL: HRESULT paddingLeft (VARIANT value); - // VB6: Sub paddingLeft (ByVal value As Any) - [DispId(-2147413097)] - set; - } - - /// paddingRight property of IHTMLStyle interface. - object paddingRight { - [DispId(-2147413099)] - get; - } - - /// paddingTop property of IHTMLStyle interface. - object paddingTop { - [DispId(-2147413100)] - get; - } - - /// pageBreakAfter property of IHTMLStyle interface. - string pageBreakAfter { - [DispId(-2147413034)] - [return: MarshalAs(UnmanagedType.BStr)] - get; - } - - /// pageBreakBefore property of IHTMLStyle interface. - string pageBreakBefore { - [DispId(-2147413035)] - [return: MarshalAs(UnmanagedType.BStr)] - get; - } - - /// pixelHeight property of IHTMLStyle interface. - int pixelHeight { - [DispId(-2147414109)] - get; - } - - /// pixelLeft property of IHTMLStyle interface. - int pixelLeft { - [DispId(-2147414111)] - get; - } - - /// pixelTop property of IHTMLStyle interface. - int pixelTop { - [DispId(-2147414112)] - get; - } - - /// pixelWidth property of IHTMLStyle interface. - int pixelWidth { - [DispId(-2147414110)] - get; - } - - /// posHeight property of IHTMLStyle interface. - float posHeight { - [DispId(-2147414105)] - get; - } - - /// position property of IHTMLStyle interface. - string position { - [DispId(-2147413022)] - [return: MarshalAs(UnmanagedType.BStr)] - get; - } - - /// posLeft property of IHTMLStyle interface. - float posLeft { - [DispId(-2147414107)] - get; - } - - /// posTop property of IHTMLStyle interface. - float posTop { - [DispId(-2147414108)] - get; - } - - /// posWidth property of IHTMLStyle interface. - float posWidth { - [DispId(-2147414106)] - get; - } - - /// styleFloat property of IHTMLStyle interface. - string styleFloat { - [DispId(-2147413042)] - [return: MarshalAs(UnmanagedType.BStr)] - get; - } - - /// textAlign property of IHTMLStyle interface. - string textAlign { - [DispId(-2147418040)] - [return: MarshalAs(UnmanagedType.BStr)] - get; - } - - /// textDecoration property of IHTMLStyle interface. - string textDecoration { - [DispId(-2147413077)] - [return: MarshalAs(UnmanagedType.BStr)] - get; - } - - /// textDecorationBlink property of IHTMLStyle interface. - bool textDecorationBlink { - [DispId(-2147413090)] - [return: MarshalAs(UnmanagedType.VariantBool)] - get; - } - - /// textDecorationLineThrough property of IHTMLStyle interface. - bool textDecorationLineThrough { - [DispId(-2147413092)] - [return: MarshalAs(UnmanagedType.VariantBool)] - get; - } - - /// textDecorationNone property of IHTMLStyle interface. - bool textDecorationNone { - [DispId(-2147413089)] - [return: MarshalAs(UnmanagedType.VariantBool)] - get; - } - - /// textDecorationOverline property of IHTMLStyle interface. - bool textDecorationOverline { - [DispId(-2147413043)] - [return: MarshalAs(UnmanagedType.VariantBool)] - get; - } - - /// textDecorationUnderline property of IHTMLStyle interface. - bool textDecorationUnderline { - [DispId(-2147413091)] - [return: MarshalAs(UnmanagedType.VariantBool)] - get; - } - - /// textIndent property of IHTMLStyle interface. - object textIndent { - [DispId(-2147413105)] - get; - } - - /// textTransform property of IHTMLStyle interface. - string textTransform { - [DispId(-2147413108)] - [return: MarshalAs(UnmanagedType.BStr)] - get; - } - - /// top property of IHTMLStyle interface. - object top { - [DispId(-2147418108)] - get; - } - - /// verticalAlign property of IHTMLStyle interface. - object verticalAlign { - [DispId(-2147413064)] - get; - } - - /// visibility property of IHTMLStyle interface. - string visibility { - [DispId(-2147413032)] - [return: MarshalAs(UnmanagedType.BStr)] - get; - } - - /// whiteSpace property of IHTMLStyle interface. - string whiteSpace { - [DispId(-2147413036)] - [return: MarshalAs(UnmanagedType.BStr)] - get; - } - - /// width property of IHTMLStyle interface. - object width { - [DispId(-2147418107)] - get; - } - - /// wordSpacing property of IHTMLStyle interface. - object wordSpacing { - [DispId(-2147413065)] - get; - } - - /// zIndex property of IHTMLStyle interface. - object zIndex { - [DispId(-2147413021)] - get; - } - } -} diff --git a/Greenshot/Helpers/IEInterop/IHTMLTxtRange.cs b/Greenshot/Helpers/IEInterop/IHTMLTxtRange.cs deleted file mode 100644 index 472ee4a68..000000000 --- a/Greenshot/Helpers/IEInterop/IHTMLTxtRange.cs +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom - * - * For more information see: http://getgreenshot.org/ - * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 1 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -using System; -using System.Runtime.InteropServices; - -namespace Greenshot.Helpers.IEInterop { - // See: http://msdn.microsoft.com/en-us/library/aa741548%28v=vs.85%29.aspx - [ComImport, Guid("3050F220-98B5-11CF-BB82-00AA00BDCE0B"), - TypeLibType(TypeLibTypeFlags.FDual), - InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)] - public interface IHTMLTxtRange { - [DispId(1006)] - IHTMLElement parentElement(); - - [DispId(1008)] - IHTMLTxtRange duplicate(); - - [DispId(1010)] - [return: MarshalAs(UnmanagedType.VariantBool)] - bool inRange(IHTMLTxtRange range); - - [DispId(1011)] - [return: MarshalAs(UnmanagedType.VariantBool)] - bool isEqual(IHTMLTxtRange range); - - [DispId(1012)] - void scrollIntoView([MarshalAs(UnmanagedType.VariantBool)] bool fStart); - - [DispId(1013)] - void collapse([MarshalAs(UnmanagedType.VariantBool)] bool Start); - - [DispId(1014)] - [return: MarshalAs(UnmanagedType.VariantBool)] - bool expand([MarshalAs(UnmanagedType.BStr)] string Unit); - - [DispId(1015)] - int move([MarshalAs(UnmanagedType.BStr)] string Unit, int Count); - - [DispId(1016)] - int moveStart([MarshalAs(UnmanagedType.BStr)] string Unit, int Count); - - [DispId(1017)] - int moveEnd([MarshalAs(UnmanagedType.BStr)] string Unit, int Count); - - [DispId(1024)] - void select(); - - [DispId(1026)] - void pasteHTML([MarshalAs(UnmanagedType.BStr)] string html); - - [DispId(1001)] - void moveToElementText(IHTMLElement element); - - [DispId(1025)] - void setEndPoint([MarshalAs(UnmanagedType.BStr)] string how, IHTMLTxtRange SourceRange); - - [DispId(1018)] - int compareEndPoints([MarshalAs(UnmanagedType.BStr)] string how, IHTMLTxtRange SourceRange); - - [DispId(1019)] - [return: MarshalAs(UnmanagedType.VariantBool)] - bool findText([MarshalAs(UnmanagedType.BStr)] string String, int Count, int Flags); - - [DispId(1020)] - void moveToPoint(int x, int y); - - [DispId(1021)] - [return: MarshalAs(UnmanagedType.BStr)] - string getBookmark(); - - [DispId(1009)] - [return: MarshalAs(UnmanagedType.VariantBool)] - bool moveToBookmark([MarshalAs(UnmanagedType.BStr)] string Bookmark); - - [DispId(1027)] - [return: MarshalAs(UnmanagedType.VariantBool)] - bool queryCommandSupported([MarshalAs(UnmanagedType.BStr)] string cmdID); - - [DispId(1028)] - [return: MarshalAs(UnmanagedType.VariantBool)] - bool queryCommandEnabled([MarshalAs(UnmanagedType.BStr)] string cmdID); - - [DispId(1029)] - [return: MarshalAs(UnmanagedType.VariantBool)] - bool queryCommandState([MarshalAs(UnmanagedType.BStr)] string cmdID); - - [DispId(1030)] - [return: MarshalAs(UnmanagedType.VariantBool)] - bool queryCommandIndeterm([MarshalAs(UnmanagedType.BStr)] string cmdID); - - [DispId(1031)] - [return: MarshalAs(UnmanagedType.BStr)] - string queryCommandText([MarshalAs(UnmanagedType.BStr)] string cmdID); - - [DispId(1032)] - object queryCommandValue([MarshalAs(UnmanagedType.BStr)] string cmdID); - - [DispId(1033)] - [return: MarshalAs(UnmanagedType.VariantBool)] - bool execCommand([MarshalAs(UnmanagedType.BStr)] string cmdID, [MarshalAs(UnmanagedType.VariantBool)] bool showUI, object value); - - [DispId(1034)] - [return: MarshalAs(UnmanagedType.VariantBool)] - bool execCommandShowHelp([MarshalAs(UnmanagedType.BStr)] string cmdID); - - string htmlText { - [DispId(1003)] - [return: MarshalAs(UnmanagedType.BStr)] - get; - } - - string text { - [DispId(1004)] - [return: MarshalAs(UnmanagedType.BStr)] - get; - [DispId(1004)] - set; - } - } -} diff --git a/Greenshot/Helpers/IEInterop/IHTMLWindow2.cs b/Greenshot/Helpers/IEInterop/IHTMLWindow2.cs deleted file mode 100644 index abb2d4c83..000000000 --- a/Greenshot/Helpers/IEInterop/IHTMLWindow2.cs +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom - * - * For more information see: http://getgreenshot.org/ - * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 1 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -using System; -using System.Runtime.InteropServices; - -namespace Greenshot.Helpers.IEInterop { - [ComVisible(true), ComImport(), Guid("332c4427-26cb-11d0-b483-00c04fd90119"), - TypeLibType(TypeLibTypeFlags.FDual), - InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)] - public interface IHTMLWindow2 { - [DispId(1156)] - IHTMLScreen screen { - [return: MarshalAs(UnmanagedType.IDispatch)] - get; - } - - [DispId(1151)] - IHTMLDocument2 document { - [return: MarshalAs(UnmanagedType.IDispatch)] - get; - } - - [DispId(11)] - string name { - [return: MarshalAs(UnmanagedType.BStr)] get; - } - } -} \ No newline at end of file diff --git a/Greenshot/Helpers/IEInterop/IHTMLWindow3.cs b/Greenshot/Helpers/IEInterop/IHTMLWindow3.cs deleted file mode 100644 index 357005e45..000000000 --- a/Greenshot/Helpers/IEInterop/IHTMLWindow3.cs +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom - * - * For more information see: http://getgreenshot.org/ - * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 1 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -using System; -using System.Runtime.InteropServices; - -namespace Greenshot.Helpers.IEInterop { - [ComVisible(true), ComImport(), Guid("3050f4ae-98b5-11cf-bb82-00aa00bdce0b"), - TypeLibType(TypeLibTypeFlags.FDual), - InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)] - public interface IHTMLWindow3 { - [DispId(1170)] - int screenLeft { get;} - - [DispId(1171)] - int screenTop { get;} - } -} \ No newline at end of file diff --git a/Greenshot/Helpers/IEInterop/IHTMLWindow4.cs b/Greenshot/Helpers/IEInterop/IHTMLWindow4.cs deleted file mode 100644 index b30d35b6a..000000000 --- a/Greenshot/Helpers/IEInterop/IHTMLWindow4.cs +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom - * - * For more information see: http://getgreenshot.org/ - * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 1 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -using System; -using System.Runtime.InteropServices; - -namespace Greenshot.Helpers.IEInterop { - [ComVisible(true), ComImport(), Guid("3050f6cf-98b5-11cf-bb82-00aa00bdce0b"), - TypeLibType(TypeLibTypeFlags.FDual), - InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)] - public interface IHTMLWindow4 { - [DispId(1181)] - IHTMLFrameBase frameElement { - [return: MarshalAs(UnmanagedType.IDispatch)] - get; - } - } -} \ No newline at end of file diff --git a/Greenshot/Helpers/IEInterop/IOleWindow.cs b/Greenshot/Helpers/IEInterop/IOleWindow.cs deleted file mode 100644 index ad24dbe39..000000000 --- a/Greenshot/Helpers/IEInterop/IOleWindow.cs +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom - * - * For more information see: http://getgreenshot.org/ - * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 1 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -using System; -using System.Runtime.InteropServices; - -namespace Greenshot.Helpers.IEInterop { - // Needed to get the Window handle from the IDocument2 - // See: http://msdn.microsoft.com/en-us/library/ms680102%28v=vs.85%29.aspx - [ComImport, Guid("00000114-0000-0000-C000-000000000046"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - public interface IOleWindow { - void GetWindow(out IntPtr phwnd); - void ContextSensitiveHelp([In, MarshalAs(UnmanagedType.Bool)] bool fEnterMode); - } -} diff --git a/Greenshot/Helpers/IEInterop/IServiceProvider.cs b/Greenshot/Helpers/IEInterop/IServiceProvider.cs deleted file mode 100644 index dda857c0a..000000000 --- a/Greenshot/Helpers/IEInterop/IServiceProvider.cs +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom - * - * For more information see: http://getgreenshot.org/ - * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 1 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -using System; -using System.Runtime.InteropServices; - -namespace Greenshot.Helpers.IEInterop { - // This is the COM IServiceProvider interface, not System.IServiceProvider .Net interface! - [ComImport(), ComVisible(true), Guid("6D5140C1-7436-11CE-8034-00AA006009FA"), - InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)] - public interface IServiceProvider { - [return: MarshalAs(UnmanagedType.I4)][PreserveSig] - int QueryService(ref Guid guidService, ref Guid riid, [MarshalAs(UnmanagedType.Interface)] out object ppvObject); - } -} diff --git a/Greenshot/Helpers/IEInterop/IWebBrowser2.cs b/Greenshot/Helpers/IEInterop/IWebBrowser2.cs deleted file mode 100644 index 9bd3eaa47..000000000 --- a/Greenshot/Helpers/IEInterop/IWebBrowser2.cs +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom - * - * For more information see: http://getgreenshot.org/ - * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 1 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -using System; -using System.Runtime.InteropServices; - -namespace Greenshot.Helpers.IEInterop { - // IWebBrowser: EAB22AC1-30C1-11CF-A7EB-0000C05BAE0B -// [ComVisible(true), ComImport(), Guid("D30C1661-CDAF-11D0-8A3E-00C04FC9E26E"), -// TypeLibType(TypeLibTypeFlags.FDual), -// InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)] -// public interface IWebBrowser2 { -// [DispId(203)] -// object Document { -// [return: MarshalAs(UnmanagedType.IDispatch)] -// get; -// } -// } - [ComImport, /*SuppressUnmanagedCodeSecurity,*/ - TypeLibType(TypeLibTypeFlags.FOleAutomation | - TypeLibTypeFlags.FDual | - TypeLibTypeFlags.FHidden), - Guid("D30C1661-CDAF-11d0-8A3E-00C04FC9E26E")] - public interface IWebBrowser2 { - [DispId(100)] - void GoBack(); - [DispId(0x65)] - void GoForward(); - [DispId(0x66)] - void GoHome(); - [DispId(0x67)] - void GoSearch(); - [DispId(0x68)] - void Navigate([In] string Url, - [In] ref object flags, - [In] ref object targetFrameName, - [In] ref object postData, - [In] ref object headers); - [DispId(-550)] - void Refresh(); - [DispId(0x69)] - void Refresh2([In] ref object level); - [DispId(0x6a)] - void Stop(); - [DispId(200)] - object Application { - [return: - MarshalAs(UnmanagedType.IDispatch)] - get; - } - [DispId(0xc9)] - object Parent { - [return: - MarshalAs(UnmanagedType.IDispatch)] - get; - } - [DispId(0xca)] - object Container { - [return: - MarshalAs(UnmanagedType.IDispatch)] - get; - } - [DispId(0xcb)] - object Document { - [return: - MarshalAs(UnmanagedType.IDispatch)] - get; - } - [DispId(0xcc)] - bool TopLevelContainer { get; } - [DispId(0xcd)] - string Type { get; } - [DispId(0xce)] - int Left { get; set; } - [DispId(0xcf)] - int Top { get; set; } - [DispId(0xd0)] - int Width { get; set; } - [DispId(0xd1)] - int Height { get; set; } - [DispId(210)] - string LocationName { get; } - [DispId(0xd3)] - string LocationURL { get; } - [DispId(0xd4)] - bool Busy { get; } - [DispId(300)] - void Quit(); - [DispId(0x12d)] - void ClientToWindow(out int pcx, out int pcy); - [DispId(0x12e)] - void PutProperty([In] string property, [In] object vtValue); - [DispId(0x12f)] - object GetProperty([In] string property); - [DispId(0)] - string Name { get; } - [DispId(-515)] - int HWND { get; } - [DispId(400)] - string FullName { get; } - [DispId(0x191)] - string Path { get; } - [DispId(0x192)] - bool Visible { get; set; } - [DispId(0x193)] - bool StatusBar { get; set; } - [DispId(0x194)] - string StatusText { get; set; } - [DispId(0x195)] - int ToolBar { get; set; } - [DispId(0x196)] - bool MenuBar { get; set; } - [DispId(0x197)] - bool FullScreen { get; set; } - [DispId(500)] - void Navigate2([In] ref object URL, - [In] ref object flags, - [In] ref object targetFrameName, - [In] ref object postData, - [In] ref object headers); - - [DispId(550)] - bool Offline { get; set; } - [DispId(0x227)] - bool Silent { get; set; } - [DispId(0x228)] - bool RegisterAsBrowser { get; set; } - [DispId(0x229)] - bool RegisterAsDropTarget { get; set; } - [DispId(0x22a)] - bool TheaterMode { get; set; } - [DispId(0x22b)] - bool AddressBar { get; set; } - [DispId(0x22c)] - bool Resizable { get; set; } - } -} \ No newline at end of file diff --git a/Greenshot/Helpers/ImageOutput.cs b/Greenshot/Helpers/ImageOutput.cs index 8fd289cfa..af6af10cd 100644 --- a/Greenshot/Helpers/ImageOutput.cs +++ b/Greenshot/Helpers/ImageOutput.cs @@ -30,7 +30,7 @@ using Greenshot.Configuration; using Greenshot.Forms; using Greenshot.Plugin; using GreenshotPlugin.Core; -using IniFile; +using Greenshot.IniFile; namespace Greenshot.Helpers { /// diff --git a/Greenshot/Helpers/MailHelper.cs b/Greenshot/Helpers/MailHelper.cs index 17a7994dd..2c20c0457 100644 --- a/Greenshot/Helpers/MailHelper.cs +++ b/Greenshot/Helpers/MailHelper.cs @@ -28,10 +28,10 @@ using System.Text.RegularExpressions; using System.Threading; using System.Windows.Forms; -using Greenshot.Helpers.OfficeInterop; +using Greenshot.Interop.Office; using Greenshot.Plugin; using GreenshotPlugin.Core; -using IniFile; +using Greenshot.IniFile; /// /// Author: Andrew Baker diff --git a/Greenshot/Helpers/OfficeInterop/ExcelWrapper.cs b/Greenshot/Helpers/OfficeInterop/ExcelWrapper.cs deleted file mode 100644 index 0d933581f..000000000 --- a/Greenshot/Helpers/OfficeInterop/ExcelWrapper.cs +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom - * - * For more information see: http://getgreenshot.org/ - * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 1 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -using System; -using System.Collections.Generic; -using System.Reflection; -using Greenshot.Interop; - -namespace Greenshot.Helpers.OfficeInterop { - // See http://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel.application.aspx - [ComProgId("Excel.Application")] - public interface IExcelApplication : Common { - IWorkbook ActiveWorkbook { get; } - //ISelection Selection {get;} - IWorkbooks Workbooks {get;} - bool Visible {get; set;} - } - - // See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel.workbooks.aspx - public interface IWorkbooks : Common, Collection { - IWorkbook Add(object template); - IWorkbook this[object Index] { get; } - } - - // See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel.workbook.aspx - public interface IWorkbook : Common { - IWorksheet ActiveSheet {get;} - string Name { get; } - void Activate(); - IWorksheets Worksheets { get; } - } - - // See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel._worksheet_members.aspx - public interface IWorksheet : Common { - IPictures Pictures {get;} - string Name { get; } - } - - // See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.excel.iworksheets_members.aspx - public interface IWorksheets : Common, Collection { - Object this[object Index] { get; } - } - - public interface IPictures : Common, Collection { - void Insert(string file); - } - - public class ExcelExporter { - private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(ExcelExporter)); - - private static IExcelApplication GetOrCreateExcelApplication() { - return (IExcelApplication)COMWrapper.GetOrCreateInstance(typeof(IExcelApplication)); - } - - private static IExcelApplication GetExcelApplication() { - return (IExcelApplication)COMWrapper.GetInstance(typeof(IExcelApplication)); - } - - public static List GetWorkbooks() { - List currentWorkbooks = new List(); - using( IExcelApplication excelApplication = GetExcelApplication() ) { - if (excelApplication != null) { - for(int i = 1; i <= excelApplication.Workbooks.Count ; i ++) { - IWorkbook workbook = excelApplication.Workbooks[i]; - if (workbook != null) { - currentWorkbooks.Add(workbook.Name); - } - } - } - } - return currentWorkbooks; - } - - /// - /// Insert image from supplied tmp file into the give excel workbook - /// - /// - /// - public static void InsertIntoExistingWorkbook(string workbookName, string tmpFile) { - using( IExcelApplication excelApplication = GetExcelApplication() ) { - if (excelApplication != null) { - for(int i = 1; i <= excelApplication.Workbooks.Count ; i ++) { - IWorkbook workbook = excelApplication.Workbooks[i]; - if (workbook != null && workbook.Name.StartsWith(workbookName)) { - InsertIntoExistingWorkbook(workbook, tmpFile); - } - } - } - } - } - - private static void InsertIntoExistingWorkbook(IWorkbook workbook, string tmpFile) { - IWorksheet sheet = workbook.ActiveSheet; - if (sheet != null) { - if (sheet.Pictures != null) { - sheet.Pictures.Insert(tmpFile); - } - } else { - LOG.Error("No pictures found"); - } - } - - public static void InsertIntoNewWorkbook(string tmpFile) { - using( IExcelApplication excelApplication = GetOrCreateExcelApplication() ) { - if (excelApplication != null) { - excelApplication.Visible = true; - object template = Missing.Value; - IWorkbook workbook = excelApplication.Workbooks.Add(template); - InsertIntoExistingWorkbook(workbook, tmpFile); - } - } - } - } -} diff --git a/Greenshot/Helpers/OfficeInterop/OfficeWrappers.cs b/Greenshot/Helpers/OfficeInterop/OfficeWrappers.cs deleted file mode 100644 index 5c3df0711..000000000 --- a/Greenshot/Helpers/OfficeInterop/OfficeWrappers.cs +++ /dev/null @@ -1,325 +0,0 @@ -/* - * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom - * - * For more information see: http://getgreenshot.org/ - * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 1 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -using System; -using System.Collections; - -namespace Greenshot.Helpers.OfficeInterop { - /// - /// Common properties that has appreared in almost all objects - /// - public interface Common : IDisposable { - } - - public interface Collection : Common, IEnumerable { - int Count { get; } - void Remove( int index ); - } - - public interface Items : Collection, IEnumerable - { - Item this[ object index ] { get; } - object GetFirst(); - object GetLast(); - - // Actual definition is "object Add( object )", just making it convenient - object Add( OlItemType type ); - } - - // See: http://msdn.microsoft.com/en-us/library/ff861252.aspx - public interface Item : Common { - Attachments Attachments { get; } - string Body { get; set; } - OlObjectClass Class { get; } - DateTime CreationTime { get; } - string EntryID { get; } - DateTime LastModificationTime { get; } - string MessageClass { get; set; } - bool NoAging { get; set; } - int OutlookInternalVersion { get; } - string OutlookVersion { get; } - bool Saved { get; } - OlSensitivity Sensitivity { get; set; } - int Size { get; } - string Subject { get; set; } - bool UnRead { get; set; } - object Copy(); - void Display(object Modal); - void Save(); - DateTime ExpiryTime { get; set; } - string HTMLBody { get; set; } - DateTime ReceivedTime { get; } - string SenderName { get; } - DateTime SentOn { get; } - OlBodyFormat BodyFormat { get; set; } - PropertyAccessor PropertyAccessor { get; } - // MailItem - bool Sent { get; } - object MAPIOBJECT { get; } - // AppointmentItem - string Organizer { get; set; } - string SendUsingAccount { get; } - } - - public interface Attachments : Collection { - Attachment Add( object source, object type, object position, object displayName ); - } - - // See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.outlook.attachment_members.aspx - public interface Attachment : Common { - string DisplayName { get;set; } - string FileName { get; } - OlAttachmentType Type { get; } - PropertyAccessor PropertyAccessor { get; } - object MAPIOBJECT { get; } - } - - // See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.outlook.propertyaccessor_members.aspx - public interface PropertyAccessor : Common { - void SetProperty(string SchemaName, Object Value); - Object GetProperty(string SchemaName); - } - - public enum OlBodyFormat { - // Fields - olFormatHTML = 2, - olFormatPlain = 1, - olFormatRichText = 3, - olFormatUnspecified = 0 - } - - public enum OlAttachmentType { - // Fields - olByReference = 4, - olByValue = 1, - olEmbeddeditem = 5, - olOLE = 6 - } - - public enum OlSensitivity { - // Fields - olConfidential = 3, - olNormal = 0, - olPersonal = 1, - olPrivate = 2 - } - - // See: http://msdn.microsoft.com/en-us/library/ff863329.aspx - public enum OlObjectClass { - olAccount = 105 , // Represents an Account object. - olAccountRuleCondition = 135 , // Represents an AccountRuleCondition object. - olAccounts = 106 , // Represents an Accounts object. - olAction = 32 , // Represents an Action object. - olActions = 33 , // Represents an Actions object. - olAddressEntries = 21 , // Represents an AddressEntries object. - olAddressEntry = 8 , // Represents an AddressEntry object. - olAddressList = 7 , // Represents an AddressList object. - olAddressLists = 20 , // Represents an AddressLists object. - olAddressRuleCondition = 170 , // Represents an AddressRuleCondition object. - olApplication = 0 , // Represents an Application object. - olAppointment = 26 , // Represents an AppointmentItem object. - olAssignToCategoryRuleAction = 122 , // Represents an AssignToCategoryRuleAction object. - olAttachment = 5 , // Represents an Attachment object. - olAttachments = 18 , // Represents an Attachments object. - olAttachmentSelection = 169 , // Represents an AttachmentSelection object. - olAutoFormatRule = 147 , // Represents an AutoFormatRule object. - olAutoFormatRules = 148 , // Represents an AutoFormatRules object. - olCalendarModule = 159 , // Represents a CalendarModule object. - olCalendarSharing = 151 , // Represents a CalendarSharing object. - olCategories = 153 , // Represents a Categories object. - olCategory = 152 , // Represents a Category object. - olCategoryRuleCondition = 130 , // Represents a CategoryRuleCondition object. - olClassBusinessCardView = 168 , // Represents a BusinessCardView object. - olClassCalendarView = 139 , // Represents a CalendarView object. - olClassCardView = 138 , // Represents a CardView object. - olClassIconView = 137 , // Represents a IconView object. - olClassNavigationPane = 155 , // Represents a NavigationPane object. - olClassTableView = 136 , // Represents a TableView object. - olClassTimeLineView = 140 , // Represents a TimelineView object. - olClassTimeZone = 174 , // Represents a TimeZone object. - olClassTimeZones = 175 , // Represents a TimeZones object. - olColumn = 154 , // Represents a Column object. - olColumnFormat = 149 , // Represents a ColumnFormat object. - olColumns = 150 , // Represents a Columns object. - olConflict = 102 , // Represents a Conflict object. - olConflicts = 103 , // Represents a Conflicts object. - olContact = 40 , // Represents a ContactItem object. - olContactsModule = 160 , // Represents a ContactsModule object. - olDistributionList = 69 , // Represents a ExchangeDistributionList object. - olDocument = 41 , // Represents a DocumentItem object. - olException = 30 , // Represents an Exception object. - olExceptions = 29 , // Represents an Exceptions object. - olExchangeDistributionList = 111 , // Represents an ExchangeDistributionList object. - olExchangeUser = 110 , // Represents an ExchangeUser object. - olExplorer = 34 , // Represents an Explorer object. - olExplorers = 60 , // Represents an Explorers object. - olFolder = 2 , // Represents a Folder object. - olFolders = 15 , // Represents a Folders object. - olFolderUserProperties = 172 , // Represents a UserDefinedProperties object. - olFolderUserProperty = 171 , // Represents a UserDefinedProperty object. - olFormDescription = 37 , // Represents a FormDescription object. - olFormNameRuleCondition = 131 , // Represents a FormNameRuleCondition object. - olFormRegion = 129 , // Represents a FormRegion object. - olFromRssFeedRuleCondition = 173 , // Represents a FromRssFeedRuleCondition object. - olFromRuleCondition = 132 , // Represents a ToOrFromRuleCondition object. - olImportanceRuleCondition = 128 , // Represents an ImportanceRuleCondition object. - olInspector = 35 , // Represents an Inspector object. - olInspectors = 61 , // Represents an Inspectors object. - olItemProperties = 98 , // Represents an ItemProperties object. - olItemProperty = 99 , // Represents an ItemProperty object. - olItems = 16 , // Represents an Items object. - olJournal = 42 , // Represents a JournalItem object. - olJournalModule = 162 , // Represents a JournalModule object. - olLink = 75 , // Represents a Link object. - olLinks = 76 , // Represents a Links object. - olMail = 43 , // Represents a MailItem object. - olMailModule = 158 , // Represents a MailModule object. - olMarkAsTaskRuleAction = 124 , // Represents a MarkAsTaskRuleAction object. - olMeetingCancellation = 54 , // Represents a MeetingItem object that is a meeting cancellation notice. - olMeetingRequest = 53 , // Represents a MeetingItem object that is a meeting request. - olMeetingResponseNegative = 55 , // Represents a MeetingItem object that is a refusal of a meeting request. - olMeetingResponsePositive = 56 , // Represents a MeetingItem object that is an acceptance of a meeting request. - olMeetingResponseTentative = 57 , // Represents a MeetingItem object that is a tentative acceptance of a meeting request. - olMoveOrCopyRuleAction = 118 , // Represents a MoveOrCopyRuleAction object. - olNamespace = 1 , // Represents a NameSpace object. - olNavigationFolder = 167 , // Represents a NavigationFolder object. - olNavigationFolders = 166 , // Represents a NavigationFolders object. - olNavigationGroup = 165 , // Represents a NavigationGroup object. - olNavigationGroups = 164 , // Represents a NavigationGroups object. - olNavigationModule = 157 , // Represents a NavigationModule object. - olNavigationModules = 156 , // Represents a NavigationModules object. - olNewItemAlertRuleAction = 125 , // Represents a NewItemAlertRuleAction object. - olNote = 44 , // Represents a NoteItem object. - olNotesModule = 163 , // Represents a NotesModule object. - olOrderField = 144 , // Represents an OrderField object. - olOrderFields = 145 , // Represents an OrderFields object. - olOutlookBarGroup = 66 , // Represents an OutlookBarGroup object. - olOutlookBarGroups = 65 , // Represents an OutlookBarGroups object. - olOutlookBarPane = 63 , // Represents an OutlookBarPane object. - olOutlookBarShortcut = 68 , // Represents an OutlookBarShortcut object. - olOutlookBarShortcuts = 67 , // Represents an OutlookBarShortcuts object. - olOutlookBarStorage = 64 , // Represents an OutlookBarStorage object. - olPages = 36 , // Represents a Pages object. - olPanes = 62 , // Represents a Panes object. - olPlaySoundRuleAction = 123 , // Represents a PlaySoundRuleAction object. - olPost = 45 , // Represents a PostItem object. - olPropertyAccessor = 112 , // Represents a PropertyAccessor object. - olPropertyPages = 71 , // Represents a PropertyPages object. - olPropertyPageSite = 70 , // Represents a PropertyPageSite object. - olRecipient = 4 , // Represents a Recipient object. - olRecipients = 17 , // Represents a Recipients object. - olRecurrencePattern = 28 , // Represents a RecurrencePattern object. - olReminder = 101 , // Represents a Reminder object. - olReminders = 100 , // Represents a Reminders object. - olRemote = 47 , // Represents a RemoteItem object. - olReport = 46 , // Represents a ReportItem object. - olResults = 78 , // Represents a Results object. - olRow = 121 , // Represents a Row object. - olRule = 115 , // Represents a Rule object. - olRuleAction = 117 , // Represents a RuleAction object. - olRuleActions = 116 , // Represents a RuleAction object. - olRuleCondition = 127 , // Represents a RuleCondition object. - olRuleConditions = 126 , // Represents a RuleConditions object. - olRules = 114 , // Represents a Rules object. - olSearch = 77 , // Represents a Search object. - olSelection = 74 , // Represents a Selection object. - olSelectNamesDialog = 109 , // Represents a SelectNamesDialog object. - olSenderInAddressListRuleCondition = 133 , // Represents a SenderInAddressListRuleCondition object. - olSendRuleAction = 119 , // Represents a SendRuleAction object. - olSharing = 104 , // Represents a SharingItem object. - olStorageItem = 113 , // Represents a StorageItem object. - olStore = 107 , // Represents a Store object. - olStores = 108 , // Represents a Stores object. - olSyncObject = 72 , // Represents a SyncObject object. - olSyncObjects = 73 , // Represents a SyncObject object. - olTable = 120 , // Represents a Table object. - olTask = 48 , // Represents a TaskItem object. - olTaskRequest = 49 , // Represents a TaskRequestItem object. - olTaskRequestAccept = 51 , // Represents a TaskRequestAcceptItem object. - olTaskRequestDecline = 52 , // Represents a TaskRequestDeclineItem object. - olTaskRequestUpdate = 50 , // Represents a TaskRequestUpdateItem object. - olTasksModule = 161 , // Represents a TasksModule object. - olTextRuleCondition = 134 , // Represents a TextRuleCondition object. - olUserDefinedProperties = 172 , // Represents a UserDefinedProperties object. - olUserDefinedProperty = 171 , // Represents a UserDefinedProperty object. - olUserProperties = 38 , // Represents a UserProperties object. - olUserProperty = 39 , // Represents a UserProperty object. - olView = 80 , // Represents a View object. - olViewField = 142 , // Represents a ViewField object. - olViewFields = 141 , // Represents a ViewFields object. - olViewFont = 146 , // Represents a ViewFont object. - olViews = 79 // Represents a Views object. - } - - public enum OlItemType { - // Fields - olAppointmentItem = 1, - olContactItem = 2, - olDistributionListItem = 7, - olJournalItem = 4, - olMailItem = 0, - olNoteItem = 5, - olPostItem = 6, - olTaskItem = 3 - } - - public enum OlEditorType { - // Fields - olEditorHTML = 2, - olEditorRTF = 3, - olEditorText = 1, - olEditorWord = 4 - } - - public enum OlWindowState { - // Fields - olMaximized = 0, - olMinimized = 1, - olNormalWindow = 2 - } - - public enum OlInspectorClose { - // Fields - olDiscard = 1, - olPromptForSave = 2, - olSave = 0 - } - - public enum MsoTriState { - msoTrue = -1, - msoFalse = 0, - msoCTrue = 1, - msoTriStateToggle = -3, - msoTriStateMixed = -2 - } - - public enum MsoScaleFrom { - msoScaleFromTopLeft = 0, - msoScaleFromMiddle = 1, - msoScaleFromBottomRight = 2 - } - - // Schema definitions for the MAPI properties - // See: http://msdn.microsoft.com/en-us/library/aa454438.aspx - // and see: http://msdn.microsoft.com/en-us/library/bb446117.aspx - public static class PropTag { - public const string ATTACHMENT_CONTENT_ID = @"http://schemas.microsoft.com/mapi/proptag/0x3712001E"; - } -} diff --git a/Greenshot/Helpers/OfficeInterop/OutlookUtils.cs b/Greenshot/Helpers/OfficeInterop/OutlookUtils.cs deleted file mode 100644 index ca55b3403..000000000 --- a/Greenshot/Helpers/OfficeInterop/OutlookUtils.cs +++ /dev/null @@ -1,854 +0,0 @@ -/* - * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom - * - * For more information see: http://getgreenshot.org/ - * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 1 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -using System; -using System.Runtime.InteropServices; - -namespace Greenshot.Helpers.OfficeInterop { - enum PT : uint { - PT_UNSPECIFIED = 0, /* (Reserved for interface use) type doesn't matter to caller */ - PT_NULL = 1, /* NULL property value */ - PT_I2 = 2, /* Signed 16-bit value */ - PT_LONG = 3, /* Signed 32-bit value */ - PT_R4 = 4, /* 4-byte floating point */ - PT_DOUBLE = 5, /* Floating point double */ - PT_CURRENCY = 6, /* Signed 64-bit int (decimal w/ 4 digits right of decimal pt) */ - PT_APPTIME = 7, /* Application time */ - PT_ERROR = 10, /* 32-bit error value */ - PT_BOOLEAN = 11, /* 16-bit boolean (non-zero true, */ - // Use PT_BOOLEAN_DESKTOP to be specific instead of using PT_BOOLEAN which is mapped to 2 in addrmapi.h - PT_BOOLEAN_DESKTOP = 11, /* 16-bit boolean (non-zero true) */ - PT_OBJECT = 13, /* Embedded object in a property */ - PT_I8 = 20, /* 8-byte signed integer */ - PT_STRING8 = 30, /* Null terminated 8-bit character string */ - PT_UNICODE = 31, /* Null terminated Unicode string */ - PT_SYSTIME = 64, /* FILETIME 64-bit int w/ number of 100ns periods since Jan 1,1601 */ - PT_CLSID = 72, /* OLE GUID */ - PT_BINARY = 258, /* Uninterpreted (counted byte array) */ - - PT_TSTRING = PT_UNICODE - }; - - public enum PropTags : uint { - PR_ERROR = 10, - - // Common non-transmittable - PR_ENTRYID = PT.PT_BINARY | 0x0FFF << 16, - PR_OBJECT_TYPE = PT.PT_LONG | 0x0FFE << 16, - PR_ICON = PT.PT_BINARY | 0x0FFD << 16, - PR_MINI_ICON = PT.PT_BINARY | 0x0FFC << 16, - PR_STORE_ENTRYID = PT.PT_BINARY | 0x0FFB << 16, - PR_STORE_RECORD_KEY = PT.PT_BINARY | 0x0FFA << 16, - PR_RECORD_KEY = PT.PT_BINARY | 0x0FF9 << 16, - PR_MAPPING_SIGNATURE = PT.PT_BINARY | 0x0FF8 << 16, - PR_ACCESS_LEVEL = PT.PT_LONG | 0x0FF7 << 16, - PR_INSTANCE_KEY = PT.PT_BINARY | 0x0FF6 << 16, - PR_ROW_TYPE = PT.PT_LONG | 0x0FF5 << 16, - PR_ACCESS = PT.PT_LONG | 0x0FF4 << 16, - - // Common transmittable - PR_ROWID = PT.PT_LONG | 0x3000 << 16, - PR_DISPLAY_NAME = PT.PT_TSTRING | 0x3001 << 16, - PR_DISPLAY_NAME_W = PT.PT_UNICODE | 0x3001 << 16, - PR_DISPLAY_NAME_A = PT.PT_STRING8 | 0x3001 << 16, - PR_ADDRTYPE = PT.PT_TSTRING | 0x3002 << 16, - PR_ADDRTYPE_W = PT.PT_UNICODE | 0x3002 << 16, - PR_ADDRTYPE_A = PT.PT_STRING8 | 0x3002 << 16, - PR_EMAIL_ADDRESS = PT.PT_TSTRING | 0x3003 << 16, - PR_EMAIL_ADDRESS_W = PT.PT_UNICODE | 0x3003 << 16, - PR_EMAIL_ADDRESS_A = PT.PT_STRING8 | 0x3003 << 16, - PR_COMMENT = PT.PT_TSTRING | 0x3004 << 16, - PR_COMMENT_W = PT.PT_UNICODE | 0x3004 << 16, - PR_COMMENT_A = PT.PT_STRING8 | 0x3004 << 16, - PR_DEPTH = PT.PT_LONG | 0x3005 << 16, - PR_PROVIDER_DISPLAY = PT.PT_TSTRING | 0x3006 << 16, - PR_PROVIDER_DISPLAY_W = PT.PT_UNICODE | 0x3006 << 16, - PR_PROVIDER_DISPLAY_A = PT.PT_STRING8 | 0x3006 << 16, - PR_CREATION_TIME = PT.PT_SYSTIME | 0x3007 << 16, - PR_LAST_MODIFICATION_TIME = PT.PT_SYSTIME | 0x3008 << 16, - PR_RESOURCE_FLAGS = PT.PT_LONG | 0x3009 << 16, - PR_PROVIDER_DLL_NAME = PT.PT_TSTRING | 0x300A << 16, - PR_PROVIDER_DLL_NAME_W = PT.PT_UNICODE | 0x300A << 16, - PR_PROVIDER_DLL_NAME_A = PT.PT_STRING8 | 0x300A << 16, - PR_SEARCH_KEY = PT.PT_BINARY | 0x300B << 16, - PR_PROVIDER_UID = PT.PT_BINARY | 0x300C << 16, - PR_PROVIDER_ORDINAL = PT.PT_LONG | 0x300D << 16, - - // Message store specific - PR_DEFAULT_STORE = PT.PT_BOOLEAN | 0x3400 << 16, - PR_STORE_SUPPORT_MASK = PT.PT_LONG | 0x340D << 16, - PR_STORE_STATE = PT.PT_LONG | 0x340E << 16, - - PR_IPM_SUBTREE_SEARCH_KEY = PT.PT_BINARY | 0x3410 << 16, - PR_IPM_OUTBOX_SEARCH_KEY = PT.PT_BINARY | 0x3411 << 16, - PR_IPM_WASTEBASKET_SEARCH_KEY = PT.PT_BINARY | 0x3412 << 16, - PR_IPM_SENTMAIL_SEARCH_KEY = PT.PT_BINARY | 0x3413 << 16, - PR_MDB_PROVIDER = PT.PT_BINARY | 0x3414 << 16, - PR_RECEIVE_FOLDER_SETTINGS = PT.PT_OBJECT | 0x3415 << 16, - - PR_VALID_FOLDER_MASK = PT.PT_LONG | 0x35DF << 16, - PR_IPM_SUBTREE_ENTRYID = PT.PT_BINARY | 0x35E0 << 16, - - PR_IPM_OUTBOX_ENTRYID = PT.PT_BINARY | 0x35E2 << 16, - PR_IPM_WASTEBASKET_ENTRYID = PT.PT_BINARY | 0x35E3 << 16, - PR_IPM_SENTMAIL_ENTRYID = PT.PT_BINARY | 0x35E4 << 16, - PR_VIEWS_ENTRYID = PT.PT_BINARY | 0x35E5 << 16, - PR_COMMON_VIEWS_ENTRYID = PT.PT_BINARY | 0x35E6 << 16, - PR_FINDER_ENTRYID = PT.PT_BINARY | 0x35E7 << 16, - PR_ATTACH_CONTENT_ID = PT.PT_TSTRING | (0x3712 << 16), - PR_ATTACH_CONTENT_ID_A = PT.PT_STRING8 | (0x3712 << 16), - PR_ATTACH_CONTENT_ID_W = PT.PT_TSTRING | (0x3712 << 16), - PR_ATTACH_CONTENT_LOCATION = PT.PT_TSTRING | (0x3713 << 16), - PR_ATTACH_CONTENT_LOCATION_A = PT.PT_STRING8 | (0x3713 << 16), - PR_ATTACH_CONTENT_LOCATION_W = PT.PT_TSTRING | (0x3713 << 16), - - // Message non-transmittable properties - PR_CURRENT_VERSION = PT.PT_I8 | 0x0E00 << 16, - PR_DELETE_AFTER_SUBMIT = PT.PT_BOOLEAN | 0x0E01 << 16, - PR_DISPLAY_BCC = PT.PT_TSTRING | 0x0E02 << 16, - PR_DISPLAY_BCC_W = PT.PT_UNICODE | 0x0E02 << 16, - PR_DISPLAY_BCC_A = PT.PT_STRING8 | 0x0E02 << 16, - PR_DISPLAY_CC = PT.PT_TSTRING | 0x0E03 << 16, - PR_DISPLAY_CC_W = PT.PT_UNICODE | 0x0E03 << 16, - PR_DISPLAY_CC_A = PT.PT_STRING8 | 0x0E03 << 16, - PR_DISPLAY_TO = PT.PT_TSTRING | 0x0E04 << 16, - PR_DISPLAY_TO_W = PT.PT_UNICODE | 0x0E04 << 16, - PR_DISPLAY_TO_A = PT.PT_STRING8 | 0x0E04 << 16, - PR_PARENT_DISPLAY = PT.PT_TSTRING | 0x0E05 << 16, - PR_PARENT_DISPLAY_W = PT.PT_UNICODE | 0x0E05 << 16, - PR_PARENT_DISPLAY_A = PT.PT_STRING8 | 0x0E05 << 16, - PR_MESSAGE_DELIVERY_TIME = PT.PT_SYSTIME | 0x0E06 << 16, - PR_MESSAGE_FLAGS = PT.PT_LONG | 0x0E07 << 16, - PR_MESSAGE_SIZE = PT.PT_LONG | 0x0E08 << 16, - PR_PARENT_ENTRYID = PT.PT_BINARY | 0x0E09 << 16, - PR_SENTMAIL_ENTRYID = PT.PT_BINARY | 0x0E0A << 16, - PR_CORRELATE = PT.PT_BOOLEAN | 0x0E0C << 16, - PR_CORRELATE_MTSID = PT.PT_BINARY | 0x0E0D << 16, - PR_DISCRETE_VALUES = PT.PT_BOOLEAN | 0x0E0E << 16, - PR_RESPONSIBILITY = PT.PT_BOOLEAN | 0x0E0F << 16, - PR_SPOOLER_STATUS = PT.PT_LONG | 0x0E10 << 16, - PR_TRANSPORT_STATUS = PT.PT_LONG | 0x0E11 << 16, - PR_MESSAGE_RECIPIENTS = PT.PT_OBJECT | 0x0E12 << 16, - PR_MESSAGE_ATTACHMENTS = PT.PT_OBJECT | 0x0E13 << 16, - PR_SUBMIT_FLAGS = PT.PT_LONG | 0x0E14 << 16, - PR_RECIPIENT_STATUS = PT.PT_LONG | 0x0E15 << 16, - PR_TRANSPORT_KEY = PT.PT_LONG | 0x0E16 << 16, - PR_MSG_STATUS = PT.PT_LONG | 0x0E17 << 16, - PR_MESSAGE_DOWNLOAD_TIME = PT.PT_LONG | 0x0E18 << 16, - PR_CREATION_VERSION = PT.PT_I8 | 0x0E19 << 16, - PR_MODIFY_VERSION = PT.PT_I8 | 0x0E1A << 16, - PR_HASATTACH = PT.PT_BOOLEAN | 0x0E1B << 16, - PR_BODY_CRC = PT.PT_LONG | 0x0E1C << 16, - PR_NORMALIZED_SUBJECT = PT.PT_TSTRING | 0x0E1D << 16, - PR_NORMALIZED_SUBJECT_W = PT.PT_UNICODE | 0x0E1D << 16, - PR_NORMALIZED_SUBJECT_A = PT.PT_STRING8 | 0x0E1D << 16, - PR_RTF_IN_SYNC = PT.PT_BOOLEAN | 0x0E1F << 16, - PR_ATTACH_SIZE = PT.PT_LONG | 0x0E20 << 16, - PR_ATTACH_NUM = PT.PT_LONG | 0x0E21 << 16, - PR_PREPROCESS = PT.PT_BOOLEAN | 0x0E22 << 16, - - // Message recipient properties - PR_CONTENT_INTEGRITY_CHECK = PT.PT_BINARY | 0x0C00 << 16, - PR_EXPLICIT_CONVERSION = PT.PT_LONG | 0x0C01 << 16, - PR_IPM_RETURN_REQUESTED = PT.PT_BOOLEAN | 0x0C02 << 16, - PR_MESSAGE_TOKEN = PT.PT_BINARY | 0x0C03 << 16, - PR_NDR_REASON_CODE = PT.PT_LONG | 0x0C04 << 16, - PR_NDR_DIAG_CODE = PT.PT_LONG | 0x0C05 << 16, - PR_NON_RECEIPT_NOTIFICATION_REQUESTED = PT.PT_BOOLEAN | 0x0C06 << 16, - PR_DELIVERY_POINT = PT.PT_LONG | 0x0C07 << 16, - - PR_ORIGINATOR_NON_DELIVERY_REPORT_REQUESTED = PT.PT_BOOLEAN | 0x0C08 << 16, - PR_ORIGINATOR_REQUESTED_ALTERNATE_RECIPIENT = PT.PT_BINARY | 0x0C09 << 16, - PR_PHYSICAL_DELIVERY_BUREAU_FAX_DELIVERY = PT.PT_BOOLEAN | 0x0C0A << 16, - PR_PHYSICAL_DELIVERY_MODE = PT.PT_LONG | 0x0C0B << 16, - PR_PHYSICAL_DELIVERY_REPORT_REQUEST = PT.PT_LONG | 0x0C0C << 16, - PR_PHYSICAL_FORWARDING_ADDRESS = PT.PT_BINARY | 0x0C0D << 16, - PR_PHYSICAL_FORWARDING_ADDRESS_REQUESTED = PT.PT_BOOLEAN | 0x0C0E << 16, - PR_PHYSICAL_FORWARDING_PROHIBITED = PT.PT_BOOLEAN | 0x0C0F << 16, - PR_PHYSICAL_RENDITION_ATTRIBUTES = PT.PT_BINARY | 0x0C10 << 16, - PR_PROOF_OF_DELIVERY = PT.PT_BINARY | 0x0C11 << 16, - PR_PROOF_OF_DELIVERY_REQUESTED = PT.PT_BOOLEAN | 0x0C12 << 16, - PR_RECIPIENT_CERTIFICATE = PT.PT_BINARY | 0x0C13 << 16, - PR_RECIPIENT_NUMBER_FOR_ADVICE = PT.PT_TSTRING | 0x0C14 << 16, - PR_RECIPIENT_NUMBER_FOR_ADVICE_W = PT.PT_UNICODE | 0x0C14 << 16, - PR_RECIPIENT_NUMBER_FOR_ADVICE_A = PT.PT_STRING8 | 0x0C14 << 16, - PR_RECIPIENT_TYPE = PT.PT_LONG | 0x0C15 << 16, - PR_REGISTERED_MAIL_TYPE = PT.PT_LONG | 0x0C16 << 16, - PR_REPLY_REQUESTED = PT.PT_BOOLEAN | 0x0C17 << 16, - //PR_REQUESTED_DELIVERY_METHOD = PT.PT_LONG | 0x0C18 << 16, - PR_SENDER_ENTRYID = PT.PT_BINARY | 0x0C19 << 16, - PR_SENDER_NAME = PT.PT_TSTRING | 0x0C1A << 16, - PR_SENDER_NAME_W = PT.PT_UNICODE | 0x0C1A << 16, - PR_SENDER_NAME_A = PT.PT_STRING8 | 0x0C1A << 16, - PR_SUPPLEMENTARY_INFO = PT.PT_TSTRING | 0x0C1B << 16, - PR_SUPPLEMENTARY_INFO_W = PT.PT_UNICODE | 0x0C1B << 16, - PR_SUPPLEMENTARY_INFO_A = PT.PT_STRING8 | 0x0C1B << 16, - PR_TYPE_OF_MTS_USER = PT.PT_LONG | 0x0C1C << 16, - PR_SENDER_SEARCH_KEY = PT.PT_BINARY | 0x0C1D << 16, - PR_SENDER_ADDRTYPE = PT.PT_TSTRING | 0x0C1E << 16, - PR_SENDER_ADDRTYPE_W = PT.PT_UNICODE | 0x0C1E << 16, - PR_SENDER_ADDRTYPE_A = PT.PT_STRING8 | 0x0C1E << 16, - PR_SENDER_EMAIL_ADDRESS = PT.PT_TSTRING | 0x0C1F << 16, - PR_SENDER_EMAIL_ADDRESS_W = PT.PT_UNICODE | 0x0C1F << 16, - PR_SENDER_EMAIL_ADDRESS_A = PT.PT_STRING8 | 0x0C1F << 16, - - // Message envelope properties - PR_ACKNOWLEDGEMENT_MODE = PT.PT_LONG | 0x0001 << 16, - PR_ALTERNATE_RECIPIENT_ALLOWED = PT.PT_BOOLEAN | 0x0002 << 16, - PR_AUTHORIZING_USERS = PT.PT_BINARY | 0x0003 << 16, - PR_AUTO_FORWARD_COMMENT = PT.PT_TSTRING | 0x0004 << 16, - PR_AUTO_FORWARD_COMMENT_W = PT.PT_UNICODE | 0x0004 << 16, - PR_AUTO_FORWARD_COMMENT_A = PT.PT_STRING8 | 0x0004 << 16, - PR_AUTO_FORWARDED = PT.PT_BOOLEAN | 0x0005 << 16, - PR_CONTENT_CONFIDENTIALITY_ALGORITHM_ID = PT.PT_BINARY | 0x0006 << 16, - PR_CONTENT_CORRELATOR = PT.PT_BINARY | 0x0007 << 16, - PR_CONTENT_IDENTIFIER = PT.PT_TSTRING | 0x0008 << 16, - PR_CONTENT_IDENTIFIER_W = PT.PT_UNICODE | 0x0008 << 16, - PR_CONTENT_IDENTIFIER_A = PT.PT_STRING8 | 0x0008 << 16, - PR_CONTENT_LENGTH = PT.PT_LONG | 0x0009 << 16, - PR_CONTENT_RETURN_REQUESTED = PT.PT_BOOLEAN | 0x000A << 16, - - // Message envelope properties - PR_CONVERSATION_KEY = PT.PT_BINARY | 0x000B << 16, - - PR_CONVERSION_EITS = PT.PT_BINARY | 0x000C << 16, - PR_CONVERSION_WITH_LOSS_PROHIBITED = PT.PT_BOOLEAN | 0x000D << 16, - PR_CONVERTED_EITS = PT.PT_BINARY | 0x000E << 16, - PR_DEFERRED_DELIVERY_TIME = PT.PT_SYSTIME | 0x000F << 16, - PR_DELIVER_TIME = PT.PT_SYSTIME | 0x0010 << 16, - PR_DISCARD_REASON = PT.PT_LONG | 0x0011 << 16, - PR_DISCLOSURE_OF_RECIPIENTS = PT.PT_BOOLEAN | 0x0012 << 16, - PR_DL_EXPANSION_HISTORY = PT.PT_BINARY | 0x0013 << 16, - PR_DL_EXPANSION_PROHIBITED = PT.PT_BOOLEAN | 0x0014 << 16, - PR_EXPIRY_TIME = PT.PT_SYSTIME | 0x0015 << 16, - PR_IMPLICIT_CONVERSION_PROHIBITED = PT.PT_BOOLEAN | 0x0016 << 16, - PR_IMPORTANCE = PT.PT_LONG | 0x0017 << 16, - PR_IPM_ID = PT.PT_BINARY | 0x0018 << 16, - PR_LATEST_DELIVERY_TIME = PT.PT_SYSTIME | 0x0019 << 16, - PR_MESSAGE_CLASS = PT.PT_TSTRING | 0x001A << 16, - PR_MESSAGE_CLASS_W = PT.PT_UNICODE | 0x001A << 16, - PR_MESSAGE_CLASS_A = PT.PT_STRING8 | 0x001A << 16, - PR_MESSAGE_DELIVERY_ID = PT.PT_BINARY | 0x001B << 16, - - PR_MESSAGE_SECURITY_LABEL = PT.PT_BINARY | 0x001E << 16, - PR_OBSOLETED_IPMS = PT.PT_BINARY | 0x001F << 16, - PR_ORIGINALLY_INTENDED_RECIPIENT_NAME = PT.PT_BINARY | 0x0020 << 16, - PR_ORIGINAL_EITS = PT.PT_BINARY | 0x0021 << 16, - PR_ORIGINATOR_CERTIFICATE = PT.PT_BINARY | 0x0022 << 16, - PR_ORIGINATOR_DELIVERY_REPORT_REQUESTED = PT.PT_BOOLEAN | 0x0023 << 16, - PR_ORIGINATOR_RETURN_ADDRESS = PT.PT_BINARY | 0x0024 << 16, - - PR_PARENT_KEY = PT.PT_BINARY | 0x0025 << 16, - PR_PRIORITY = PT.PT_LONG | 0x0026 << 16, - - PR_ORIGIN_CHECK = PT.PT_BINARY | 0x0027 << 16, - PR_PROOF_OF_SUBMISSION_REQUESTED = PT.PT_BOOLEAN | 0x0028 << 16, - PR_READ_RECEIPT_REQUESTED = PT.PT_BOOLEAN | 0x0029 << 16, - PR_RECEIPT_TIME = PT.PT_SYSTIME | 0x002A << 16, - PR_RECIPIENT_REASSIGNMENT_PROHIBITED = PT.PT_BOOLEAN | 0x002B << 16, - PR_REDIRECTION_HISTORY = PT.PT_BINARY | 0x002C << 16, - PR_RELATED_IPMS = PT.PT_BINARY | 0x002D << 16, - PR_ORIGINAL_SENSITIVITY = PT.PT_LONG | 0x002E << 16, - PR_LANGUAGES = PT.PT_TSTRING | 0x002F << 16, - PR_LANGUAGES_W = PT.PT_UNICODE | 0x002F << 16, - PR_LANGUAGES_A = PT.PT_STRING8 | 0x002F << 16, - PR_REPLY_TIME = PT.PT_SYSTIME | 0x0030 << 16, - PR_REPORT_TAG = PT.PT_BINARY | 0x0031 << 16, - PR_REPORT_TIME = PT.PT_SYSTIME | 0x0032 << 16, - PR_RETURNED_IPM = PT.PT_BOOLEAN | 0x0033 << 16, - PR_SECURITY = PT.PT_LONG | 0x0034 << 16, - PR_INCOMPLETE_COPY = PT.PT_BOOLEAN | 0x0035 << 16, - PR_SENSITIVITY = PT.PT_LONG | 0x0036 << 16, - PR_SUBJECT = PT.PT_TSTRING | 0x0037 << 16, - PR_SUBJECT_W = PT.PT_UNICODE | 0x0037 << 16, - PR_SUBJECT_A = PT.PT_STRING8 | 0x0037 << 16, - PR_SUBJECT_IPM = PT.PT_BINARY | 0x0038 << 16, - PR_CLIENT_SUBMIT_TIME = PT.PT_SYSTIME | 0x0039 << 16, - PR_REPORT_NAME = PT.PT_TSTRING | 0x003A << 16, - PR_REPORT_NAME_W = PT.PT_UNICODE | 0x003A << 16, - PR_REPORT_NAME_A = PT.PT_STRING8 | 0x003A << 16, - PR_SENT_REPRESENTING_SEARCH_KEY = PT.PT_BINARY | 0x003B << 16, - PR_X400_CONTENT_TYPE = PT.PT_BINARY | 0x003C << 16, - PR_SUBJECT_PREFIX = PT.PT_TSTRING | 0x003D << 16, - PR_SUBJECT_PREFIX_W = PT.PT_UNICODE | 0x003D << 16, - PR_SUBJECT_PREFIX_A = PT.PT_STRING8 | 0x003D << 16, - PR_NON_RECEIPT_REASON = PT.PT_LONG | 0x003E << 16, - PR_RECEIVED_BY_ENTRYID = PT.PT_BINARY | 0x003F << 16, - PR_RECEIVED_BY_NAME = PT.PT_TSTRING | 0x0040 << 16, - PR_RECEIVED_BY_NAME_W = PT.PT_UNICODE | 0x0040 << 16, - PR_RECEIVED_BY_NAME_A = PT.PT_STRING8 | 0x0040 << 16, - PR_SENT_REPRESENTING_ENTRYID = PT.PT_BINARY | 0x0041 << 16, - PR_SENT_REPRESENTING_NAME = PT.PT_TSTRING | 0x0042 << 16, - PR_SENT_REPRESENTING_NAME_W = PT.PT_UNICODE | 0x0042 << 16, - PR_SENT_REPRESENTING_NAME_A = PT.PT_STRING8 | 0x0042 << 16, - PR_RCVD_REPRESENTING_ENTRYID = PT.PT_BINARY | 0x0043 << 16, - PR_RCVD_REPRESENTING_NAME = PT.PT_TSTRING | 0x0044 << 16, - PR_RCVD_REPRESENTING_NAME_W = PT.PT_UNICODE | 0x0044 << 16, - PR_RCVD_REPRESENTING_NAME_A = PT.PT_STRING8 | 0x0044 << 16, - PR_REPORT_ENTRYID = PT.PT_BINARY | 0x0045 << 16, - PR_READ_RECEIPT_ENTRYID = PT.PT_BINARY | 0x0046 << 16, - PR_MESSAGE_SUBMISSION_ID = PT.PT_BINARY | 0x0047 << 16, - PR_PROVIDER_SUBMIT_TIME = PT.PT_SYSTIME | 0x0048 << 16, - PR_ORIGINAL_SUBJECT = PT.PT_TSTRING | 0x0049 << 16, - PR_ORIGINAL_SUBJECT_W = PT.PT_UNICODE | 0x0049 << 16, - PR_ORIGINAL_SUBJECT_A = PT.PT_STRING8 | 0x0049 << 16, - PR_DISC_VAL = PT.PT_BOOLEAN | 0x004A << 16, - PR_ORIG_MESSAGE_CLASS = PT.PT_TSTRING | 0x004B << 16, - PR_ORIG_MESSAGE_CLASS_W = PT.PT_UNICODE | 0x004B << 16, - PR_ORIG_MESSAGE_CLASS_A = PT.PT_STRING8 | 0x004B << 16, - PR_ORIGINAL_AUTHOR_ENTRYID = PT.PT_BINARY | 0x004C << 16, - PR_ORIGINAL_AUTHOR_NAME = PT.PT_TSTRING | 0x004D << 16, - PR_ORIGINAL_AUTHOR_NAME_W = PT.PT_UNICODE | 0x004D << 16, - PR_ORIGINAL_AUTHOR_NAME_A = PT.PT_STRING8 | 0x004D << 16, - PR_ORIGINAL_SUBMIT_TIME = PT.PT_SYSTIME | 0x004E << 16, - PR_REPLY_RECIPIENT_ENTRIES = PT.PT_BINARY | 0x004F << 16, - PR_REPLY_RECIPIENT_NAMES = PT.PT_TSTRING | 0x0050 << 16, - PR_REPLY_RECIPIENT_NAMES_W = PT.PT_UNICODE | 0x0050 << 16, - PR_REPLY_RECIPIENT_NAMES_A = PT.PT_STRING8 | 0x0050 << 16, - - PR_RECEIVED_BY_SEARCH_KEY = PT.PT_BINARY | 0x0051 << 16, - PR_RCVD_REPRESENTING_SEARCH_KEY = PT.PT_BINARY | 0x0052 << 16, - PR_READ_RECEIPT_SEARCH_KEY = PT.PT_BINARY | 0x0053 << 16, - PR_REPORT_SEARCH_KEY = PT.PT_BINARY | 0x0054 << 16, - PR_ORIGINAL_DELIVERY_TIME = PT.PT_SYSTIME | 0x0055 << 16, - PR_ORIGINAL_AUTHOR_SEARCH_KEY = PT.PT_BINARY | 0x0056 << 16, - - PR_MESSAGE_TO_ME = PT.PT_BOOLEAN | 0x0057 << 16, - PR_MESSAGE_CC_ME = PT.PT_BOOLEAN | 0x0058 << 16, - PR_MESSAGE_RECIP_ME = PT.PT_BOOLEAN | 0x0059 << 16, - - PR_ORIGINAL_SENDER_NAME = PT.PT_TSTRING | 0x005A << 16, - PR_ORIGINAL_SENDER_NAME_W = PT.PT_UNICODE | 0x005A << 16, - PR_ORIGINAL_SENDER_NAME_A = PT.PT_STRING8 | 0x005A << 16, - PR_ORIGINAL_SENDER_ENTRYID = PT.PT_BINARY | 0x005B << 16, - PR_ORIGINAL_SENDER_SEARCH_KEY = PT.PT_BINARY | 0x005C << 16, - PR_ORIGINAL_SENT_REPRESENTING_NAME = PT.PT_TSTRING | 0x005D << 16, - PR_ORIGINAL_SENT_REPRESENTING_NAME_W = PT.PT_UNICODE | 0x005D << 16, - PR_ORIGINAL_SENT_REPRESENTING_NAME_A = PT.PT_STRING8 | 0x005D << 16, - PR_ORIGINAL_SENT_REPRESENTING_ENTRYID = PT.PT_BINARY | 0x005E << 16, - PR_ORIGINAL_SENT_REPRESENTING_SEARCH_KEY = PT.PT_BINARY | 0x005F << 16, - - PR_START_DATE = PT.PT_SYSTIME | 0x0060 << 16, - PR_END_DATE = PT.PT_SYSTIME | 0x0061 << 16, - PR_OWNER_APPT_ID = PT.PT_LONG | 0x0062 << 16, - //PR_RESPONSE_REQUESTED = PT.PT_BOOLEAN | 0x0063 << 16, - - PR_SENT_REPRESENTING_ADDRTYPE = PT.PT_TSTRING | 0x0064 << 16, - PR_SENT_REPRESENTING_ADDRTYPE_W = PT.PT_UNICODE | 0x0064 << 16, - PR_SENT_REPRESENTING_ADDRTYPE_A = PT.PT_STRING8 | 0x0064 << 16, - PR_SENT_REPRESENTING_EMAIL_ADDRESS = PT.PT_TSTRING | 0x0065 << 16, - PR_SENT_REPRESENTING_EMAIL_ADDRESS_W = PT.PT_UNICODE | 0x0065 << 16, - PR_SENT_REPRESENTING_EMAIL_ADDRESS_A = PT.PT_STRING8 | 0x0065 << 16, - - PR_ORIGINAL_SENDER_ADDRTYPE = PT.PT_TSTRING | 0x0066 << 16, - PR_ORIGINAL_SENDER_ADDRTYPE_W = PT.PT_UNICODE | 0x0066 << 16, - PR_ORIGINAL_SENDER_ADDRTYPE_A = PT.PT_STRING8 | 0x0066 << 16, - PR_ORIGINAL_SENDER_EMAIL_ADDRESS = PT.PT_TSTRING | 0x0067 << 16, - PR_ORIGINAL_SENDER_EMAIL_ADDRESS_W = PT.PT_UNICODE | 0x0067 << 16, - PR_ORIGINAL_SENDER_EMAIL_ADDRESS_A = PT.PT_STRING8 | 0x0067 << 16, - - PR_ORIGINAL_SENT_REPRESENTING_ADDRTYPE = PT.PT_TSTRING | 0x0068 << 16, - PR_ORIGINAL_SENT_REPRESENTING_ADDRTYPE_W = PT.PT_UNICODE | 0x0068 << 16, - PR_ORIGINAL_SENT_REPRESENTING_ADDRTYPE_A = PT.PT_STRING8 | 0x0068 << 16, - PR_ORIGINAL_SENT_REPRESENTING_EMAIL_ADDRESS = PT.PT_TSTRING | 0x0069 << 16, - PR_ORIGINAL_SENT_REPRESENTING_EMAIL_ADDRESS_W = PT.PT_UNICODE | 0x0069 << 16, - PR_ORIGINAL_SENT_REPRESENTING_EMAIL_ADDRESS_A = PT.PT_STRING8 | 0x0069 << 16, - - PR_CONVERSATION_TOPIC = PT.PT_TSTRING | 0x0070 << 16, - PR_CONVERSATION_TOPIC_W = PT.PT_UNICODE | 0x0070 << 16, - PR_CONVERSATION_TOPIC_A = PT.PT_STRING8 | 0x0070 << 16, - PR_CONVERSATION_INDEX = PT.PT_BINARY | 0x0071 << 16, - - PR_ORIGINAL_DISPLAY_BCC = PT.PT_TSTRING | 0x0072 << 16, - PR_ORIGINAL_DISPLAY_BCC_W = PT.PT_UNICODE | 0x0072 << 16, - PR_ORIGINAL_DISPLAY_BCC_A = PT.PT_STRING8 | 0x0072 << 16, - PR_ORIGINAL_DISPLAY_CC = PT.PT_TSTRING | 0x0073 << 16, - PR_ORIGINAL_DISPLAY_CC_W = PT.PT_UNICODE | 0x0073 << 16, - PR_ORIGINAL_DISPLAY_CC_A = PT.PT_STRING8 | 0x0073 << 16, - PR_ORIGINAL_DISPLAY_TO = PT.PT_TSTRING | 0x0074 << 16, - PR_ORIGINAL_DISPLAY_TO_W = PT.PT_UNICODE | 0x0074 << 16, - PR_ORIGINAL_DISPLAY_TO_A = PT.PT_STRING8 | 0x0074 << 16, - - PR_RECEIVED_BY_ADDRTYPE = PT.PT_TSTRING | 0x0075 << 16, - PR_RECEIVED_BY_ADDRTYPE_W = PT.PT_UNICODE | 0x0075 << 16, - PR_RECEIVED_BY_ADDRTYPE_A = PT.PT_STRING8 | 0x0075 << 16, - PR_RECEIVED_BY_EMAIL_ADDRESS = PT.PT_TSTRING | 0x0076 << 16, - PR_RECEIVED_BY_EMAIL_ADDRESS_W = PT.PT_UNICODE | 0x0076 << 16, - PR_RECEIVED_BY_EMAIL_ADDRESS_A = PT.PT_STRING8 | 0x0076 << 16, - - PR_RCVD_REPRESENTING_ADDRTYPE = PT.PT_TSTRING | 0x0077 << 16, - PR_RCVD_REPRESENTING_ADDRTYPE_W = PT.PT_UNICODE | 0x0077 << 16, - PR_RCVD_REPRESENTING_ADDRTYPE_A = PT.PT_STRING8 | 0x0077 << 16, - PR_RCVD_REPRESENTING_EMAIL_ADDRESS = PT.PT_TSTRING | 0x0078 << 16, - PR_RCVD_REPRESENTING_EMAIL_ADDRESS_W = PT.PT_UNICODE | 0x0078 << 16, - PR_RCVD_REPRESENTING_EMAIL_ADDRESS_A = PT.PT_STRING8 | 0x0078 << 16, - - PR_ORIGINAL_AUTHOR_ADDRTYPE = PT.PT_TSTRING | 0x0079 << 16, - PR_ORIGINAL_AUTHOR_ADDRTYPE_W = PT.PT_UNICODE | 0x0079 << 16, - PR_ORIGINAL_AUTHOR_ADDRTYPE_A = PT.PT_STRING8 | 0x0079 << 16, - PR_ORIGINAL_AUTHOR_EMAIL_ADDRESS = PT.PT_TSTRING | 0x007A << 16, - PR_ORIGINAL_AUTHOR_EMAIL_ADDRESS_W = PT.PT_UNICODE | 0x007A << 16, - PR_ORIGINAL_AUTHOR_EMAIL_ADDRESS_A = PT.PT_STRING8 | 0x007A << 16, - - PR_ORIGINALLY_INTENDED_RECIP_ADDRTYPE = PT.PT_TSTRING | 0x007B << 16, - PR_ORIGINALLY_INTENDED_RECIP_ADDRTYPE_W = PT.PT_UNICODE | 0x007B << 16, - PR_ORIGINALLY_INTENDED_RECIP_ADDRTYPE_A = PT.PT_STRING8 | 0x007B << 16, - PR_ORIGINALLY_INTENDED_RECIP_EMAIL_ADDRESS = PT.PT_TSTRING | 0x007C << 16, - PR_ORIGINALLY_INTENDED_RECIP_EMAIL_ADDRESS_W = PT.PT_UNICODE | 0x007C << 16, - PR_ORIGINALLY_INTENDED_RECIP_EMAIL_ADDRESS_A = PT.PT_STRING8 | 0x007C << 16, - - PR_TRANSPORT_MESSAGE_HEADERS = PT.PT_TSTRING | 0x007D << 16, - PR_TRANSPORT_MESSAGE_HEADERS_W = PT.PT_UNICODE | 0x007D << 16, - PR_TRANSPORT_MESSAGE_HEADERS_A = PT.PT_STRING8 | 0x007D << 16, - - PR_DELEGATION = PT.PT_BINARY | 0x007E << 16, - - PR_TNEF_CORRELATION_KEY = PT.PT_BINARY | 0x007F << 16, - - // Message content properties - PR_BODY = PT.PT_TSTRING | 0x1000 << 16, - PR_BODY_W = PT.PT_UNICODE | 0x1000 << 16, - PR_BODY_A = PT.PT_STRING8 | 0x1000 << 16, - PR_REPORT_TEXT = PT.PT_TSTRING | 0x1001 << 16, - PR_REPORT_TEXT_W = PT.PT_UNICODE | 0x1001 << 16, - PR_REPORT_TEXT_A = PT.PT_STRING8 | 0x1001 << 16, - PR_ORIGINATOR_AND_DL_EXPANSION_HISTORY = PT.PT_BINARY | 0x1002 << 16, - PR_REPORTING_DL_NAME = PT.PT_BINARY | 0x1003 << 16, - PR_REPORTING_MTA_CERTIFICATE = PT.PT_BINARY | 0x1004 << 16, - }; - - public class OutlookUtils { - private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(OutlookUtils)); - private const uint KEEP_OPEN_READONLY = 0x00000001; - private const uint KEEP_OPEN_READWRITE = 0x00000002; - private const uint FORCE_SAVE = 0x00000004; - - #region MAPI Interface ID'S - // The Interface ID's are used to retrieve the specific MAPI Interfaces from the IUnknown Object - public const string IID_IMAPISession = "00020300-0000-0000-C000-000000000046"; - public const string IID_IMAPIProp = "00020303-0000-0000-C000-000000000046"; - public const string IID_IMAPITable = "00020301-0000-0000-C000-000000000046"; - public const string IID_IMAPIMsgStore = "00020306-0000-0000-C000-000000000046"; - public const string IID_IMAPIFolder = "0002030C-0000-0000-C000-000000000046"; - public const string IID_IMAPISpoolerService = "0002031E-0000-0000-C000-000000000046"; - public const string IID_IMAPIStatus = "0002031E-0000-0000-C000-000000000046"; - public const string IID_IMessage = "00020307-0000-0000-C000-000000000046"; - public const string IID_IAddrBook = "00020309-0000-0000-C000-000000000046"; - public const string IID_IProfSect = "00020304-0000-0000-C000-000000000046"; - public const string IID_IMAPIContainer = "0002030B-0000-0000-C000-000000000046"; - public const string IID_IABContainer = "0002030D-0000-0000-C000-000000000046"; - public const string IID_IMsgServiceAdmin = "0002031D-0000-0000-C000-000000000046"; - public const string IID_IProfAdmin = "0002031C-0000-0000-C000-000000000046"; - public const string IID_IMailUser = "0002030A-0000-0000-C000-000000000046"; - public const string IID_IDistList = "0002030E-0000-0000-C000-000000000046"; - public const string IID_IAttachment = "00020308-0000-0000-C000-000000000046"; - public const string IID_IMAPIControl = "0002031B-0000-0000-C000-000000000046"; - public const string IID_IMAPILogonRemote = "00020346-0000-0000-C000-000000000046"; - public const string IID_IMAPIForm = "00020327-0000-0000-C000-000000000046"; - #endregion - - [ComVisible(false)] - [ComImport()] - [Guid(IID_IMAPIProp)] - [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)] - interface IMessage : IMAPIProp { - [return: MarshalAs(UnmanagedType.I4)] - [PreserveSig] - int GetAttachmentTable(); - [return: MarshalAs(UnmanagedType.I4)] - [PreserveSig] - int OpenAttach(); - [return: MarshalAs(UnmanagedType.I4)] - [PreserveSig] - int CreateAttach(); - [return: MarshalAs(UnmanagedType.I4)] - [PreserveSig] - int DeleteAttach(); - [return: MarshalAs(UnmanagedType.I4)] - [PreserveSig] - int GetRecipientTable(); - [return: MarshalAs(UnmanagedType.I4)] - [PreserveSig] - int ModifyRecipients(); - [return: MarshalAs(UnmanagedType.I4)] - [PreserveSig] - int SubmitMessage(); - [return: MarshalAs(UnmanagedType.I4)] - [PreserveSig] - int SetReadFlag(); - } -// [ComVisible(false)] -// [ComImport()] -// [Guid(IID_IMAPIFolder)] -// [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)] -// interface IMAPIFolder : IMAPIContainer { -// [return: MarshalAs(UnmanagedType.I4)] -// [PreserveSig] -// int CreateMessage(IntPtr interf, uint uFlags, [MarshalAs(UnmanagedType.Interface)] ref IMessage pMsg); -// [return: MarshalAs(UnmanagedType.I4)] -// [PreserveSig] -// int CopyMessages(); -// [return: MarshalAs(UnmanagedType.I4)] -// [PreserveSig] -// int CreateFolder(); -// [return: MarshalAs(UnmanagedType.I4)] -// [PreserveSig] -// int CopyFolder(); -// [return: MarshalAs(UnmanagedType.I4)] -// [PreserveSig] -// int DeleteFolder(); -// [return: MarshalAs(UnmanagedType.I4)] -// [PreserveSig] -// int SetReadFlags(); -// [return: MarshalAs(UnmanagedType.I4)] -// [PreserveSig] -// int GetMessageStatus(); -// [return: MarshalAs(UnmanagedType.I4)] -// [PreserveSig] -// int SetMessageStatus(); -// [return: MarshalAs(UnmanagedType.I4)] -// [PreserveSig] -// int SaveContentsSort(); -// [return: MarshalAs(UnmanagedType.I4)] -// [PreserveSig] -// int EmptyFolder(); -// } -// [ComVisible(false)] -// [ComImport()] -// [Guid(IID_IMAPIContainer)] -// [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)] -// interface IMAPIContainer : IMAPIProp { -// [return: MarshalAs(UnmanagedType.I4)] -// [PreserveSig] -// int GetContentsTable(uint uFlags, [MarshalAs(UnmanagedType.Interface), Out] out outlook.Table tbl); -// [return: MarshalAs(UnmanagedType.I4)] -// [PreserveSig] -// int GetHierarchyTable(); -// [return: MarshalAs(UnmanagedType.I4)] -// [PreserveSig] -// int OpenEntry(); -// [return: MarshalAs(UnmanagedType.I4)] -// [PreserveSig] -// int SetSearchCriteria(); -// [return: MarshalAs(UnmanagedType.I4)] -// [PreserveSig] -// int GetSearchCriteria(); -// } - - [ComVisible(false)] - [ComImport()] - [Guid(IID_IMAPIProp)] - [InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)] - interface IMAPIProp { - [return: MarshalAs(UnmanagedType.I4)] - [PreserveSig] - int GetLastError(); - [return: MarshalAs(UnmanagedType.I4)] - [PreserveSig] - int SaveChanges( - uint uFlags - ); - [return: MarshalAs(UnmanagedType.I4)] - [PreserveSig] - int GetProps(); - [return: MarshalAs(UnmanagedType.I4)] - [PreserveSig] - int GetPropList(); - [return: MarshalAs(UnmanagedType.I4)] - [PreserveSig] - int OpenProperty(); - [return: MarshalAs(UnmanagedType.I4)] - [PreserveSig] - int SetProps(uint values, IntPtr propArray, IntPtr problems); - [return: MarshalAs(UnmanagedType.I4)] - [PreserveSig] - int DeleteProps(); - [return: MarshalAs(UnmanagedType.I4)] - [PreserveSig] - int CopyTo(); - [return: MarshalAs(UnmanagedType.I4)] - [PreserveSig] - int CopyProps(); - [return: MarshalAs(UnmanagedType.I4)] - [PreserveSig] - int GetNamesFromIDs(); - [return: MarshalAs(UnmanagedType.I4)] - [PreserveSig] - int GetIDsFromNames(); - } - - [StructLayout(LayoutKind.Explicit)] - private struct SPropValue { - [FieldOffset(0)] - public uint propTag; - [FieldOffset(4)] - public uint alignPad; - [FieldOffset(8)] - public IntPtr Value; - [FieldOffset(8)] - public long filler; - } - - /// - /// Use MAPI32.DLL "HrGetOneProp" from managed code - /// - /// - /// - /// - public static string GetMAPIProperty(Attachment attachment, PropTags proptag) { - object mapiObject = attachment.MAPIOBJECT; - if (mapiObject == null) { - return ""; - } - - string sProperty = ""; - IntPtr pPropValue = IntPtr.Zero; - - IntPtr IUnknown = IntPtr.Zero; - IntPtr IMAPIProperty = IntPtr.Zero; - - try { - MAPIInitialize(IntPtr.Zero); - IUnknown = Marshal.GetIUnknownForObject(mapiObject); - Guid guidMAPIProp = new Guid(IID_IMAPIProp); - if (Marshal.QueryInterface(IUnknown, ref guidMAPIProp, out IMAPIProperty) != 0) { - return ""; - } - try { - HrGetOneProp(IMAPIProperty, (uint)proptag, out pPropValue); - if (pPropValue == IntPtr.Zero) { - return ""; - } - SPropValue propValue = (SPropValue)Marshal.PtrToStructure(pPropValue, typeof(SPropValue)); - sProperty = Marshal.PtrToStringUni(propValue.Value); - } catch (System.Exception ex) { - throw ex; - } - } finally { - if (pPropValue != IntPtr.Zero) { - MAPIFreeBuffer(pPropValue); - } - if (IMAPIProperty != IntPtr.Zero) { - Marshal.Release(IMAPIProperty); - } - if (IUnknown != IntPtr.Zero) { - Marshal.Release(IUnknown); - } - MAPIUninitialize(); - } - return sProperty; - } - - /// - /// Tries to save the changes we just made - /// - /// - /// - public static bool SaveChanges(Item mailItem) { - // Pointer to IUnknown Interface - IntPtr IUnknown = IntPtr.Zero; - // Pointer to IMAPIProp Interface - IntPtr IMAPIProp = IntPtr.Zero; - // if we have no MAPIObject everything is senseless... - if (mailItem == null) { - return false; - } - - try { - // We can pass NULL here as parameter, so we do it. - MAPIInitialize(IntPtr.Zero); - - // retrive the IUnknon Interface from our MAPIObject comming from Outlook. - IUnknown = Marshal.GetIUnknownForObject(mailItem.MAPIOBJECT); - - // create a Guid that we pass to retreive the IMAPIProp Interface. - Guid guidIMAPIProp = new Guid(IID_IMAPIProp); - - // try to retrieve the IMAPIProp interface from IMessage Interface, everything else is sensless. - if ( Marshal.QueryInterface(IUnknown, ref guidIMAPIProp, out IMAPIProp) != 0) { - return false; - } - IMAPIProp mapiProp = (IMAPIProp)Marshal.GetTypedObjectForIUnknown(IUnknown, typeof(IMAPIProp)); - return (mapiProp.SaveChanges(KEEP_OPEN_READWRITE) == 0); - } catch (Exception ex) { - LOG.Error(ex); - return false; - } finally { - // cleanup all references to COM Objects - if (IMAPIProp != IntPtr.Zero) Marshal.Release(IMAPIProp); - //if (IMessage != IntPtr.Zero) Marshal.Release(IMessage); - if (IUnknown != IntPtr.Zero) Marshal.Release(IUnknown); - } - } - - /// - /// Uses the IMAPIPROP.SetProps to set the content ID - /// - /// - /// - public static void SetContentID(Attachment attachment, string contentId) { - // Pointer to IUnknown Interface - IntPtr IUnknown = IntPtr.Zero; - // Pointer to IMAPIProp Interface - IntPtr IMAPIProp = IntPtr.Zero; - // A pointer that points to the SPropValue structure - IntPtr ptrPropValue = IntPtr.Zero; - // Structure that will hold the Property Value - SPropValue propValue; - // if we have no MAPIObject everything is senseless... - if (attachment == null) { - return; - } - - try { - // We can pass NULL here as parameter, so we do it. - MAPIInitialize(IntPtr.Zero); - - // retrive the IUnknon Interface from our MAPIObject comming from Outlook. - IUnknown = Marshal.GetIUnknownForObject(attachment.MAPIOBJECT); - IMAPIProp mapiProp = (IMAPIProp)Marshal.GetTypedObjectForIUnknown(IUnknown, typeof(IMAPIProp)); - - // Create structure - propValue = new SPropValue(); - propValue.propTag = (uint)PropTags.PR_ATTACH_CONTENT_ID; - //propValue.propTag = 0x3712001E; - // Create Ansi string - propValue.Value = Marshal.StringToHGlobalUni(contentId); - - // Create unmanaged memory for structure - ptrPropValue = Marshal.AllocHGlobal(Marshal.SizeOf(propValue)); - // Copy structure to unmanged memory - Marshal.StructureToPtr(propValue, ptrPropValue, false); - mapiProp.SetProps(1, ptrPropValue, IntPtr.Zero); - - propValue.propTag = (uint)PropTags.PR_ATTACH_CONTENT_LOCATION; - // Copy structure to unmanged memory - Marshal.StructureToPtr(propValue, ptrPropValue, false); - mapiProp.SetProps(1, ptrPropValue, IntPtr.Zero); - - - // Free string - Marshal.FreeHGlobal(propValue.Value); - mapiProp.SaveChanges(KEEP_OPEN_READWRITE); - } catch (Exception ex) { - LOG.Error(ex); - } finally { - // Free used Memory structures - if (ptrPropValue != IntPtr.Zero) Marshal.FreeHGlobal(ptrPropValue); - // cleanup all references to COM Objects - if (IMAPIProp != IntPtr.Zero) Marshal.Release(IMAPIProp); - //if (IMessage != IntPtr.Zero) Marshal.Release(IMessage); - if (IUnknown != IntPtr.Zero) Marshal.Release(IUnknown); - } - } - - /// - /// Use MAPI32.DLL "HrSetOneProp" from managed code - /// - /// - /// - /// - /// - public static bool SetMAPIProperty(Attachment attachment, PropTags proptag, string propertyValue) { - // Pointer to IUnknown Interface - IntPtr IUnknown = IntPtr.Zero; - // Pointer to IMAPIProp Interface - IntPtr IMAPIProp = IntPtr.Zero; - // Structure that will hold the Property Value - SPropValue propValue; - // A pointer that points to the SPropValue structure - IntPtr ptrPropValue = IntPtr.Zero; - object mapiObject = attachment.MAPIOBJECT; - // if we have no MAPIObject everything is senseless... - if (mapiObject == null) { - return false; - } - - try { - // We can pass NULL here as parameter, so we do it. - MAPIInitialize(IntPtr.Zero); - - // retrive the IUnknon Interface from our MAPIObject comming from Outlook. - IUnknown = Marshal.GetIUnknownForObject(mapiObject); - - // create a Guid that we pass to retreive the IMAPIProp Interface. - Guid guidIMAPIProp = new Guid(IID_IMAPIProp); - - // try to retrieve the IMAPIProp interface from IMessage Interface, everything else is sensless. - if ( Marshal.QueryInterface(IUnknown, ref guidIMAPIProp, out IMAPIProp) != 0) { - return false; - } - - // double check, if we wave no pointer, exit... - if (IMAPIProp == IntPtr.Zero) { - return false; - } - - // Create structure - propValue = new SPropValue(); - propValue.propTag = (uint)proptag; - // Create Ansi string - propValue.Value = Marshal.StringToHGlobalUni(propertyValue); - - // Create unmanaged memory for structure - ptrPropValue = Marshal.AllocHGlobal(Marshal.SizeOf(propValue)); - // Copy structure to unmanged memory - Marshal.StructureToPtr(propValue, ptrPropValue, false); - - // Set the property - HrSetOneProp(IMAPIProp, ptrPropValue); - - // Free string - Marshal.FreeHGlobal(propValue.Value); - IMAPIProp mapiProp = (IMAPIProp)Marshal.GetTypedObjectForIUnknown(IUnknown, typeof(IMAPIProp)); - return mapiProp.SaveChanges(4) == 0; - } catch (System.Exception ex) { - LOG.Error(ex); - return false; - } finally { - // Free used Memory structures - if (ptrPropValue != IntPtr.Zero) Marshal.FreeHGlobal(ptrPropValue); - // cleanup all references to COM Objects - if (IMAPIProp != IntPtr.Zero) Marshal.Release(IMAPIProp); - //if (IMessage != IntPtr.Zero) Marshal.Release(IMessage); - if (IUnknown != IntPtr.Zero) Marshal.Release(IUnknown); - MAPIUninitialize(); - } - } - - #region MAPI DLL Imports - - [DllImport("MAPI32.DLL", CharSet = CharSet.Ansi, EntryPoint = "HrGetOneProp@12")] - private static extern void HrGetOneProp(IntPtr pmp, uint ulPropTag, out IntPtr ppProp); - - [DllImport("MAPI32.DLL", CharSet = CharSet.Ansi, EntryPoint = "HrSetOneProp@8")] - private static extern void HrSetOneProp(IntPtr pmp, IntPtr pprop); - - [DllImport("MAPI32.DLL", CharSet = CharSet.Ansi, EntryPoint = "MAPIFreeBuffer@4")] - private static extern void MAPIFreeBuffer(IntPtr lpBuffer); - - [DllImport("MAPI32.DLL", CharSet = CharSet.Ansi)] - private static extern int MAPIInitialize(IntPtr lpMapiInit); - - [DllImport("MAPI32.DLL", CharSet = CharSet.Ansi)] - private static extern void MAPIUninitialize(); - #endregion - } -} diff --git a/Greenshot/Helpers/OfficeInterop/OutlookWrapper.cs b/Greenshot/Helpers/OfficeInterop/OutlookWrapper.cs deleted file mode 100644 index 0df31a676..000000000 --- a/Greenshot/Helpers/OfficeInterop/OutlookWrapper.cs +++ /dev/null @@ -1,510 +0,0 @@ -/* - * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom - * - * For more information see: http://getgreenshot.org/ - * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 1 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -using System; -using System.Collections; -using System.Collections.Generic; -using System.IO; -using System.Text; -using System.Text.RegularExpressions; -using System.Threading; - -using Greenshot.Helpers.IEInterop; -using Greenshot.Interop; -using Greenshot.Plugin; -using GreenshotPlugin.Core; -using IniFile; -using Microsoft.Win32; - -/// -/// This utils class should help setting the content-id on the attachment for Outlook < 2007 -/// But this somehow doesn't work yet -/// -namespace Greenshot.Helpers.OfficeInterop { - /// - /// Wrapper for Outlook.Application, see: http://msdn.microsoft.com/en-us/library/aa210897%28v=office.11%29.aspx - /// - [ComProgId("Outlook.Application")] - public interface IOutlookApplication : Common { - string Name { get; } - string Version { get; } - Item CreateItem(OlItemType ItemType); - object CreateItemFromTemplate(string TemplatePath, object InFolder); - object CreateObject(string ObjectName); - Inspector ActiveInspector(); - Inspectors Inspectors { get; } - INameSpace GetNameSpace(string type); - } - - public interface INameSpace : Common { - IRecipient CurrentUser { get; } - } - - public interface IRecipient : Common { - string Name { get; } - } - - // See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.outlook.inspector_members.aspx - public interface Inspector : Common { - Item CurrentItem { get; } - OlEditorType EditorType { get; } - object ModifiedFormPages { get; } - void Close(OlInspectorClose SaveMode); - void Display(object Modal); - void HideFormPage(string PageName); - bool IsWordMail(); - void SetCurrentFormPage(string PageName); - void ShowFormPage(string PageName); - object HTMLEditor { get; } - IWordDocument WordEditor { get; } - string Caption { get; } - int Height { get; set; } - int Left { get; set; } - int Top { get; set; } - int Width { get; set; } - OlWindowState WindowState { get; set; } - void Activate(); - void SetControlItemProperty(object Control, string PropertyName); - } - - // See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.outlook._application.inspectors.aspx - public interface Inspectors : Common, Collection, IEnumerable { - Inspector this[Object Index] { get; } - } - - /// - /// Outlook exporter has all the functionality to export to outlook - /// - public class OutlookExporter { - private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(OutlookExporter)); - private static CoreConfiguration conf = IniConfig.GetIniSection(); - private static readonly string SIGNATURE_PATH = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), @"Microsoft\Signatures"); - private static Version outlookVersion = new Version(1,1,1,1); - private static string currentUser = null; - - // The signature key can be found at: - // HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\\9375CFF0413111d3B88A00104B2A6676\ [New Signature] - private const string PROFILES_KEY = @"Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\"; - private const string ACCOUNT_KEY = "9375CFF0413111d3B88A00104B2A6676"; - private const string NEW_SIGNATURE_VALUE = "New Signature"; - private const string DEFAULT_PROFILE_VALUE = "DefaultProfile"; - - /// - /// A method to retrieve all inspectors which can act as an export target - /// - /// IOutlookApplication - /// List with inspector captions (window title) - public static Dictionary RetrievePossibleTargets() { - Dictionary inspectorCaptions = new Dictionary(); - try { - using ( IOutlookApplication outlookApplication = GetOutlookApplication()) { - if (outlookApplication == null) { - return null; - } - - Inspectors inspectors = outlookApplication.Inspectors; - if (inspectors != null && inspectors.Count > 0) { - for(int i=1; i <= inspectors.Count; i++) { - Inspector inspector = outlookApplication.Inspectors[i]; - if (canExportToInspector(inspector)) { - Item currentItem = inspector.CurrentItem; - OlObjectClass currentItemClass = currentItem.Class; - inspectorCaptions.Add(inspector.Caption, currentItemClass); - } - } - } - } - } catch (Exception ex) { - LOG.Warn("Problem retrieving word destinations, ignoring: ", ex); - } - return inspectorCaptions; - } - - /// - /// Return true if we can export to the supplied inspector - /// - /// - /// - private static bool canExportToInspector(Inspector inspector) { - try { - Item currentItem = inspector.CurrentItem; - if (currentItem != null) { - OlObjectClass currentItemClass = currentItem.Class; - if (OlObjectClass.olMail.Equals(currentItemClass)) { - if (!currentItem.Sent) { - return true; - } - } else if (outlookVersion.Major >= 12 && conf.OutlookAllowExportInMeetings && OlObjectClass.olAppointment.Equals(currentItemClass)) { - if (string.IsNullOrEmpty(currentItem.Organizer) || (currentUser == null && currentUser.Equals(currentItem.Organizer))) { - return true; - } else { - LOG.DebugFormat("Not exporting to {0}, as organizer is {1} and currentuser {2}", inspector.Caption, currentItem.Organizer, currentUser); - } - } - } - } catch (Exception ex) { - LOG.WarnFormat("Couldn't process item due to: {0}", ex.Message); - } - return false; - } - - - /// - /// Export the image stored in tmpFile to the Inspector with the caption - /// - /// Caption of the inspector - /// Path to image file - /// name of the attachment (used as the tooltip of the image) - /// true if it worked - public static bool ExportToInspector(string inspectorCaption, string tmpFile, string attachmentName) { - using ( IOutlookApplication outlookApplication = GetOrCreateOutlookApplication()) { - if (outlookApplication != null) { - Inspectors inspectors = outlookApplication.Inspectors; - if (inspectors != null && inspectors.Count > 0) { - LOG.DebugFormat("Got {0} inspectors to check", inspectors.Count); - for(int i=1; i <= inspectors.Count; i++) { - Inspector inspector = outlookApplication.Inspectors[i]; - string currentCaption = inspector.Caption; - if (currentCaption.StartsWith(inspectorCaption)) { - if (canExportToInspector(inspector)) { - try { - return ExportToInspector(inspector, tmpFile, attachmentName); - } catch (Exception exExport) { - LOG.Error("Export to " + currentCaption + " failed.", exExport); - } - } - } - } - } - } - } - return false; - } - - /// - /// Export the file to the supplied inspector - /// - /// - /// - /// - /// - private static bool ExportToInspector(Inspector inspector, string tmpFile, string attachmentName) { - Item currentItem = inspector.CurrentItem; - if (currentItem == null) { - LOG.Warn("No current item."); - return false; - } - OlObjectClass itemClass = currentItem.Class; - bool isMail = OlObjectClass.olMail.Equals(itemClass); - bool isAppointment = OlObjectClass.olAppointment.Equals(itemClass); - if (!isMail && !isAppointment) { - LOG.Warn("Item is no mail or appointment."); - return false; - } - try { - if (isMail && currentItem.Sent) { - LOG.WarnFormat("Item already sent, can't export to {0}", currentItem.Subject); - return false; - } - - // Make sure the inspector is activated, only this way the word editor is active! - // This also ensures that the window is visible! - inspector.Activate(); - - // Check for wordmail, if so use the wordexporter - // http://msdn.microsoft.com/en-us/library/dd492012%28v=office.12%29.aspx - // Earlier versions of Outlook also supported an Inspector.HTMLEditor object property, but since Internet Explorer is no longer the rendering engine for HTML messages and posts, HTMLEditor is no longer supported. - if (inspector.IsWordMail() && inspector.WordEditor != null) { - if (WordExporter.InsertIntoExistingDocument(inspector.WordEditor, tmpFile)) { - LOG.Info("Inserted into Wordmail"); - - // check the format afterwards, otherwise we lose the selection - //if (!OlBodyFormat.olFormatHTML.Equals(currentMail.BodyFormat)) { - // LOG.Info("Changing format to HTML."); - // currentMail.BodyFormat = OlBodyFormat.olFormatHTML; - //} - return true; - } - } else if (isAppointment) { - LOG.Info("Can't export to an appointment if no word editor is used"); - return false; - } else { - LOG.Info("Trying export for word < 2007."); - } - - LOG.InfoFormat("Item '{0}' has format: {1}", currentItem.Subject, currentItem.BodyFormat); - - string contentID; - if (outlookVersion.Major >=12 ) { - contentID = Guid.NewGuid().ToString(); - } else { - LOG.Info("Older Outlook (<2007) found, using filename as contentid."); - contentID = Path.GetFileName(tmpFile); - } - - // Use this to change the format, it will probably lose the current selection. - //if (!OlBodyFormat.olFormatHTML.Equals(currentMail.BodyFormat)) { - // LOG.Info("Changing format to HTML."); - // currentMail.BodyFormat = OlBodyFormat.olFormatHTML; - //} - - bool inlinePossible = false; - if (OlBodyFormat.olFormatHTML.Equals(currentItem.BodyFormat)) { - // if html we can try to inline it - // The following might cause a security popup... can't ignore it. - try { - IHTMLDocument2 document2 = inspector.HTMLEditor as IHTMLDocument2; - if (document2 != null) { - IHTMLSelectionObject selection = document2.selection; - if (selection != null) { - IHTMLTxtRange range = selection.createRange(); - if (range != null) { - // First paste, than attach (otherwise the range is wrong!) - range.pasteHTML("
\""
"); - inlinePossible = true; - } else { - LOG.DebugFormat("No range for '{0}'", inspector.Caption); - } - } else { - LOG.DebugFormat("No selection for '{0}'", inspector.Caption); - } - } else { - LOG.DebugFormat("No HTML editor for '{0}'", inspector.Caption); - } - } catch (Exception e) { - // Continue with non inline image - LOG.Warn("Error pasting HTML, most likely due to an ACCESS_DENIED as the user clicked no.", e); - } - } - - // Create the attachment (if inlined the attachment isn't visible as attachment!) - Attachment attachment = currentItem.Attachments.Add(tmpFile, OlAttachmentType.olByValue, inlinePossible?0:1, attachmentName); - if (outlookVersion.Major >=12) { - // Add the content id to the attachment, this only works for Outlook >= 2007 - try { - PropertyAccessor propertyAccessor = attachment.PropertyAccessor; - propertyAccessor.SetProperty(PropTag.ATTACHMENT_CONTENT_ID, contentID); - } catch { - } - } - } catch (Exception ex) { - LOG.WarnFormat("Problem while trying to add attachment to Item '{0}' : {1}", inspector.Caption, ex); - return false; - } - LOG.Debug("Finished!"); - return true; - } - /// - /// Export image to a new email - /// - /// - /// - /// - private static void ExportToNewEmail(IOutlookApplication outlookApplication, string tmpFile, string subject, string attachmentName) { - Item newMail = outlookApplication.CreateItem( OlItemType.olMailItem ); - if (newMail == null) { - return; - } - newMail.Subject = subject; - newMail.BodyFormat = OlBodyFormat.olFormatHTML; - string bodyString = null; - // Read the default signature, if nothing found use empty email - try { - bodyString = GetOutlookSignature(); - } catch (Exception e) { - LOG.Error("Problem reading signature!", e); - } - switch(conf.OutlookEmailFormat) { - case EmailFormat.Text: - newMail.Attachments.Add(tmpFile, OlAttachmentType.olByValue, 1, attachmentName); - newMail.BodyFormat = OlBodyFormat.olFormatPlain; - if (bodyString == null) { - bodyString = ""; - } - newMail.Body = bodyString; - break; - case EmailFormat.HTML: - default: - // Create the attachment - Attachment attachment = newMail.Attachments.Add(tmpFile, OlAttachmentType.olByValue, 0, attachmentName); - // add content ID to the attachment - string contentID = Path.GetFileName(tmpFile); - if (outlookVersion.Major >=12) { - // Add the content id to the attachment - try { - contentID = Guid.NewGuid().ToString(); - PropertyAccessor propertyAccessor = attachment.PropertyAccessor; - propertyAccessor.SetProperty(PropTag.ATTACHMENT_CONTENT_ID, contentID); - } catch { - LOG.Info("Error working with the PropertyAccessor, using filename as contentid"); - contentID = Path.GetFileName(tmpFile); - } - } - - newMail.BodyFormat = OlBodyFormat.olFormatHTML; - string htmlImgEmbedded = "
\""
"; - string fallbackBody = "" + htmlImgEmbedded + ""; - if (bodyString == null) { - bodyString = fallbackBody; - } else { - int bodyIndex = bodyString.IndexOf("= 0) { - bodyIndex = bodyString.IndexOf(">", bodyIndex) + 1; - if (bodyIndex >= 0) { - bodyString = bodyString.Insert(bodyIndex, htmlImgEmbedded); - } else { - bodyString = fallbackBody; - } - } else { - bodyString = fallbackBody; - } - } - newMail.HTMLBody = bodyString; - break; - } - // So not save, otherwise the email is always stored in Draft folder.. (newMail.Save();) - newMail.Display(false); - } - - private static bool ExportToMail(IOutlookApplication outlookApplication, string tmpFile, string subject, string attachmentName) { - bool exported = false; - if (outlookApplication != null) { - ExportToNewEmail(outlookApplication, tmpFile, subject, attachmentName); - exported = true; - } - return exported; - } - - /// - /// Helper method to create the outlook mail item with attachment - /// - /// The file to send - /// true if it worked, false if not - public static bool ExportToOutlook(string tmpFile, string subject, string attachmentName) { - try { - bool exported = false; - - using ( IOutlookApplication outlookApplication = GetOrCreateOutlookApplication()) { - if (outlookApplication != null) { - exported = ExportToMail(outlookApplication, tmpFile, subject, attachmentName); - } - } - // assuming that the file isn't deleted right away... - // there used to be a sleep here - return exported; - } catch(Exception e) { - LOG.Error("Error while creating an outlook mail item: ", e); - } - return false; - } - - /// - /// Helper method to get the Outlook signature - /// - /// - private static string GetOutlookSignature() { - using (RegistryKey profilesKey = Registry.CurrentUser.OpenSubKey(PROFILES_KEY, false)) { - if (profilesKey == null) { - return null; - } - string defaultProfile = (string)profilesKey.GetValue(DEFAULT_PROFILE_VALUE); - LOG.DebugFormat("defaultProfile={0}",defaultProfile); - using (RegistryKey profileKey = profilesKey.OpenSubKey(defaultProfile + @"\" + ACCOUNT_KEY, false)) { - if (profilesKey == null) { - return null; - } - string [] numbers = profileKey.GetSubKeyNames(); - foreach(string number in numbers) { - LOG.DebugFormat("Found subkey {0}", number); - using (RegistryKey numberKey = profileKey.OpenSubKey(number, false)) { - byte[] val = (byte[])numberKey.GetValue(NEW_SIGNATURE_VALUE); - if (val == null) { - continue; - } - string signatureName = ""; - foreach(byte b in val) { - if (b != 0) { - signatureName += (char) b; - } - } - LOG.DebugFormat("Found email signature: {0}", signatureName); - string extension; - switch(conf.OutlookEmailFormat) { - case EmailFormat.Text: - extension = ".txt"; - break; - case EmailFormat.HTML: - default: - extension = ".htm"; - break; - } - string signatureFile = Path.Combine(SIGNATURE_PATH, signatureName + extension); - if (File.Exists(signatureFile)) { - LOG.DebugFormat("Found email signature file: {0}", signatureFile); - return File.ReadAllText(signatureFile, Encoding.Default); - } - } - } - } - } - return null; - } - - /// - /// Initialize static outlook variables like version and currentuser - /// - /// - private static void InitializeVariables(IOutlookApplication outlookApplication) { - try { - outlookVersion = new Version(outlookApplication.Version); - LOG.InfoFormat("Using Outlook {0}", outlookVersion); - } catch (Exception exVersion) { - LOG.Error(exVersion); - } - try { - INameSpace mapiNamespace = outlookApplication.GetNameSpace("MAPI"); - currentUser = mapiNamespace.CurrentUser.Name; - LOG.InfoFormat("Current user: {0}", currentUser); - } catch (Exception exNS) { - LOG.Error(exNS); - } - } - - /// - /// Call this to get the running outlook application, returns null if there isn't any. - /// - /// IOutlookApplication or null - private static IOutlookApplication GetOutlookApplication() { - IOutlookApplication outlookApplication = (IOutlookApplication)COMWrapper.GetInstance(typeof(IOutlookApplication)); - InitializeVariables(outlookApplication); - return outlookApplication; - } - - /// - /// Call this to get the running outlook application, or create a new instance - /// - /// IOutlookApplication - private static IOutlookApplication GetOrCreateOutlookApplication() { - IOutlookApplication outlookApplication = (IOutlookApplication)COMWrapper.GetOrCreateInstance(typeof(IOutlookApplication)); - InitializeVariables(outlookApplication); - return outlookApplication; - } - } -} diff --git a/Greenshot/Helpers/OfficeInterop/PowerpointWrapper.cs b/Greenshot/Helpers/OfficeInterop/PowerpointWrapper.cs deleted file mode 100644 index 1b4a41194..000000000 --- a/Greenshot/Helpers/OfficeInterop/PowerpointWrapper.cs +++ /dev/null @@ -1,236 +0,0 @@ -/* - * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom - * - * For more information see: http://getgreenshot.org/ - * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 1 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -using System; -using System.Collections; -using System.Drawing; -using System.Runtime.Remoting.Messaging; -using Greenshot.Interop; -using Greenshot.Plugin; - -namespace Greenshot.Helpers.OfficeInterop { - // See http://msdn.microsoft.com/en-us/library/microsoft.office.interop.powerpoint.application_members.aspx - [ComProgId("Powerpoint.Application")] - public interface IPowerpointApplication : Common { - IPresentation ActivePresentation { get; } - IPresentations Presentations {get;} - bool Visible {get; set;} - } - - // See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.powerpoint.slides_members.aspx - public interface ISlides : Common { - int Count {get;} - ISlide Add(int Index, int layout); - } - - // See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.powerpoint.presentation_members.aspx - public interface IPresentation : Common { - string Name { get; } - ISlides Slides{ get;} - } - - // See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.powerpoint.presentations_members.aspx - public interface IPresentations : Common, Collection { - IPresentation Add(MsoTriState WithWindow); - IPresentation item(int index); - } - - // See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.powerpoint.slide_members.aspx - public interface ISlide : Common { - IShapes Shapes {get;} - void Select(); - int SlideNumber { get; } - } - - // See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.powerpoint.shapes_members.aspx - public interface IShapes : Common, IEnumerable { - int Count {get;} - IShape item(int index); - IShape AddPicture(string FileName, MsoTriState LinkToFile, MsoTriState SaveWithDocument, float Left, float Top, float Width, float Height); - } - - // See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.powerpoint.shape_members.aspx - public interface IShape : Common { - float Left { get; set;} - float Top { get; set;} - float Width { get; set;} - float Height { get; set;} - ITextFrame TextFrame { get; } - void ScaleWidth(float Factor, MsoTriState RelativeToOriginalSize, MsoScaleFrom fScale); - void ScaleHeight(float Factor, MsoTriState RelativeToOriginalSize, MsoScaleFrom fScale); - } - - public interface ITextFrame : Common { - ITextRange TextRange {get;} - } - public interface ITextRange : Common { - string Text { get; set; } - } - - public enum PPSlideLayout : int { - ppLayoutMixed = -2, - ppLayoutTitle = 1, - ppLayoutText = 2, - ppLayoutTwoColumnText = 3, - ppLayoutTable = 4, - ppLayoutTextAndChart = 5, - ppLayoutChartAndText = 6, - ppLayoutOrgchart = 7, - ppLayoutChart = 8, - ppLayoutTextAndClipart = 9, - ppLayoutClipartAndText = 10, - ppLayoutTitleOnly = 11, - ppLayoutBlank = 12, - ppLayoutTextAndObject = 13, - ppLayoutObjectAndText = 14, - ppLayoutLargeObject = 15, - ppLayoutObject = 16, - ppLayoutTextAndMediaClip = 17, - ppLayoutMediaClipAndText = 18, - ppLayoutObjectOverText = 19, - ppLayoutTextOverObject = 20, - ppLayoutTextAndTwoObjects = 21, - ppLayoutTwoObjectsAndText = 22, - ppLayoutTwoObjectsOverText = 23, - ppLayoutFourObjects = 24, - ppLayoutVerticalText = 25, - ppLayoutClipArtAndVerticalText = 26, - ppLayoutVerticalTitleAndText = 27, - ppLayoutVerticalTitleAndTextOverChart = 28, - ppLayoutTwoObjects = 29, - ppLayoutObjectAndTwoObjects = 30, - ppLayoutTwoObjectsAndObject = 31, - ppLayoutCustom = 32, - ppLayoutSectionHeader = 33, - ppLayoutComparison = 34, - ppLayoutContentWithCaption = 35, - ppLayoutPictureWithCaption = 36 - } - - public class PowerpointExporter { - private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(PowerpointExporter)); - - private static IPowerpointApplication GetOrCreatePowerpointApplication() { - return (IPowerpointApplication)COMWrapper.GetOrCreateInstance(typeof(IPowerpointApplication)); - } - - private static IPowerpointApplication GetPowerpointApplication() { - return (IPowerpointApplication)COMWrapper.GetInstance(typeof(IPowerpointApplication)); - } - - /// - /// Get the captions of all the open powerpoint presentations - /// - /// - public static System.Collections.Generic.List GetPowerpointPresentations() { - System.Collections.Generic.List presentations = new System.Collections.Generic.List(); - try { - using( IPowerpointApplication powerpointApplication = GetPowerpointApplication() ) { - if (powerpointApplication != null) { - LOG.DebugFormat("Open Presentations: {0}", powerpointApplication.Presentations.Count); - for(int i = 1; i <= powerpointApplication.Presentations.Count ; i ++) { - IPresentation presentation = powerpointApplication.Presentations.item(i); - if (presentation != null) { - presentations.Add(presentation.Name); - } - } - } - } - } catch (Exception ex) { - LOG.Warn("Problem retrieving word destinations, ignoring: ", ex); - } - - return presentations; - } - - /// - /// Export the image from the tmpfile to the presentation with the supplied name - /// - /// - /// - /// - /// - /// - public static bool ExportToPresentation(string presentationName, string tmpFile, Size imageSize, ICaptureDetails captureDetails) { - using( IPowerpointApplication powerpointApplication = GetPowerpointApplication() ) { - if (powerpointApplication != null) { - LOG.DebugFormat("Open Presentations: {0}", powerpointApplication.Presentations.Count); - for(int i = 1; i <= powerpointApplication.Presentations.Count ; i ++) { - IPresentation presentation = powerpointApplication.Presentations.item(i); - if (presentation != null && presentation.Name.StartsWith(presentationName)) { - try { - AddPictureToPresentation(presentation, tmpFile, imageSize, captureDetails); - return true; - } catch (Exception e){ - LOG.Error(e); - } - } - } - } - } - return false; - } - - private static void AddPictureToPresentation(IPresentation presentation, string tmpFile, Size imageSize, ICaptureDetails captureDetails) { - if (presentation != null) { - //ISlide slide = presentation.Slides.AddSlide( presentation.Slides.Count + 1, PPSlideLayout.ppLayoutPictureWithCaption); - ISlide slide; - float left = 0; - float top = 0; - bool isLayoutPictureWithCaption = false; - try { - slide = presentation.Slides.Add( presentation.Slides.Count + 1, (int)PPSlideLayout.ppLayoutPictureWithCaption); - isLayoutPictureWithCaption = true; - // Shapes[2] is the image shape on this layout. - IShape shapeForLocation = slide.Shapes.item(2); - shapeForLocation.Width = imageSize.Width; - shapeForLocation.Height = imageSize.Height; - left = shapeForLocation.Left; - top = shapeForLocation.Top; - LOG.DebugFormat("Shape {0},{1},{2},{3}", shapeForLocation.Left, shapeForLocation.Top, imageSize.Width, imageSize.Height); - } catch (Exception e) { - LOG.Error(e); - slide = presentation.Slides.Add( presentation.Slides.Count + 1, (int)PPSlideLayout.ppLayoutBlank); - } - IShape shape = slide.Shapes.AddPicture(tmpFile, MsoTriState.msoFalse, MsoTriState.msoTrue, left, top, imageSize.Width, imageSize.Height); - shape.Width = imageSize.Width; - shape.Height = imageSize.Height; - shape.ScaleWidth(1, MsoTriState.msoTrue, MsoScaleFrom.msoScaleFromMiddle); - shape.ScaleHeight(1, MsoTriState.msoTrue, MsoScaleFrom.msoScaleFromMiddle); - if (isLayoutPictureWithCaption) { - try { - // Using try/catch to make sure problems with the text range don't give an exception. - shape.TextFrame.TextRange.Text = captureDetails.Title; - } catch {}; - } - } - } - - public static void InsertIntoNewPresentation(string tmpFile, Size imageSize, ICaptureDetails captureDetails) { - using( IPowerpointApplication powerpointApplication = GetOrCreatePowerpointApplication() ) { - if (powerpointApplication != null) { - powerpointApplication.Visible = true; - IPresentation presentation = powerpointApplication.Presentations.Add(MsoTriState.msoTrue); - AddPictureToPresentation(presentation, tmpFile, imageSize, captureDetails); - } - } - } - } -} diff --git a/Greenshot/Helpers/OfficeInterop/WordWrapper.cs b/Greenshot/Helpers/OfficeInterop/WordWrapper.cs deleted file mode 100644 index 6b97c6373..000000000 --- a/Greenshot/Helpers/OfficeInterop/WordWrapper.cs +++ /dev/null @@ -1,171 +0,0 @@ -/* - * Greenshot - a free and open source screenshot tool - * Copyright (C) 2007-2012 Thomas Braun, Jens Klingen, Robin Krom - * - * For more information see: http://getgreenshot.org/ - * The Greenshot project is hosted on Sourceforge: http://sourceforge.net/projects/greenshot/ - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 1 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -using System; -using System.Collections; -using Greenshot.Interop; - -namespace Greenshot.Helpers.OfficeInterop { - // See http://msdn.microsoft.com/de-de/library/microsoft.office.interop.word.applicationclass_members%28v=Office.11%29.aspx - [ComProgId("Word.Application")] - public interface IWordApplication : Common { - IWordDocument ActiveDocument { get; } - ISelection Selection { get; } - IDocuments Documents { get; } - bool Visible { get; set; } - } - - // See: http://msdn.microsoft.com/de-de/library/microsoft.office.interop.word.documents_members(v=office.11).aspx - public interface IDocuments : Common, Collection { - void Add(ref object Template, ref object NewTemplate, ref object DocumentType, ref object Visible); - IWordDocument item(int index); - } - - // See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word.document.aspx - public interface IWordDocument : Common { - IWordApplication Application { get; } - Window ActiveWindow { get; } - } - - // See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word.window_members.aspx - public interface Window : Common { - Pane ActivePane { get; } - string Caption { - get; - } - } - - // See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word.pane_members.aspx - public interface Pane : Common { - View View { get; } - } - - // See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word.view_members.aspx - public interface View : Common { - Zoom Zoom { get; } - } - - // See: http://msdn.microsoft.com/en-us/library/microsoft.office.interop.word.zoom_members.aspx - public interface Zoom : Common { - int Percentage { get; set; } - } - - // See: http://msdn.microsoft.com/de-de/library/microsoft.office.interop.word.selection_members(v=office.11).aspx - public interface ISelection : Common { - IInlineShapes InlineShapes { get; } - void InsertAfter(string text); - } - - public interface IInlineShapes : Common { - object AddPicture(string FileName, object LinkToFile, object SaveWithDocument, object Range); - } - - public class WordExporter { - private static readonly log4net.ILog LOG = log4net.LogManager.GetLogger(typeof(WordExporter)); - - private static IWordApplication GetOrCreateWordApplication() { - return (IWordApplication)COMWrapper.GetOrCreateInstance(typeof(IWordApplication)); - } - private static IWordApplication GetWordApplication() { - return (IWordApplication)COMWrapper.GetInstance(typeof(IWordApplication)); - } - - /// - /// Insert the bitmap stored under the tempfile path into the word document with the supplied caption - /// - /// - /// - /// - public static bool InsertIntoExistingDocument(string wordCaption, string tmpFile) { - using( IWordApplication wordApplication = GetWordApplication() ) { - if (wordApplication != null) { - for(int i = 1; i <= wordApplication.Documents.Count ; i ++) { - IWordDocument wordDocument = wordApplication.Documents.item(i); - if (wordDocument.ActiveWindow.Caption.StartsWith(wordCaption)) { - return InsertIntoExistingDocument(wordDocument, tmpFile); - } - } - } - } - return false; - } - - internal static bool InsertIntoExistingDocument(IWordDocument wordDocument, string tmpFile) { - if (wordDocument.Application.Selection != null) { - AddPictureToSelection(wordDocument.Application.Selection, tmpFile); - try { - wordDocument.ActiveWindow.ActivePane.View.Zoom.Percentage = 100; - } catch(Exception e) { - if (e.InnerException != null) { - LOG.WarnFormat("Couldn't set zoom to 100, error: {0}", e.InnerException.Message); - } else { - LOG.WarnFormat("Couldn't set zoom to 100, error: {0}", e.Message); - } - } - return true; - } - return false; - } - - private static void AddPictureToSelection(ISelection selection, string tmpFile) { - selection.InlineShapes.AddPicture(tmpFile, Type.Missing, Type.Missing, Type.Missing); - //selection.InsertAfter("blablub\r\n"); - } - - public static void InsertIntoNewDocument(string tmpFile) { - using( IWordApplication wordApplication = GetOrCreateWordApplication() ) { - if (wordApplication != null) { - wordApplication.Visible = true; - - // Create new Document - object template = string.Empty; - object newTemplate = false; - object documentType = 0; - object documentVisible = true; - wordApplication.Documents.Add(ref template, ref newTemplate, ref documentType, ref documentVisible); - // Add Picture - AddPictureToSelection(wordApplication.Selection, tmpFile); - } - } - } - - /// - /// Get the captions of all the open word documents - /// - /// - public static System.Collections.Generic.List GetWordDocuments() { - System.Collections.Generic.List documents = new System.Collections.Generic.List(); - try { - using(IWordApplication wordApplication = GetWordApplication()) { - if (wordApplication != null) { - //documents.Add(wordApplication.ActiveDocument); - for(int i = 1; i <= wordApplication.Documents.Count ; i ++) { - IWordDocument document = wordApplication.Documents.item(i); - documents.Add(document.ActiveWindow.Caption); - } - } - } - } catch (Exception ex) { - LOG.Warn("Problem retrieving word destinations, ignoring: ", ex); - } - return documents; - } - } -} diff --git a/Greenshot/Helpers/PluginHelper.cs b/Greenshot/Helpers/PluginHelper.cs index b5fcd86c7..cde98ad14 100644 --- a/Greenshot/Helpers/PluginHelper.cs +++ b/Greenshot/Helpers/PluginHelper.cs @@ -28,7 +28,7 @@ using System.Windows.Forms; using Greenshot.Configuration; using Greenshot.Plugin; using GreenshotPlugin.Core; -using IniFile; +using Greenshot.IniFile; namespace Greenshot.Helpers { /// diff --git a/Greenshot/Helpers/PrintHelper.cs b/Greenshot/Helpers/PrintHelper.cs index 26b1f6522..2a1d7895d 100644 --- a/Greenshot/Helpers/PrintHelper.cs +++ b/Greenshot/Helpers/PrintHelper.cs @@ -28,7 +28,7 @@ using Greenshot.Drawing; using Greenshot.Forms; using Greenshot.Plugin; using GreenshotPlugin.Core; -using IniFile; +using Greenshot.IniFile; namespace Greenshot.Helpers { /// diff --git a/Greenshot/Helpers/ScreenCaptureHelper.cs b/Greenshot/Helpers/ScreenCaptureHelper.cs index 299b1b641..4242af280 100644 --- a/Greenshot/Helpers/ScreenCaptureHelper.cs +++ b/Greenshot/Helpers/ScreenCaptureHelper.cs @@ -35,7 +35,7 @@ using Greenshot.Configuration; using Greenshot.Plugin; using GreenshotPlugin.UnmanagedHelpers; using GreenshotPlugin.Core; -using IniFile; +using Greenshot.IniFile; namespace Greenshot.Helpers { /// @@ -62,6 +62,7 @@ namespace Greenshot.Helpers { private IntPtr bits0 = IntPtr.Zero; //pointer to the raw bits that make up the bitmap. private Bitmap GDIBitmap; private string filename = null; + private Stopwatch stopwatch = new Stopwatch(); public ScreenCaptureHelper(Rectangle recordingRectangle) { this.recordingRectangle = recordingRectangle; @@ -190,8 +191,9 @@ namespace Greenshot.Helpers { private void CaptureFrame() { int MSBETWEENCAPTURES = 1000/framesPerSecond; int msToNextCapture = MSBETWEENCAPTURES; + stopwatch.Reset(); while (!stop) { - DateTime nextCapture = DateTime.Now.AddMilliseconds(msToNextCapture); + stopwatch.Start(); Point captureLocation; if (recordingWindow != null) { recordingWindow.Reset(); @@ -219,18 +221,35 @@ namespace Greenshot.Helpers { LOG.Error("Error adding frame to avi, stopping capturing."); break; } - int sleeptime = (int)(nextCapture.Subtract(DateTime.Now).Ticks / TimeSpan.TicksPerMillisecond); - if (sleeptime > 0) { - Thread.Sleep(sleeptime); - msToNextCapture = MSBETWEENCAPTURES; - } else { - // Compensating - do { - aviWriter.AddEmptyFrame(); - sleeptime += MSBETWEENCAPTURES; - } while (sleeptime < 0); - msToNextCapture = sleeptime; + + int restTime = (int)(msToNextCapture - stopwatch.ElapsedMilliseconds); + + // Set time to next capture, we correct it if needed later. + msToNextCapture = MSBETWEENCAPTURES; + if (restTime > 0) { + // We were fast enough, we wait for next capture + Thread.Sleep(restTime); + } else if (restTime < 0) { + // Compensating, as we took to long + int framesToSkip = ((-restTime) / MSBETWEENCAPTURES); + int leftoverMillis = (-restTime) % MSBETWEENCAPTURES; + //LOG.InfoFormat("Adding {0} empty frames to avi, leftover millis is {1}, sleeping {2} (of {3} total)", framesToSkip, leftover, sleepMillis, MSBETWEENCAPTURES); + aviWriter.AddEmptyFrames(framesToSkip); + + // check how bad it is, if we only missed our target by a few millis we hope the next capture corrects this + if (leftoverMillis > 0 && leftoverMillis <= 2) { + // subtract the leftover from the millis to next capture, do nothing else + msToNextCapture -= leftoverMillis; + } else if (leftoverMillis > 0) { + // it's more, we add an empty frame + aviWriter.AddEmptyFrames(1); + // we sleep to the next time and + int sleepMillis = MSBETWEENCAPTURES - leftoverMillis; + // Sleep to next capture + Thread.Sleep(sleepMillis); + } } + stopwatch.Reset(); } Cleanup(); } diff --git a/Greenshot/Helpers/UpdateHelper.cs b/Greenshot/Helpers/UpdateHelper.cs index 05f2abd2b..467c0dd10 100644 --- a/Greenshot/Helpers/UpdateHelper.cs +++ b/Greenshot/Helpers/UpdateHelper.cs @@ -29,7 +29,7 @@ using System.Windows.Forms; using Greenshot.Configuration; using GreenshotPlugin.Core; -using IniFile; +using Greenshot.IniFile; namespace Greenshot.Experimental { ///