diff --git a/src/config.c b/src/config.c index bda66d417..eebc4462e 100644 --- a/src/config.c +++ b/src/config.c @@ -561,6 +561,7 @@ load_general(void) kbd_req_capture = config_get_int(cat, "kbd_req_capture", 0); hide_status_bar = config_get_int(cat, "hide_status_bar", 0); + hide_tool_bar = config_get_int(cat, "hide_tool_bar", 0); confirm_reset = config_get_int(cat, "confirm_reset", 1); confirm_exit = config_get_int(cat, "confirm_exit", 1); @@ -2036,6 +2037,7 @@ config_load(void) kbd_req_capture = 0; hide_status_bar = 0; + hide_tool_bar = 0; scale = 1; machine = machine_get_machine_from_internal_name("ibmpc"); dpi_scale = 1; @@ -2222,6 +2224,11 @@ save_general(void) else config_delete_var(cat, "hide_status_bar"); + if (hide_tool_bar != 0) + config_set_int(cat, "hide_tool_bar", hide_tool_bar); + else + config_delete_var(cat, "hide_tool_bar"); + if (confirm_reset != 1) config_set_int(cat, "confirm_reset", confirm_reset); else diff --git a/src/include/86box/plat.h b/src/include/86box/plat.h index 3b196eef0..c60e6d922 100644 --- a/src/include/86box/plat.h +++ b/src/include/86box/plat.h @@ -92,7 +92,7 @@ extern int update_icons; extern int unscaled_size_x, /* current unscaled size X */ unscaled_size_y; /* current unscaled size Y */ -extern int kbd_req_capture, hide_status_bar; +extern int kbd_req_capture, hide_status_bar, hide_tool_bar; /* System-related functions. */ extern char *fix_exe_path(char *str); diff --git a/src/unix/unix.c b/src/unix/unix.c index f707757fb..3727e1f63 100644 --- a/src/unix/unix.c +++ b/src/unix/unix.c @@ -40,6 +40,7 @@ int rctrl_is_lalt; int update_icons; int kbd_req_capture; int hide_status_bar; +int hide_tool_bar; int fixed_size_x = 640; int fixed_size_y = 480; extern int title_set; diff --git a/src/win/win.c b/src/win/win.c index 27386b5b7..a4854f65f 100644 --- a/src/win/win.c +++ b/src/win/win.c @@ -450,9 +450,6 @@ WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpszArg, int nCmdShow) { char **argv = NULL; int argc, i; - wchar_t * AppID = L"86Box.86Box\0"; - - SetCurrentProcessExplicitAppUserModelID(AppID); /* Initialize the COM library for the main thread. */ CoInitializeEx(NULL, COINIT_MULTITHREADED); diff --git a/src/win/win_ui.c b/src/win/win_ui.c index 40f9068b0..f866ed5bf 100644 --- a/src/win/win_ui.c +++ b/src/win/win_ui.c @@ -65,6 +65,7 @@ int user_resize = 0; int fixed_size_x = 0, fixed_size_y = 0; int kbd_req_capture = 0; int hide_status_bar = 0; +int hide_tool_bar = 0; int dpi = 96; extern char openfilestring[512]; @@ -92,6 +93,13 @@ static dllimp_t user32_imports[] = { { NULL, NULL } }; +/* Taskbar application ID API, Windows 7+ */ +void* shell32_handle = NULL; +static HRESULT (WINAPI *pSetCurrentProcessExplicitAppUserModelID)(PCWSTR AppID); +static dllimp_t shell32_imports[]= { +{ "SetCurrentProcessExplicitAppUserModelID", &pSetCurrentProcessExplicitAppUserModelID } +}; + int win_get_dpi(HWND hwnd) { if (user32_handle != NULL) { @@ -1244,6 +1252,11 @@ ui_init(int nCmdShow) /* Load DPI related Windows 10 APIs */ user32_handle = dynld_module("user32.dll", user32_imports); + /* Set the application ID for the taskbar. */ + shell32_handle = dynld_module("shell32.dll", shell32_imports); + if (shell32_handle) + pSetCurrentProcessExplicitAppUserModelID(L"86Box.86Box"); + /* Set up TaskDialog configuration. */ tdconfig.cbSize = sizeof(tdconfig); tdconfig.dwFlags = TDF_ENABLE_HYPERLINKS;