Skip to content

Feature: Added SeerPro support #12477

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,30 @@
// Licensed under the MIT License. See the LICENSE.

using Files.Backend.Services;
using Microsoft.Extensions.Logging;
using System.IO;
using System.IO.Pipes;
using System.Security.Principal;
using System.Runtime.InteropServices;
using Vanara.PInvoke;

namespace Files.App.ServicesImplementation.PreviewPopupProviders
{
public struct COPYDATASTRUCT
{
public IntPtr dwData;
public int cbData;
public IntPtr lpData;
}

public class SeerProProvider : IPreviewPopupProvider
{
public static SeerProProvider Instance { get; } = new();

private const int TIMEOUT = 500;

public async Task TogglePreviewPopup(string path)
{
// TODO
HWND Window = User32.FindWindow("SeerWindowClass", null);
COPYDATASTRUCT data = new COPYDATASTRUCT();
data.dwData = 5000;
data.cbData = (path.Length + 1) * 2;
data.lpData = Marshal.StringToHGlobalUni(path);
User32.SendMessage(Window, (uint)User32.WindowMessage.WM_COPYDATA, 0, ref data);
}

public async Task SwitchPreview(string path)
Expand Down