- // Use context number -- a very rough equivalent to block id!
- if (!m_helpFile) return FALSE;
-
- char buf[_MAXPATHLEN];
- strcpy(buf, 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())
- {
- WinHelp((HWND) wxTheApp->GetTopWindow()->GetHWND(), buf, HELP_CONTEXT, (DWORD)block);
- return TRUE;
- }
- return FALSE;
+ if (m_helpFile.IsEmpty()) return FALSE;
+
+ wxString str = GetValidFilename(m_helpFile);
+
+ return (WinHelp((HWND) wxTheApp->GetTopWindow()->GetHWND(), (const wxChar*) str, HELP_CONTEXTPOPUP, (DWORD) contextId) != 0);