diff --git a/Telegram/SourceFiles/pspecific_wnd.cpp b/Telegram/SourceFiles/pspecific_wnd.cpp index 2ea13bc9a..6fbbb4105 100644 --- a/Telegram/SourceFiles/pspecific_wnd.cpp +++ b/Telegram/SourceFiles/pspecific_wnd.cpp @@ -714,13 +714,15 @@ namespace { setupUx(); setupShell(); setupWtsapi(); + setupPropSys(); setupCombase(); + + useTheme = !!setWindowTheme; } void setupUx() { HINSTANCE procId = LoadLibrary(L"UXTHEME.DLL"); - if (!loadFunction(procId, "SetWindowTheme", setWindowTheme)) return; - useTheme = true; + loadFunction(procId, "SetWindowTheme", setWindowTheme); } void setupShell() { HINSTANCE procId = LoadLibrary(L"SHELL32.DLL"); @@ -758,7 +760,12 @@ namespace { HINSTANCE procId = LoadLibrary(L"COMBASE.DLL"); setupToast(procId); } + void setupPropSys() { + HINSTANCE procId = LoadLibrary(L"PROPSYS.DLL"); + if (!loadFunction(procId, "PropVariantToString", procId)) return; + } void setupToast(HINSTANCE procId) { + if (!propVariantToString) return; if (QSysInfo::windowsVersion() < QSysInfo::WV_WINDOWS8) return; if (!loadFunction(procId, "RoGetActivationFactory", roGetActivationFactory)) return; @@ -766,9 +773,6 @@ namespace { if (!loadFunction(otherProcId, "WindowsCreateStringReference", windowsCreateStringReference)) return; if (!loadFunction(otherProcId, "WindowsDeleteString", windowsDeleteString)) return; - HINSTANCE otherOtherProcId = LoadLibrary(L"PROPSYS.DLL"); - if (!loadFunction(otherOtherProcId, "PropVariantToString", propVariantToString)) return; - useToast = true; } }; @@ -2822,6 +2826,8 @@ QString pinnedPath() { } void CheckPinnedAppUserModelId() { + if (!propVariantToString) return; + static const int maxFileLen = MAX_PATH * 10; HRESULT hr = CoInitialize(0);