mirror of
https://github.com/greenshot/greenshot.git
synced 2025-01-09 15:23:03 -08:00
26fe579d31
Removed a lot of dead code, and remove the old OCR code as we don't even know if it still works.
40 lines
1.4 KiB
C#
40 lines
1.4 KiB
C#
// Copyright (c) Dapplo and contributors. All rights reserved.
|
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
|
|
using System;
|
|
using System.Runtime.InteropServices;
|
|
using GreenshotPlugin.Core;
|
|
using GreenshotPlugin.Core.Enums;
|
|
|
|
namespace GreenshotOfficePlugin.Com
|
|
{
|
|
/// <summary>
|
|
/// This provides an API for OLE32
|
|
/// </summary>
|
|
public static class Ole32Api
|
|
{
|
|
/// <summary>
|
|
/// This converts a ProgID (program ID) into a Guid with the clsId
|
|
/// </summary>
|
|
/// <param name="programId">string with the program ID</param>
|
|
/// <returns>Guid with the clsId</returns>
|
|
public static Guid ClassIdFromProgId(string programId)
|
|
{
|
|
if (CLSIDFromProgID(programId, out Guid clsId).Succeeded())
|
|
{
|
|
return clsId;
|
|
}
|
|
return clsId;
|
|
}
|
|
|
|
/// <summary>
|
|
/// See more <a href="https://docs.microsoft.com/en-us/windows/desktop/api/combaseapi/nf-combaseapi-clsidfromprogid">here</a>
|
|
/// </summary>
|
|
/// <param name="progId">string with the progId</param>
|
|
/// <param name="clsId">Guid</param>
|
|
/// <returns>HResult</returns>
|
|
[DllImport("ole32.dll", ExactSpelling = true)]
|
|
private static extern HResult CLSIDFromProgID([In] [MarshalAs(UnmanagedType.LPWStr)] string progId, [Out] out Guid clsId);
|
|
}
|
|
}
|