mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 11:48:06 +01:00
FancyZones and Shortcut Guide initial commit
Co-authored-by: Alexis Campailla <alexis@janeasystems.com> Co-authored-by: Bret Anderson <bretan@microsoft.com> Co-authored-by: Enrico Giordani <enrico.giordani@gmail.com> Co-authored-by: Jaime Bernardo <jaime@janeasystems.com> Co-authored-by: Jeff Bogdan <jeffbog@microsoft.com> Co-authored-by: March Rogers <marchr@microsoft.com> Co-authored-by: Mike Harsh <mharsh@microsoft.com> Co-authored-by: Nachum Bundak <Nachum.Bundak@microsoft.com> Co-authored-by: Oliver Jones <ojones@microsoft.com> Co-authored-by: Patrick Little <plittle@microsoft.com>
This commit is contained in:
committed by
Bartosz Sosnowski
parent
10c5396099
commit
8431b80e48
24
src/runner/powertoy_module.cpp
Normal file
24
src/runner/powertoy_module.cpp
Normal file
@@ -0,0 +1,24 @@
|
||||
#include "pch.h"
|
||||
#include "powertoy_module.h"
|
||||
#include "lowlevel_keyboard_event.h"
|
||||
#include <algorithm>
|
||||
|
||||
std::unordered_map<std::wstring, PowertoyModule>& modules() {
|
||||
static std::unordered_map<std::wstring, PowertoyModule> modules;
|
||||
return modules;
|
||||
}
|
||||
|
||||
PowertoyModule load_powertoy(const std::wstring& filename) {
|
||||
auto handle = winrt::check_pointer(LoadLibraryW(filename.c_str()));
|
||||
auto create = reinterpret_cast<powertoy_create_func>(GetProcAddress(handle, "powertoy_create"));
|
||||
if (!create) {
|
||||
FreeLibrary(handle);
|
||||
winrt::throw_last_error();
|
||||
}
|
||||
auto module = create();
|
||||
if (!module) {
|
||||
FreeLibrary(handle);
|
||||
winrt::throw_last_error();
|
||||
}
|
||||
return PowertoyModule(module, handle);
|
||||
}
|
||||
Reference in New Issue
Block a user