Skip to content
This repository was archived by the owner on Dec 20, 2022. It is now read-only.

Commit

Permalink
Fix help file location
Browse files Browse the repository at this point in the history
Read the help file from the same directory as the exe, not the current
directory.
  • Loading branch information
adoxa committed Dec 14, 2020
1 parent cb04bba commit 7a8ef45
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Armageddon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11309,7 +11309,8 @@ LRESULT CALLBACK DialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam
{
hwndMain = GetDesktopWindow();
}
GetCurrentDirectory(MAX_PATH, dbuffer);
GetModuleFileName(NULL, dbuffer, MAX_PATH);
*strrchr(dbuffer, '\\') = '\0';
// Global dialog handle
hwndDlgA = hwndDlg;
// Load our Icons for the main dialog box
Expand Down Expand Up @@ -11874,8 +11875,7 @@ LRESULT CALLBACK DialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam
case IDC_HELP:
{
TCHAR buffer[BUFSIZE] = TEXT("");
strcpy((char *)&buffer, (char *)&dbuffer);
strcat((char *)&buffer, "\\ArmaGeddon.chm");
sprintf(buffer, "%s\\ArmaGeddon.chm", dbuffer);
HINSTANCE hinsts = ShellExecute(hwndDlg, "Open", buffer, NULL, NULL, SW_SHOWNORMAL);
if ((int)hinsts == ERROR_FILE_NOT_FOUND)
{
Expand Down

0 comments on commit 7a8ef45

Please sign in to comment.