Files
86Box/src/win/win_about.c

81 lines
2.6 KiB
C
Raw Normal View History

/*
* 86Box A hypervisor and IBM PC system emulator that specializes in
* running old operating systems and software designed for IBM
* PC systems and compatibles from 1981 through fairly recent
* system designs based on the PCI bus.
*
* This file is part of the 86Box distribution.
*
* Handle the About dialog.
*
2020-03-25 00:46:02 +02:00
*
*
* Authors: Miran Grca, <mgrca8@gmail.com>
* Fred N. van Kempen, <decwiz@yahoo.com>
*
* Copyright 2016-2018 Miran Grca.
* Copyright 2017-2018 Fred N. van Kempen.
* Copyright 2021-2023 Jasmine Iwanek.
*/
#define UNICODE
#define BITMAP WINDOWS_BITMAP
#include <windows.h>
#include <windowsx.h>
#undef BITMAP
2020-06-18 00:06:15 -03:00
#include <commctrl.h>
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <stdlib.h>
#include <wchar.h>
#include <86box/86box.h>
#include <86box/plat.h>
#include <86box/win.h>
#include <86box/version.h>
void
AboutDialogCreate(HWND hwnd)
{
2022-10-15 13:38:10 -03:00
int i;
TASKDIALOGCONFIG tdconfig = { 0 };
2020-06-19 00:34:56 -03:00
TASKDIALOG_BUTTON tdbuttons[] = {
2022-10-15 13:38:10 -03:00
{IDOK, EMU_SITE_W },
2022-11-09 18:13:33 -05:00
{ IDCANCEL, MAKEINTRESOURCE(IDS_2128)}
2020-06-19 00:34:56 -03:00
};
2020-06-18 00:06:15 -03:00
wchar_t emu_version[256];
2023-02-19 23:05:16 +01:00
i = swprintf(emu_version, sizeof_w(emu_version), L"%ls v%ls", EMU_NAME_W, EMU_VERSION_FULL_W);
#ifdef EMU_GIT_HASH
2023-02-19 23:05:16 +01:00
i += swprintf(&emu_version[i], sizeof_w(emu_version) - i, L" [%ls]", EMU_GIT_HASH_W);
#endif
#if defined(__arm__) || defined(__TARGET_ARCH_ARM)
# define ARCH_STR L"arm"
#elif defined(__aarch64__) || defined(_M_ARM64)
# define ARCH_STR L"arm64"
#elif defined(__i386) || defined(__i386__) || defined(_M_IX86)
# define ARCH_STR L"i386"
#elif defined(__x86_64) || defined(__x86_64__) || defined(__amd64) || defined(_M_X64)
# define ARCH_STR L"x86_64"
#else
# define ARCH_STR L"unknown"
#endif
2023-02-19 23:05:16 +01:00
swprintf(&emu_version[i], sizeof_w(emu_version) - i, L" [%ls, %ls]", ARCH_STR, plat_get_string(IDS_DYNAREC));
2022-10-15 13:38:10 -03:00
tdconfig.cbSize = sizeof(tdconfig);
tdconfig.hwndParent = hwnd;
tdconfig.hInstance = hinstance;
tdconfig.dwCommonButtons = 0;
2022-11-09 18:13:33 -05:00
tdconfig.pszWindowTitle = MAKEINTRESOURCE(IDS_2125);
2022-10-15 13:38:10 -03:00
tdconfig.pszMainIcon = (PCWSTR) 10;
tdconfig.pszMainInstruction = emu_version;
2022-11-09 18:13:33 -05:00
tdconfig.pszContent = MAKEINTRESOURCE(IDS_2127);
2022-10-15 13:38:10 -03:00
tdconfig.cButtons = ARRAYSIZE(tdbuttons);
tdconfig.pButtons = tdbuttons;
tdconfig.nDefaultButton = IDCANCEL;
2020-06-19 00:34:56 -03:00
TaskDialogIndirect(&tdconfig, &i, NULL, NULL);
if (i == IDOK)
2022-10-15 13:38:10 -03:00
ShellExecute(hwnd, L"open", L"https://" EMU_SITE_W, NULL, NULL, SW_SHOW);
}