diff --git a/src/include/86box/resource.h b/src/include/86box/resource.h index 60990f691..59dc27d0d 100644 --- a/src/include/86box/resource.h +++ b/src/include/86box/resource.h @@ -300,6 +300,8 @@ #define IDM_VID_GRAY_GREEN 40083 #define IDM_VID_GRAY_WHITE 40084 +#define IDM_MEDIA 40085 + #ifdef USE_DISCORD #define IDM_DISCORD 40090 #endif diff --git a/src/win/86Box.rc b/src/win/86Box.rc index 214dd945a..caba77e71 100644 --- a/src/win/86Box.rc +++ b/src/win/86Box.rc @@ -112,6 +112,7 @@ BEGIN MENUITEM "CGA/PCjr/Tandy/E&GA/(S)VGA overscan", IDM_VID_OVERSCAN MENUITEM "Change contrast for &monochrome display", IDM_VID_CGACON END + MENUITEM "&Media", IDM_MEDIA POPUP "&Tools" BEGIN MENUITEM "&Settings...", IDM_CONFIG diff --git a/src/win/win_stbar.c b/src/win/win_stbar.c index 0dfd7af1d..080afad72 100644 --- a/src/win/win_stbar.c +++ b/src/win/win_stbar.c @@ -1215,6 +1215,27 @@ StatusBarProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) } +void +MediaMenuCreate(HWND hwndParent, uintptr_t idStatus, HINSTANCE hInst) +{ + HMENU hmenu; + LPWSTR lpMenuName; + + hmenu = GetMenu(hwndParent); + hmenuMedia = CreatePopupMenu(); + + int len = GetMenuString(hmenu, IDM_MEDIA, NULL, 0, MF_BYCOMMAND); + lpMenuName = malloc((len + 1) * sizeof(WCHAR)); + GetMenuString(hmenu, IDM_MEDIA, lpMenuName, len + 1, MF_BYCOMMAND); + + InsertMenu(hmenu, IDM_MEDIA, MF_BYCOMMAND | MF_STRING | MF_POPUP, (UINT_PTR)hmenuMedia, lpMenuName); + RemoveMenu(hmenu, IDM_MEDIA, MF_BYCOMMAND); + DrawMenuBar(hwndParent); + + free(lpMenuName); +} + + /* API: Create and set up the Status Bar window. */ void StatusBarCreate(HWND hwndParent, uintptr_t idStatus, HINSTANCE hInst) @@ -1222,7 +1243,6 @@ StatusBarCreate(HWND hwndParent, uintptr_t idStatus, HINSTANCE hInst) RECT rectDialog; int dw, dh; uint8_t i; - HMENU hmenu; /* Load our icons into the cache for faster access. */ for (i = 16; i < 18; i++) @@ -1305,11 +1325,8 @@ StatusBarCreate(HWND hwndParent, uintptr_t idStatus, HINSTANCE hInst) SendMessage(hwndSBAR, SB_SETTEXT, 0 | SBT_NOBORDERS, (LPARAM)L"Welcome to 86Box !"); - hmenu = GetMenu(hwndParent); - hmenuMedia = CreatePopupMenu(); - InsertMenu(hmenu, 2, MF_BYPOSITION | MF_STRING | MF_POPUP, (UINT_PTR)hmenuMedia, plat_get_string(IDS_2126)); - DrawMenuBar(hwndParent); - + MediaMenuCreate(hwndParent, idStatus, hInst); + sb_ready = 1; }