X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ec080ef1873995bcd9b20b0fc1a6d208a78540d3..4fe83b93a517ca229ff6503eacf81c1177d088e0:/src/msw/hyperlink.cpp?ds=sidebyside diff --git a/src/msw/hyperlink.cpp b/src/msw/hyperlink.cpp index 1eb3fb2ca1..de729770fd 100644 --- a/src/msw/hyperlink.cpp +++ b/src/msw/hyperlink.cpp @@ -24,6 +24,7 @@ #include "wx/hyperlink.h" #ifndef WX_PRECOMP + #include "wx/app.h" #include "wx/stattext.h" #include "wx/msw/wrapcctl.h" // include "properly" #include "wx/msw/private.h" @@ -54,7 +55,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 +154,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;