win: Add a placeholder menuitem for the Media menu
This makes it possible to change the position of the menu by only editing the resource script itself.
This commit is contained in:
@@ -300,6 +300,8 @@
|
|||||||
#define IDM_VID_GRAY_GREEN 40083
|
#define IDM_VID_GRAY_GREEN 40083
|
||||||
#define IDM_VID_GRAY_WHITE 40084
|
#define IDM_VID_GRAY_WHITE 40084
|
||||||
|
|
||||||
|
#define IDM_MEDIA 40085
|
||||||
|
|
||||||
#ifdef USE_DISCORD
|
#ifdef USE_DISCORD
|
||||||
#define IDM_DISCORD 40090
|
#define IDM_DISCORD 40090
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -112,6 +112,7 @@ BEGIN
|
|||||||
MENUITEM "CGA/PCjr/Tandy/E&GA/(S)VGA overscan", IDM_VID_OVERSCAN
|
MENUITEM "CGA/PCjr/Tandy/E&GA/(S)VGA overscan", IDM_VID_OVERSCAN
|
||||||
MENUITEM "Change contrast for &monochrome display", IDM_VID_CGACON
|
MENUITEM "Change contrast for &monochrome display", IDM_VID_CGACON
|
||||||
END
|
END
|
||||||
|
MENUITEM "&Media", IDM_MEDIA
|
||||||
POPUP "&Tools"
|
POPUP "&Tools"
|
||||||
BEGIN
|
BEGIN
|
||||||
MENUITEM "&Settings...", IDM_CONFIG
|
MENUITEM "&Settings...", IDM_CONFIG
|
||||||
|
|||||||
@@ -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. */
|
/* API: Create and set up the Status Bar window. */
|
||||||
void
|
void
|
||||||
StatusBarCreate(HWND hwndParent, uintptr_t idStatus, HINSTANCE hInst)
|
StatusBarCreate(HWND hwndParent, uintptr_t idStatus, HINSTANCE hInst)
|
||||||
@@ -1222,7 +1243,6 @@ StatusBarCreate(HWND hwndParent, uintptr_t idStatus, HINSTANCE hInst)
|
|||||||
RECT rectDialog;
|
RECT rectDialog;
|
||||||
int dw, dh;
|
int dw, dh;
|
||||||
uint8_t i;
|
uint8_t i;
|
||||||
HMENU hmenu;
|
|
||||||
|
|
||||||
/* Load our icons into the cache for faster access. */
|
/* Load our icons into the cache for faster access. */
|
||||||
for (i = 16; i < 18; i++)
|
for (i = 16; i < 18; i++)
|
||||||
@@ -1305,10 +1325,7 @@ StatusBarCreate(HWND hwndParent, uintptr_t idStatus, HINSTANCE hInst)
|
|||||||
SendMessage(hwndSBAR, SB_SETTEXT, 0 | SBT_NOBORDERS,
|
SendMessage(hwndSBAR, SB_SETTEXT, 0 | SBT_NOBORDERS,
|
||||||
(LPARAM)L"Welcome to 86Box !");
|
(LPARAM)L"Welcome to 86Box !");
|
||||||
|
|
||||||
hmenu = GetMenu(hwndParent);
|
MediaMenuCreate(hwndParent, idStatus, hInst);
|
||||||
hmenuMedia = CreatePopupMenu();
|
|
||||||
InsertMenu(hmenu, 2, MF_BYPOSITION | MF_STRING | MF_POPUP, (UINT_PTR)hmenuMedia, plat_get_string(IDS_2126));
|
|
||||||
DrawMenuBar(hwndParent);
|
|
||||||
|
|
||||||
sb_ready = 1;
|
sb_ready = 1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user