From 9f5956d456d41c7a925c78eedf182c7ad4b61c18 Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Fri, 19 Jun 2020 00:34:56 -0300 Subject: [PATCH] Add website to about dialog --- src/include/86box/86box.h | 3 ++- src/win/win_about.c | 12 ++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/include/86box/86box.h b/src/include/86box/86box.h index 9fd301138..bbb37895e 100644 --- a/src/include/86box/86box.h +++ b/src/include/86box/86box.h @@ -43,7 +43,8 @@ #define COPYRIGHT_YEAR "2020" /* Web URL info. */ -#define EMU_ROMS_URL "https://github.com/86Box/roms/releases/latest" +#define EMU_SITE L"86box.github.io" +#define EMU_ROMS_URL L"https://github.com/86Box/roms/releases/latest" /* Filename and pathname info. */ #define CONFIG_FILE L"86box.cfg" diff --git a/src/win/win_about.c b/src/win/win_about.c index bc4beda7d..b09efa478 100644 --- a/src/win/win_about.c +++ b/src/win/win_about.c @@ -35,8 +35,12 @@ void AboutDialogCreate(HWND hwnd) { + int i; TASKDIALOGCONFIG tdconfig = {0}; - TASKDIALOG_BUTTON tdbuttons[] = {{IDCANCEL, MAKEINTRESOURCE(IDS_2127)}}; + TASKDIALOG_BUTTON tdbuttons[] = { + {IDOK, EMU_SITE}, + {IDCANCEL, MAKEINTRESOURCE(IDS_2127)} + }; tdconfig.cbSize = sizeof(tdconfig); tdconfig.hwndParent = hwnd; @@ -48,5 +52,9 @@ AboutDialogCreate(HWND hwnd) tdconfig.pszContent = MAKEINTRESOURCE(IDS_2126); tdconfig.cButtons = ARRAYSIZE(tdbuttons); tdconfig.pButtons = tdbuttons; - TaskDialogIndirect(&tdconfig, NULL, NULL, NULL); + tdconfig.nDefaultButton = IDCANCEL; + TaskDialogIndirect(&tdconfig, &i, NULL, NULL); + + if (i == IDOK) + ShellExecute(hwnd, L"open", L"https://" EMU_SITE, NULL, NULL, SW_SHOW); }