mirror of
https://github.com/greenshot/greenshot
synced 2025-07-16 10:03:44 -07:00
Made the Win10 share work again, work in progress
This commit is contained in:
parent
ecad3856cf
commit
19b6576311
10 changed files with 619 additions and 178 deletions
|
@ -1,20 +1,20 @@
|
|||
/*
|
||||
* Greenshot - a free and open source screenshot tool
|
||||
* Copyright (C) 2007-2015 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/>.
|
||||
*/
|
||||
|
@ -36,12 +36,18 @@ namespace GreenshotWin10Plugin.Native
|
|||
private readonly IDataTransferManagerInterOp _dataTransferManagerInterOp;
|
||||
private readonly IntPtr _windowHandle;
|
||||
|
||||
/// <summary>
|
||||
/// The DataTransferManager
|
||||
/// </summary>
|
||||
public DataTransferManager DataTransferManager
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructor which takes a handle to initialize
|
||||
/// </summary>
|
||||
/// <param name="handle"></param>
|
||||
public DataTransferManagerHelper(IntPtr handle)
|
||||
{
|
||||
//TODO: Add a check for failure here. This will fail for versions of Windows below Windows 10
|
||||
|
@ -52,8 +58,8 @@ namespace GreenshotWin10Plugin.Native
|
|||
|
||||
_windowHandle = handle;
|
||||
var riid = new Guid(DataTransferManagerId);
|
||||
var hresult = _dataTransferManagerInterOp.GetForWindow(_windowHandle, riid, out var dataTransferManager);
|
||||
if (hresult != 0)
|
||||
var hresult = _dataTransferManagerInterOp.GetForWindow(_windowHandle, riid, out var dataTransferManager);
|
||||
if (hresult.Failed())
|
||||
{
|
||||
Log.WarnFormat("HResult for GetForWindow: {0}", hresult);
|
||||
}
|
||||
|
@ -66,9 +72,9 @@ namespace GreenshotWin10Plugin.Native
|
|||
public void ShowShareUi()
|
||||
{
|
||||
var hresult = _dataTransferManagerInterOp.ShowShareUIForWindow(_windowHandle);
|
||||
if (hresult != 0)
|
||||
{
|
||||
Log.WarnFormat("HResult for ShowShareUIForWindow: {0}", hresult);
|
||||
if (hresult.Failed())
|
||||
{
|
||||
Log.WarnFormat("HResult for ShowShareUIForWindow: {0}", hresult);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue