refactor: DwmGetColorizationColor does not have to be dynamically resolved
This commit is contained in:
parent
e922b1733b
commit
adaa32003d
3 changed files with 3 additions and 6 deletions
|
@ -50,11 +50,6 @@ class SystemPreferences : public mate::EventEmitter<SystemPreferences>
|
||||||
#if defined(OS_WIN)
|
#if defined(OS_WIN)
|
||||||
bool IsAeroGlassEnabled();
|
bool IsAeroGlassEnabled();
|
||||||
|
|
||||||
typedef HRESULT(STDAPICALLTYPE* DwmGetColorizationColor)(DWORD*, BOOL*);
|
|
||||||
DwmGetColorizationColor dwmGetColorizationColor =
|
|
||||||
(DwmGetColorizationColor)GetProcAddress(LoadLibraryW(L"dwmapi.dll"),
|
|
||||||
"DwmGetColorizationColor");
|
|
||||||
|
|
||||||
std::string GetAccentColor();
|
std::string GetAccentColor();
|
||||||
std::string GetColor(const std::string& color, mate::Arguments* args);
|
std::string GetColor(const std::string& color, mate::Arguments* args);
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
// Use of this source code is governed by the MIT license that can be
|
// Use of this source code is governed by the MIT license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
|
#include <dwmapi.h>
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
|
|
||||||
#include "atom/browser/api/atom_api_system_preferences.h"
|
#include "atom/browser/api/atom_api_system_preferences.h"
|
||||||
|
@ -38,7 +39,7 @@ std::string SystemPreferences::GetAccentColor() {
|
||||||
DWORD color = 0;
|
DWORD color = 0;
|
||||||
BOOL opaque = FALSE;
|
BOOL opaque = FALSE;
|
||||||
|
|
||||||
if (FAILED(dwmGetColorizationColor(&color, &opaque))) {
|
if (FAILED(DwmGetColorizationColor(&color, &opaque))) {
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -363,6 +363,7 @@
|
||||||
],
|
],
|
||||||
'link_settings': {
|
'link_settings': {
|
||||||
'libraries': [
|
'libraries': [
|
||||||
|
'-ldwmapi.lib',
|
||||||
'-limm32.lib',
|
'-limm32.lib',
|
||||||
'-lgdi32.lib',
|
'-lgdi32.lib',
|
||||||
'-loleacc.lib',
|
'-loleacc.lib',
|
||||||
|
|
Loading…
Reference in a new issue