]> git.saurik.com Git - wxWidgets.git/commitdiff
Use generic wxHyperlinkCtrl under Vista/7 without comtrl32.dll v6.
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 22 Dec 2010 13:56:49 +0000 (13:56 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 22 Dec 2010 13:56:49 +0000 (13:56 +0000)
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

index 1eb3fb2ca18472371ffbcc681111e6f69c07984e..ff2e8e9ccc7b1bea97943c9db1ed1408cf80a715 100644 (file)
@@ -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;