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