diff --git a/src/include/86box/win.h b/src/include/86box/win.h index 0bbc99642..4fb6a7d00 100644 --- a/src/include/86box/win.h +++ b/src/include/86box/win.h @@ -217,6 +217,7 @@ extern int MediaMenuHandler(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPara extern HWND hwndRebar; extern void ToolBarCreate(HWND hwndParent, HINSTANCE hInst); extern void ToolBarLoadIcons(); +extern void ToolBarUpdatePause(int paused); /* Functions in win_dialog.c: */ diff --git a/src/win/win_toolbar.c b/src/win/win_toolbar.c index aa1d60cd6..b4ebab0c6 100644 --- a/src/win/win_toolbar.c +++ b/src/win/win_toolbar.c @@ -17,14 +17,14 @@ static wchar_t wTitle[512] = { 0 }; static WNDPROC pOriginalProcedure = NULL; static TBBUTTON buttons[] = { - { 0, IDM_ACTION_PAUSE, TBSTATE_ENABLED, BTNS_BUTTON, { 0 }, 0, 0 }, // Pause + { 1, IDM_ACTION_PAUSE, TBSTATE_ENABLED, BTNS_BUTTON, { 0 }, 0, 0 }, // Pause { 0, 0, TBSTATE_INDETERMINATE, BTNS_SEP, { 0 }, 0, 0 }, - { 1, IDM_ACTION_RESET_CAD, TBSTATE_ENABLED, BTNS_BUTTON, { 0 }, 0, 0 }, // Ctrl+Alt+Del - { 2, IDM_ACTION_CTRL_ALT_ESC, TBSTATE_ENABLED, BTNS_BUTTON, { 0 }, 0, 0 }, // Ctrl+Alt+Esc - { 3, IDM_ACTION_HRESET, TBSTATE_ENABLED, BTNS_BUTTON, { 0 }, 0, 0 }, // Hard reset - { 4, 0, TBSTATE_INDETERMINATE, BTNS_BUTTON, { 0 }, 0, 0 }, // ACPI shutdown + { 2, IDM_ACTION_RESET_CAD, TBSTATE_ENABLED, BTNS_BUTTON, { 0 }, 0, 0 }, // Ctrl+Alt+Del + { 3, IDM_ACTION_CTRL_ALT_ESC, TBSTATE_ENABLED, BTNS_BUTTON, { 0 }, 0, 0 }, // Ctrl+Alt+Esc + { 4, IDM_ACTION_HRESET, TBSTATE_ENABLED, BTNS_BUTTON, { 0 }, 0, 0 }, // Hard reset + { 5, 0, TBSTATE_INDETERMINATE, BTNS_BUTTON, { 0 }, 0, 0 }, // ACPI shutdown { 0, 0, TBSTATE_INDETERMINATE, BTNS_SEP, { 0 }, 0, 0 }, - { 5, IDM_CONFIG, TBSTATE_ENABLED, BTNS_BUTTON, { 0 }, 0, 0 } // Settings + { 6, IDM_CONFIG, TBSTATE_ENABLED, BTNS_BUTTON, { 0 }, 0, 0 } // Settings }; @@ -98,6 +98,19 @@ ToolBarLoadIcons() } +void +ToolBarUpdatePause(int pause) +{ + TBBUTTONINFO tbbi; + + tbbi.cbSize = sizeof(tbbi); + tbbi.dwMask = TBIF_IMAGE; + tbbi.iImage = pause ? 0 : 1; + + SendMessage(hwndToolbar, TB_SETBUTTONINFO, IDM_ACTION_PAUSE, (LPARAM) &tbbi); +} + + void ToolBarCreate(HWND hwndParent, HINSTANCE hInst) { diff --git a/src/win/win_ui.c b/src/win/win_ui.c index 0c1fbc930..099540ccb 100644 --- a/src/win/win_ui.c +++ b/src/win/win_ui.c @@ -1630,6 +1630,9 @@ plat_pause(int p) if (enable_discord) discord_update_activity(dopause); + /* Update the toolbar */ + ToolBarUpdatePause(p); + /* Send the WM to a manager if needed. */ if (source_hwnd) PostMessage((HWND) (uintptr_t) source_hwnd, WM_SENDSTATUS, (WPARAM) !!dopause, (LPARAM) hwndMain);