- if (m_helpFile == T("")) return FALSE;
-
- wxString str = m_helpFile;
- size_t len = str.Length();
- if (!(str[(size_t)(len-1)] == T('p') && str[(size_t)(len-2)] == T('l') && str[(size_t)(len-3)] == T('h') && str[(size_t)(len-4)] == T('.')))
- str += T(".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);