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
This commit is contained in:
RKrom 2012-03-06 17:41:19 +00:00
commit 7666127106
43 changed files with 51 additions and 4752 deletions

View file

@ -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;

View file

@ -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 <http://www.gnu.org/licenses/>.
*/
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;
}
}
}

View file

@ -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 <http://www.gnu.org/licenses/>.
*/
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 {
/// <summary><para><c>styleFloat</c> property of <c>IHTMLStyle</c> interface.</para></summary>
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;
}
}
}

View file

@ -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 <http://www.gnu.org/licenses/>.
*/
using System;
using System.Runtime.InteropServices;
namespace Greenshot.Helpers.IEInterop {
/// <summary><para><c>IHTMLDocument</c> interface.</para></summary>
[Guid("626FC520-A41E-11CF-A731-00A0C9082637")]
[ComImport]
[TypeLibType(TypeLibTypeFlags.FDual)]
[InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIDispatch)]
public interface IHTMLDocument {
object Script {
[return: MarshalAs(UnmanagedType.IDispatch)]
get;
}
}
}

View file

@ -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 <http://www.gnu.org/licenses/>.
*/
using System;
using System.Runtime.InteropServices;
namespace Greenshot.Helpers.IEInterop {
/// <summary><para><c>IHTMLDocument2</c> interface.</para></summary>
[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;
}
}
}

View file

@ -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 <http://www.gnu.org/licenses/>.
*/
using System;
using System.Runtime.InteropServices;
namespace Greenshot.Helpers.IEInterop {
/// <summary><para><c>IHTMLDocument3</c> interface.</para></summary>
[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);
}
}

View file

@ -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 <http://www.gnu.org/licenses/>.
*/
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();
}
}

View file

@ -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 <http://www.gnu.org/licenses/>.
*/
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;
}
}
}

View file

@ -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 <http://www.gnu.org/licenses/>.
*/
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;
}
}
}

View file

@ -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 <http://www.gnu.org/licenses/>.
*/
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;
}
}
}

View file

@ -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 <http://www.gnu.org/licenses/>.
*/
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();
}
}

View file

@ -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 <http://www.gnu.org/licenses/>.
*/
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;
}
}
}

View file

@ -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 <http://www.gnu.org/licenses/>.
*/
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;
}
}
}

View file

@ -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 <http://www.gnu.org/licenses/>.
*/
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;
}
}
}

View file

@ -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 <http://www.gnu.org/licenses/>.
*/
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;
}
}
}

View file

@ -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 <http://www.gnu.org/licenses/>.
*/
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;
}
};
}

View file

@ -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 <http://www.gnu.org/licenses/>.
*/
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;}
}
}

File diff suppressed because it is too large Load diff

View file

@ -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 <http://www.gnu.org/licenses/>.
*/
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;
}
}
}

View file

@ -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 <http://www.gnu.org/licenses/>.
*/
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;
}
}
}

View file

@ -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 <http://www.gnu.org/licenses/>.
*/
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;}
}
}

View file

@ -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 <http://www.gnu.org/licenses/>.
*/
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;
}
}
}

View file

@ -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 <http://www.gnu.org/licenses/>.
*/
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);
}
}

View file

@ -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 <http://www.gnu.org/licenses/>.
*/
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);
}
}

View file

@ -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 <http://www.gnu.org/licenses/>.
*/
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; }
}
}