From acd0b94c38adb10461dbd68b04797efb7f868800 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 22 Dec 2010 13:56:49 +0000 Subject: [PATCH] Use generic wxHyperlinkCtrl under Vista/7 without comtrl32.dll v6. Replace the test for the OS version with the test for comtrl32.dll version in HasNativeHyperlinkCtrl() wxMSW function as the native control could be not available even under Vista/7 if we're not using comtrl32.dll v6 and this can happen if the program was linked without the appropriate manifest or, possibly more likely, if a DLL using wxWidgets was loaded by such a program. Closes #12711. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@66425 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/hyperlink.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/msw/hyperlink.cpp b/src/msw/hyperlink.cpp index 1eb3fb2ca1..ff2e8e9ccc 100644 --- a/src/msw/hyperlink.cpp +++ b/src/msw/hyperlink.cpp @@ -54,7 +54,10 @@ namespace { bool HasNativeHyperlinkCtrl() { - return wxGetWinVersion() >= wxWinVersion_XP; + // Notice that we really must test comctl32.dll version and not the OS + // version here as even under Vista/7 we could be not using the v6 e.g. + // if the program doesn't have the correct manifest for some reason. + return wxApp::GetComCtl32Version() >= 600; } wxString GetLabelForSysLink(const wxString& text, const wxString& url) @@ -150,7 +153,7 @@ wxSize wxHyperlinkCtrl::DoGetBestClientSize() const { // LM_GETIDEALSIZE only exists under Vista so use the generic version even // when using the native control under XP - if ( wxGetWinVersion() < wxWinVersion_6 ) + if ( !HasNativeHyperlinkCtrl() || (wxGetWinVersion() < wxWinVersion_6) ) return wxGenericHyperlinkCtrl::DoGetBestClientSize(); SIZE idealSize; -- 2.45.2