Skip to content
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

Merge PT upstream #9 #379

Merged
merged 104 commits into from
Jan 29, 2025
Merged
Changes from 1 commit
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
89be43e
[Workspaces] implement the move feature (#35480)
donlaci Dec 4, 2024
e7f1749
[KeyboardManager]Fix mapping shift to numpad (#35890)
mantaionut Dec 4, 2024
eadcf4b
[Analyzers] Update .editorconfig with rules to relax IDE errors (#36095)
snickler Dec 4, 2024
e19590f
[Workspaces] PWA follow-up (#36217)
SeraphimaZykova Dec 5, 2024
f7c9c80
[PTRun][Calculator]Allow scientific notation with lowercase 'e' (#36187)
PesBandi Dec 5, 2024
a9123bf
[Workspaces] Add encoder parameter to bitmap.save() (#36228)
donlaci Dec 5, 2024
076461e
[Workspaces] Implement store of app window's size and position (#36086)
donlaci Dec 5, 2024
09ce610
[ScreenRuler]Add setting to show the measurement in an extra unit (#3…
Sophanatprime Dec 5, 2024
a6c5420
[Deps]Update MSTest from 3.5.0 to 3.6.3 (#36115)
Youssef1313 Dec 5, 2024
4df8a97
Adding Jerry to community.md (#36232)
crutkas Dec 5, 2024
1212ce2
[Workspaces] Arranger: smart timer (#36096)
donlaci Dec 6, 2024
74a1a6e
Upgrade to check-spelling v0.0.24 (#36235)
jsoref Dec 6, 2024
51586b4
Adjust to community.md, shifting jerry's github user name (#36242)
crutkas Dec 6, 2024
3aec0a0
[AOT compatible] Resolve AOT Build Error in Peek.UI (#36194)
lei9444 Dec 9, 2024
ef672b5
Awake Updates - `TILLSON_11272024` (#36049)
dend Dec 9, 2024
9591950
[Workspaces] detecting right app version (#36100)
donlaci Dec 9, 2024
474b0cf
Move the XamlStyler config to src/ (#36202)
crutkas Dec 10, 2024
bf3474b
[AdvancedPaste]Add Semantic Kernel opt-in to allow chaining of paste …
drawbyperpetual Dec 11, 2024
7c6af65
[Launcher]Port from WPF-UI to .NET 9 WPF (#36215)
mantaionut Dec 11, 2024
7a39f2f
[UX]Updating New+ and Settings icons (#36290)
niels9001 Dec 11, 2024
ce0e00f
[Settings][Dashboard] Accessibility fixes (#36280)
davidegiacometti Dec 11, 2024
c5dc93f
[ci]Sign OpenAI dll that's not signed (#36299)
jaimecbernardo Dec 11, 2024
7aba6e8
Update CODEOWNERS to include gordon, jerry and kayla (#36308)
crutkas Dec 11, 2024
05e5e92
Making the powertoys-code-owners team code owners (#36310)
crutkas Dec 11, 2024
f19a34d
[FZEditor]Fix Create new layout dialog radio buttons IsChecked values…
stefansjfw Dec 12, 2024
feeeec6
0.87 changelog (#36335)
jaimecbernardo Dec 16, 2024
6f23fb5
[PTRun]Fix WPF transparent border issue on Windows 10 (#36392)
mantaionut Dec 18, 2024
e77ea96
[PTRun]Fix .NET 9 crash in OneNote (#36417)
mantaionut Dec 18, 2024
799f739
[AdvancedPaste]Fix NullReferenceException on Dispose (#36428)
drawbyperpetual Dec 18, 2024
43bc811
[Fuzz] Add fuzz testing for AdvancedPaste and new pipeline for onboar…
lei9444 Dec 19, 2024
ea66066
Add New CI Pipeline for Latest WindowsAppSDK (#36282)
shuaiyuanxx Dec 19, 2024
86c6b4a
[AOT compatible] Make HostsUILib become AOT compatible (#36136)
moooyo Dec 19, 2024
20a5f67
[AOT compatible] Clean up some AOT build issue in FilePreviewCommon a…
moooyo Dec 19, 2024
342c616
Add new pipeline using the latest webview2 from Edge Canary (#36317)
shuaiyuanxx Dec 19, 2024
2a6dcb9
[Bug fix] Making the OpenAI key configuration page scrollable. (#36359)
shuaiyuanxx Dec 19, 2024
e2cd863
[Bug fix] Add a format validation step before format conversion. (#36…
shuaiyuanxx Dec 19, 2024
f727762
Add more STCA team members (#36438)
jamrobot Dec 20, 2024
ea23f1e
Remove "prerelease: true" (#36484)
denelon Dec 21, 2024
bb637c1
[Docs]Update README for 0.87.1 release (#36534)
jaimecbernardo Dec 23, 2024
fbd72cc
[CI] Enhance build Pipeline Reliability with Retry Logic and Improved…
lei9444 Dec 24, 2024
e4d2deb
Add team member (#36590)
vanzue Dec 27, 2024
a720dd5
[New+]Don't override New actions from Explorer on Windows 10 (#36467)
jaimecbernardo Dec 27, 2024
2ba5fb7
[PTRun][Calculator]Handle hexadecimal numbers to not return divide by…
plante-msft Jan 2, 2025
1eec678
[TextExtractor]Minor UI/Accessibility fixes in the overlay UI (#36356)
davidegiacometti Jan 2, 2025
94d7121
[PTRun][Calculator]Update mages to v3.0.0 and support for `randi(n)` …
htcfreek Jan 3, 2025
bd30da6
[QuickAccent]Added ć for Slovenian (#36336) (#36338)
dsoklic Jan 3, 2025
21391bb
Fix snapping Workspaces Editor to Fancy Zones (#36463)
donlaci Jan 6, 2025
deddce2
[PTRun]Fix drag on .NET 9 WPF (#36635)
davidegiacometti Jan 6, 2025
90e75a1
[CQ]Continued to move stuff out of root - Solution.props (#36244)
crutkas Jan 6, 2025
6ca02f0
[QuickAccent]Add Proto-Indo-European (#36408)
haoliuu Jan 6, 2025
5e9675e
[PTRun]Add context buttons for VSCodeWorkspaces plugin (#36517)
programming-with-ia Jan 6, 2025
809791d
[Settings][QuickAccent]Change 'character set' to plural form (#36565)
PesBandi Jan 6, 2025
308c4b8
[PTRun][Calculator]Fix unit tests on non-english systems (#36569)
htcfreek Jan 8, 2025
cd2a887
[PTRun][Calc]Improve handling of non-base 10 numbers (#36700)
PesBandi Jan 8, 2025
a29ff07
[Settings][PTRun]Show plugin version and website (#36580)
htcfreek Jan 8, 2025
0d71f11
[Monaco]Add support for .resx and .resw preview support. (#36499)
asif4318 Jan 8, 2025
084978c
[Settings] Add Workspaces' workspaces.json file to backup/restore lis…
donlaci Jan 9, 2025
5ef9187
[Localization] Fix loc pipeline to send downloaded localized files to…
lei9444 Jan 9, 2025
7d8e4a7
[AdvancedPaste]Fixed issues with Screen Reader integration (#36778)
drawbyperpetual Jan 10, 2025
3ae3659
Remove Advent calendar from README (#36777)
cinnamon-msft Jan 10, 2025
a665975
[AdvancedPaste]Add all BitmapDecoder supported image filetypes to Ima…
daverayment Jan 13, 2025
aa9f3bb
[AOT]Clean up some AOT build issues in PowerAccent.Core (#36264)
moooyo Jan 13, 2025
df48a33
[WinUI3]Fix Windows 10 title bar borders (#36429)
pingzing Jan 13, 2025
4951a63
[QuickAccent]Fix unstable language loading (#36721)
jaimecbernardo Jan 13, 2025
8896cf8
[Peek]Bring into foreground if previously minimized (#36506)
asif4318 Jan 13, 2025
f11c885
Update Run docs README (#36857)
cinnamon-msft Jan 13, 2025
80461c0
[Monaco]Make minimap toggleable (#33742)
PesBandi Jan 14, 2025
3a10fac
[Monaco]Fix Json format preview setting (#36867)
jaimecbernardo Jan 14, 2025
162096c
[KBM]Added option for exact match shortcut (#36000)
mantaionut Jan 15, 2025
5bb9855
[Deps][Security]Update .NET Packages from 9.0.0 to 9.0.1 (#36879)
snickler Jan 15, 2025
315059f
[Peek]Fix using the correct Monaco assets at runtime (#36890)
jaimecbernardo Jan 15, 2025
603379a
[Workspaces] fixing bug: editor starts outside of visible desktop are…
donlaci Jan 16, 2025
f5f332c
[Workspaces] Saving app properties on launch and recapture (#36751)
donlaci Jan 16, 2025
39bcba3
[AdvancedPaste]Use background thread for interactions between runner …
drawbyperpetual Jan 16, 2025
12bb5c2
[VCM]Deprecate the Video Conference Mute utility (#36772)
jaimecbernardo Jan 16, 2025
65e09db
Goodbye friends, you are forever part of the team (#36905)
crutkas Jan 16, 2025
21fd509
[New utility]Sysinternals ZoomIt (#35880)
jaimecbernardo Jan 16, 2025
41803cc
[PTRun]Add hotkey to the show telemetry event (#36869)
jaimecbernardo Jan 16, 2025
e7abd34
[PTRun]Update the code for .NET 9.0.1 - remove workarounds (#36909)
mantaionut Jan 17, 2025
44f170d
[RegistryPreview]Copy context menu, data tooltip, MULTI_SZ fix (#36631)
htcfreek Jan 17, 2025
1aaf764
[MWB] - refactoring "Common" classes - Common.Log.cs, Common.Receiver…
mikeclayton Jan 17, 2025
458e5c5
[PTRun]Add setting for different trigonometric units in Calculator (#…
OldUser101 Jan 17, 2025
5b2e42b
[ci]Remove steps to build abstracted utilities packages (#36934)
jaimecbernardo Jan 17, 2025
403060e
[Settings]Update GPO infobar icon, improve some pages and fix bugs (#…
htcfreek Jan 19, 2025
9e1242e
[Common]NotificationUtil helper class with FileWatcher (#36720)
davidegiacometti Jan 19, 2025
b6e2fc1
[PTRun][Docs]Add YubicoOauthOTP to Third-Party plugins (#36761)
dlnilsson Jan 19, 2025
ddcad65
[PTRun]Fixed typo in Value Generator messages (#36951)
OldUser101 Jan 19, 2025
4d787e9
[AOT] Clean up some AOT issues in Advanced Paste module (#36297)
moooyo Jan 21, 2025
b33e0be
[ZoomIt]React to gpo setting when run as standalone (#36975)
jaimecbernardo Jan 21, 2025
438d173
[Settings]ImageResizer settings accessibility updates, fixes and refa…
daverayment Jan 21, 2025
eeb72b9
[Settings]Update "Back up" mentions when it should be used as a verb …
JackStuart Jan 21, 2025
b100d8b
[New+]Update last modified date to now for all templates created (#36…
cgaarden Jan 21, 2025
ab8df1a
[ImageResizer][ci]Fix XAML style errors (#37009)
jaimecbernardo Jan 22, 2025
318cb32
[Settings] Add "new" labels to navigation for new utilities (#36939)
cinnamon-msft Jan 22, 2025
422096b
[MWB]Fix helper process termination issue in service mode (#36892)
YDKK Jan 22, 2025
b6b941c
[runner]Fix crashes caused by wrong setting AllowDataDiagnostics regi…
stefansjfw Jan 22, 2025
0efdc94
[PTRun][Calculator]Error check when loading trigonometry mode (#37033)
jaimecbernardo Jan 23, 2025
eeeabc8
[ZoomIt]Fix transparent draw after changing another setting (#37042)
jaimecbernardo Jan 23, 2025
fb35c93
[Settings]Fix ZoomIt page changing current directory (#37052)
jaimecbernardo Jan 24, 2025
2c069ce
[ci]Remove vc tools version workaround (#37098)
jaimecbernardo Jan 27, 2025
5fe7619
0.88 changelog (#37056)
jaimecbernardo Jan 28, 2025
e94a7db
Merge remote-tracking branch 'mainPT/main' into stefan/merge_pt_9
stefansjfw Jan 29, 2025
59381ee
[check-spelling] Update metadata
stefansjfw Jan 29, 2025
d387836
Merge remote-tracking branch 'origin/main' into stefan/merge_pt_9
stefansjfw Jan 29, 2025
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
Prev Previous commit
Next Next commit
[AdvancedPaste]Use background thread for interactions between runner …
…and Advanced Paste (microsoft#36858)

* [Advanced Paste] Use background thread for runner-Advanced Paste interaction

* Fixed typo
drawbyperpetual authored Jan 16, 2025
commit 39bcba34d1223b59e549eb96c55bd35452eef52b
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.props" Condition="Exists('..\..\..\..\packages\Microsoft.Windows.CppWinRT.2.0.240111.5\build\native\Microsoft.Windows.CppWinRT.props')" />
<Target Name="GenerateResourceFiles" BeforeTargets="PrepareForBuild">
<Exec Command="powershell -NonInteractive -executionpolicy Unrestricted $(SolutionDir)tools\build\convert-resx-to-rc.ps1 $(MSBuildThisFileDirectory) resource.base.h resource.h AdvancedPaste.base.rc AdvancedPaste.rc" />
@@ -41,13 +40,15 @@
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="AdvancedPasteConstants.h" />
<ClInclude Include="AdvancedPasteProcessManager.h" />
<ClInclude Include="pch.h" />
<None Include="packages.config" />
<None Include="resource.base.h" />
<ClInclude Include="trace.h" />
<ClInclude Include="Generated Files\resource.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="AdvancedPasteProcessManager.cpp" />
<ClCompile Include="dllmain.cpp" />
<ClCompile Include="pch.cpp">
<PrecompiledHeader Condition="'$(UsePrecompiledHeaders)' != 'false'">Create</PrecompiledHeader>
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
@@ -31,6 +30,9 @@
<ClInclude Include="trace.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="AdvancedPasteProcessManager.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="dllmain.cpp">
@@ -42,6 +44,9 @@
<ClCompile Include="trace.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="AdvancedPasteProcessManager.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<None Include="resource.base.h">
Original file line number Diff line number Diff line change
@@ -0,0 +1,267 @@
#include "pch.h"
#include "AdvancedPasteProcessManager.h"

#include <common/logger/logger.h>
#include <common/utils/winapi_error.h>
#include <common/interop/shared_constants.h>
#include <atlstr.h>

namespace
{
std::optional<std::wstring> get_pipe_name(const std::wstring& prefix)
{
UUID temp_uuid;
wchar_t* uuid_chars = nullptr;
if (UuidCreate(&temp_uuid) == RPC_S_UUID_NO_ADDRESS)
{
const auto val = get_last_error_message(GetLastError());
Logger::error(L"UuidCreate cannot create guid. {}", val.has_value() ? val.value() : L"");
return std::nullopt;
}
else if (UuidToString(&temp_uuid, reinterpret_cast<RPC_WSTR*>(&uuid_chars)) != RPC_S_OK)
{
const auto val = get_last_error_message(GetLastError());
Logger::error(L"UuidToString cannot convert to string. {}", val.has_value() ? val.value() : L"");
return std::nullopt;
}

const auto pipe_name = std::format(L"{}{}", prefix, std::wstring(uuid_chars));
RpcStringFree(reinterpret_cast<RPC_WSTR*>(&uuid_chars));

return pipe_name;
}
}

void AdvancedPasteProcessManager::start()
{
m_enabled = true;
submit_task([this]() { refresh(); });
}

void AdvancedPasteProcessManager::stop()
{
m_enabled = false;
submit_task([this]() { refresh(); });
}

void AdvancedPasteProcessManager::send_message(const std::wstring& message_type, const std::wstring& message_arg)
{
submit_task([this, message_type, message_arg] {
send_named_pipe_message(message_type, message_arg);
});
}

void AdvancedPasteProcessManager::bring_to_front()
{
submit_task([this] {
if (!is_process_running())
{
return;
}

const auto enum_windows = [](HWND hwnd, LPARAM param) -> BOOL {
const auto process_handle = reinterpret_cast<HANDLE>(param);
DWORD window_process_id = 0;

GetWindowThreadProcessId(hwnd, &window_process_id);
if (GetProcessId(process_handle) == window_process_id)
{
SetForegroundWindow(hwnd);
return FALSE;
}
return TRUE;
};

EnumWindows(enum_windows, reinterpret_cast<LPARAM>(m_hProcess));
});
}

void AdvancedPasteProcessManager::submit_task(std::function<void()> task)
{
m_thread_executor.submit(OnThreadExecutor::task_t{ task });
}

bool AdvancedPasteProcessManager::is_process_running() const
{
return m_hProcess != 0 && WaitForSingleObject(m_hProcess, 0) == WAIT_TIMEOUT;
}

void AdvancedPasteProcessManager::terminate_process()
{
if (m_hProcess != 0)
{
TerminateProcess(m_hProcess, 1);
CloseHandle(m_hProcess);
m_hProcess = 0;
}
}

HRESULT AdvancedPasteProcessManager::start_process(const std::wstring& pipe_name)
{
const unsigned long powertoys_pid = GetCurrentProcessId();

const auto executable_args = std::format(L"{} {}", std::to_wstring(powertoys_pid), pipe_name);

SHELLEXECUTEINFOW sei{ sizeof(sei) };
sei.fMask = { SEE_MASK_NOCLOSEPROCESS | SEE_MASK_FLAG_NO_UI };
sei.lpFile = L"WinUI3Apps\\PowerToys.AdvancedPaste.exe";
sei.nShow = SW_SHOWNORMAL;
sei.lpParameters = executable_args.data();
if (ShellExecuteExW(&sei))
{
Logger::trace("Successfully started Advanced Paste process");
terminate_process();
m_hProcess = sei.hProcess;
return S_OK;
}
else
{
Logger::error(L"Advanced Paste process failed to start. {}", get_last_error_or_default(GetLastError()));
return E_FAIL;
}
}

HRESULT AdvancedPasteProcessManager::start_named_pipe_server(const std::wstring& pipe_name)
{
m_write_pipe = nullptr;

const constexpr DWORD BUFSIZE = 4096 * 4;

const auto full_pipe_name = std::format(L"\\\\.\\pipe\\{}", pipe_name);

const auto hPipe = CreateNamedPipe(
full_pipe_name.c_str(), // pipe name
PIPE_ACCESS_OUTBOUND | // write access
FILE_FLAG_OVERLAPPED, // overlapped mode
PIPE_TYPE_MESSAGE | // message type pipe
PIPE_READMODE_MESSAGE | // message-read mode
PIPE_WAIT, // blocking mode
1, // max. instances
BUFSIZE, // output buffer size
0, // input buffer size
0, // client time-out
NULL); // default security attribute

if (hPipe == NULL || hPipe == INVALID_HANDLE_VALUE)
{
Logger::error(L"Error creating handle for named pipe");
return E_FAIL;
}

// Create overlapped event to wait for client to connect to pipe.
OVERLAPPED overlapped = { 0 };
overlapped.hEvent = CreateEvent(nullptr, true, false, nullptr);
if (!overlapped.hEvent)
{
Logger::error(L"Error creating overlapped event for named pipe");
CloseHandle(hPipe);
return E_FAIL;
}

const auto clean_up_and_fail = [&]() {
CloseHandle(overlapped.hEvent);
CloseHandle(hPipe);
return E_FAIL;
};

if (!ConnectNamedPipe(hPipe, &overlapped))
{
const auto lastError = GetLastError();

if (lastError != ERROR_IO_PENDING && lastError != ERROR_PIPE_CONNECTED)
{
Logger::error(L"Error connecting to named pipe");
return clean_up_and_fail();
}
}

// Wait for client.
const constexpr DWORD client_timeout_millis = 5000;
switch (WaitForSingleObject(overlapped.hEvent, client_timeout_millis))
{
case WAIT_OBJECT_0:
{
DWORD bytes_transferred = 0;
if (GetOverlappedResult(hPipe, &overlapped, &bytes_transferred, FALSE))
{
CloseHandle(overlapped.hEvent);
m_write_pipe = std::make_unique<CAtlFile>(hPipe);

Logger::trace(L"Advanced Paste successfully connected to named pipe");

return S_OK;
}
else
{
Logger::error(L"Error waiting for Advanced Paste to connect to named pipe");
return clean_up_and_fail();
}
}

case WAIT_TIMEOUT:
case WAIT_FAILED:
default:
Logger::error(L"Error waiting for Advanced Paste to connect to named pipe");
return clean_up_and_fail();
}
}

void AdvancedPasteProcessManager::refresh()
{
if (m_enabled == is_process_running())
{
return;
}

if (m_enabled)
{
Logger::trace(L"Starting Advanced Paste process");

const auto pipe_name = get_pipe_name(L"powertoys_advanced_paste_");

if (!pipe_name)
{
return;
}

if (start_process(pipe_name.value()) != S_OK)
{
return;
}

if (start_named_pipe_server(pipe_name.value()) != S_OK)
{
Logger::error(L"Named pipe initialization failed; terminating Advanced Paste process");
terminate_process();
}
}
else
{
Logger::trace(L"Exiting Advanced Paste process");

send_named_pipe_message(CommonSharedConstants::ADVANCED_PASTE_TERMINATE_APP_MESSAGE);
WaitForSingleObject(m_hProcess, 5000);

if (is_process_running())
{
Logger::error(L"Advanced Paste process failed to gracefully exit; terminating");
}
else
{
Logger::trace(L"Advanced Paste process successfully exited");
}

terminate_process();
}
}

void AdvancedPasteProcessManager::send_named_pipe_message(const std::wstring& message_type, const std::wstring& message_arg)
{
if (m_write_pipe)
{
const auto message = message_arg.empty() ? std::format(L"{}\r\n", message_type) : std::format(L"{} {}\r\n", message_type, message_arg);

const CString file_name(message.c_str());
m_write_pipe->Write(file_name, file_name.GetLength() * sizeof(TCHAR));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#pragma once
#include "pch.h"
#include <common/utils/OnThreadExecutor.h>
#include <atlfile.h>
#include <string>
#include <atomic>
#include <memory>
#include <functional>
#include <optional>

class AdvancedPasteProcessManager
{
public:
AdvancedPasteProcessManager() = default;
AdvancedPasteProcessManager(const AdvancedPasteProcessManager&) = delete;
AdvancedPasteProcessManager& operator=(const AdvancedPasteProcessManager&) = delete;

void start();
void stop();
void send_message(const std::wstring& message_type, const std::wstring& message_arg = L"");
void bring_to_front();

private:
void submit_task(std::function<void()> task);
bool is_process_running() const;
void terminate_process();
HRESULT start_process(const std::wstring& pipe_name);
HRESULT start_named_pipe_server(const std::wstring& pipe_name);
void refresh();
void send_named_pipe_message(const std::wstring& message_type, const std::wstring& message_arg = L"");

OnThreadExecutor m_thread_executor; // all internal operations are done on background thread with task queue
std::atomic<bool> m_enabled = false; // written on main thread, read on background thread
HANDLE m_hProcess = 0;
std::unique_ptr<CAtlFile> m_write_pipe;
};
Loading