mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 18:57:19 +02:00
* Add GPOWrapper headers and C++/WinRT library * Check GPO before starting utilities * Show message on GPO having disabled preview panes. * Don't generate thumbnails if GPO disabled * Fix FancyZonesEditor unable to recognize GPOWrapper * Move settings view models to the settings project * Use GPO to block enabling utilities in Settings * Hide context menu entries when gpo disables utilities * Apply gpo policies when enabling PowerToys on runner * Add version and metadata to dll * Add GPOWrapper to the installer * Fix MSBuild errors on WPF apps by using Projection * Signing * Add gpo files and publish them * Add GPO policies to the bug report tool * Add some documentation for using GPO * Mention support to actual lowest supported version of Windows * Move PowerToys to the root of administrative templates tree * Save policies on Software\Policies\PowerToys * Support both machine and user scopes * Fix documentation to reference computer and user scopes * Mention incompatibility with outlook in gpo * Set a better folder structure for gpo assets * Move PDF Handler warning to the description * Update doc/gpo/README.md Co-authored-by: Heiko <61519853+htcfreek@users.noreply.github.com> * Add actual minimum version of PowerToys to gpo files * Fix identation * Remove GPOWrapper Readme * Add Active Directory instructions to doc Co-authored-by: Heiko <61519853+htcfreek@users.noreply.github.com>
45 lines
1.4 KiB
C++
45 lines
1.4 KiB
C++
#include "pch.h"
|
|
#include <interface/powertoy_module_interface.h>
|
|
#include "trace.h"
|
|
#include <powerpreview/powerpreviewConstants.h>
|
|
|
|
#include <functional>
|
|
|
|
#include <common/utils/modulesRegistry.h>
|
|
#include <common/SettingsAPI/settings_objects.h>
|
|
#include <common/utils/gpo.h>
|
|
|
|
struct FileExplorerModule
|
|
{
|
|
std::wstring settingName;
|
|
std::wstring settingDescription;
|
|
powertoys_gpo::gpo_rule_configured_t (*checkModuleGPOEnabledRuleFunction)();
|
|
registry::ChangeSet registryChanges;
|
|
};
|
|
|
|
// Implement the PowerToy Module Interface and all the required methods.
|
|
class PowerPreviewModule : public PowertoyModuleIface
|
|
{
|
|
private:
|
|
// The PowerToy state.
|
|
bool m_enabled = false;
|
|
std::wstring m_moduleName;
|
|
// Contains the non localized key of the powertoy
|
|
std::wstring app_key;
|
|
std::vector<FileExplorerModule> m_fileExplorerModules;
|
|
|
|
// Function to warn the user that PowerToys needs to run as administrator for changes to take effect
|
|
void show_update_warning_message();
|
|
void apply_settings(const PowerToysSettings::PowerToyValues& settings);
|
|
public:
|
|
PowerPreviewModule();
|
|
|
|
virtual void destroy();
|
|
virtual const wchar_t* get_name();
|
|
virtual const wchar_t* get_key();
|
|
virtual bool get_config(_Out_ wchar_t* buffer, _Out_ int* buffer_size);
|
|
virtual void set_config(const wchar_t* config);
|
|
virtual void enable();
|
|
virtual void disable();
|
|
virtual bool is_enabled();
|
|
}; |