From cefec54dec3fb9cda93dd0a2c85e56891afe13e2 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 25 Aug 2013 15:49:07 +0000 Subject: Windows XP related fixes git-svn-id: http://svn.miranda-ng.org/main/trunk@5830 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/ShellExt/src/main.cpp | 17 +++++++++++------ plugins/ShellExt/src/shlcom.cpp | 6 +++--- plugins/ShellExt/src/stdafx.h | 1 + 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/plugins/ShellExt/src/main.cpp b/plugins/ShellExt/src/main.cpp index cfeba378d8..9e5d6df1a6 100644 --- a/plugins/ShellExt/src/main.cpp +++ b/plugins/ShellExt/src/main.cpp @@ -64,16 +64,21 @@ STDAPI DllRegisterServer() return E_FAIL; if ( RegSetValueA(k1, "CLSID", REG_SZ, str2, sizeof(str2))) return E_FAIL; - if ( RegSetValueA(k1, "{72013A26-A94C-11d6-8540-A5E62932711D}", REG_SZ, str3, sizeof(str3))) + + HRegKey k11(HKEY_CLASSES_ROOT, "CLSID\\{72013A26-A94C-11d6-8540-A5E62932711D}"); + if (k11 == NULL) + return E_FAIL; + + if ( RegSetValueA(k11, NULL, REG_SZ, str3, sizeof(str3))) return E_FAIL; - if ( RegSetValueA(k1, "{72013A26-A94C-11d6-8540-A5E62932711D}\\ProgID", REG_SZ, str3, sizeof(str3))) + if ( RegSetValueA(k11, "ProgID", REG_SZ, str3, sizeof(str3))) return E_FAIL; - char tszFileName[MAX_PATH]; - GetModuleFileNameA(hInst, tszFileName, SIZEOF(tszFileName)); - if ( RegSetValueA(k1, "{72013A26-A94C-11d6-8540-A5E62932711D}\\InprocServer32", REG_SZ, tszFileName, lstrlenA(tszFileName))) + TCHAR tszFileName[MAX_PATH]; + GetModuleFileName(hInst, tszFileName, SIZEOF(tszFileName)); + if ( RegSetValue(k11, _T("InprocServer32"), REG_SZ, tszFileName, lstrlen(tszFileName))) return E_FAIL; - if ( RegSetValueA(k1, "{72013A26-A94C-11d6-8540-A5E62932711D}\\InprocServer32\\ThreadingModel", REG_SZ, str4, sizeof(str4))) + if ( RegSetValueA(k11, "InprocServer32\\ThreadingModel", REG_SZ, str4, sizeof(str4))) return E_FAIL; if ( RegSetValueA(HKEY_CLASSES_ROOT, "*\\shellex\\ContextMenuHandlers\\miranda.shlext", REG_SZ, str2, sizeof(str2))) diff --git a/plugins/ShellExt/src/shlcom.cpp b/plugins/ShellExt/src/shlcom.cpp index b9d9be7191..46a1aebc65 100644 --- a/plugins/ShellExt/src/shlcom.cpp +++ b/plugins/ShellExt/src/shlcom.cpp @@ -940,11 +940,11 @@ HRESULT TShlComRec::HandleMenuMsg2(UINT uMsg, WPARAM wParam, LPARAM lParam, LRES // don't check if it's really a menu MEASUREITEMSTRUCT *msi = (MEASUREITEMSTRUCT*)lParam; TMenuDrawInfo *psd = (TMenuDrawInfo*)msi->itemData; - NONCLIENTMETRICSA ncm; - ncm.cbSize = sizeof(ncm); + NONCLIENTMETRICS ncm; + ncm.cbSize = (VistaOrLater) ? sizeof(ncm) : offsetof(NONCLIENTMETRICS, iPaddedBorderWidth); SystemParametersInfo(SPI_GETNONCLIENTMETRICS, 0, &ncm, 0); // create the font used in menus, this font should be cached somewhere really - HFONT hFont = CreateFontIndirectA(&ncm.lfMenuFont); + HFONT hFont = CreateFontIndirect(&ncm.lfMenuFont); // select in the font HFONT hOldFont = (HFONT)SelectObject(hMemDC, hFont); // default to an icon diff --git a/plugins/ShellExt/src/stdafx.h b/plugins/ShellExt/src/stdafx.h index 7fd95475d8..a1238f310f 100644 --- a/plugins/ShellExt/src/stdafx.h +++ b/plugins/ShellExt/src/stdafx.h @@ -6,6 +6,7 @@ #include #include +#include #include -- cgit v1.2.3