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
{
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)
{
// 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;