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