- if (m_helpFile == wxT("")) return FALSE;
-
- wxString str = m_helpFile;
- size_t len = str.Length();
- if (!(str[(size_t)(len-1)] == wxT('p') && str[(size_t)(len-2)] == wxT('l') && str[(size_t)(len-3)] == wxT('h') && str[(size_t)(len-4)] == wxT('.')))
- str += wxT(".hlp");
-
- if (wxTheApp->GetTopWindow())
- {
-#if defined(__WIN95__)
- WinHelp((HWND) wxTheApp->GetTopWindow()->GetHWND(), (const wxChar*) str, HELP_FINDER, 0L);
-#else
- WinHelp((HWND) wxTheApp->GetTopWindow()->GetHWND(), (const wxChar*) str, HELP_CONTENTS, 0L);
-#endif
- return TRUE;
- }
- return FALSE;
+ if (m_helpFile.empty()) return false;
+
+ wxString str = GetValidFilename(m_helpFile);
+
+ return (WinHelp(GetSuitableHWND(this), (const wxChar*) str, HELP_FINDER, 0L) != 0);