diff --git a/include/wx/hyperlink.h b/include/wx/hyperlink.h index 237dadca85..072c05efd3 100644 --- a/include/wx/hyperlink.h +++ b/include/wx/hyperlink.h @@ -76,6 +76,9 @@ protected: void CheckParams(const wxString& label, const wxString& url, long style); public: + // Send wxHyperlinkEvent and open our link in the default browser if it + // wasn't handled. + // // not part of the public API but needs to be public as used by // GTK+ callbacks: void SendEvent(); diff --git a/src/msw/hyperlink.cpp b/src/msw/hyperlink.cpp index f39d94ae17..adb922de74 100644 --- a/src/msw/hyperlink.cpp +++ b/src/msw/hyperlink.cpp @@ -174,7 +174,12 @@ bool wxHyperlinkCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result) case NM_RETURN: SetVisited(); SendEvent(); - return 0; + + // SendEvent() launches the browser by default, so we consider + // that the event was processed in any case, either by user + // code or by wx itself, hence we always return true to + // indicate that the default processing shouldn't take place. + return true; } }