MCPcopy Create free account
hub / github.com/TASEmulators/fceux / UpdateMovieRMenu

Function UpdateMovieRMenu

src/drivers/win/window.cpp:897–942  ·  view source on GitHub ↗

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

895
896////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
897void UpdateMovieRMenu(HMENU menu, char **strs, unsigned int mitem, unsigned int baseid)
898{
899 MENUITEMINFO moo;
900 int x;
901
902 moo.cbSize = sizeof(moo);
903 moo.fMask = MIIM_SUBMENU | MIIM_STATE;
904
905 GetMenuItemInfo(GetSubMenu(fceumenu, 0), mitem, FALSE, &moo);
906 moo.hSubMenu = menu;
907 moo.fState = strs[0] ? MFS_ENABLED : MFS_GRAYED;
908
909 SetMenuItemInfo(GetSubMenu(fceumenu, 0), mitem, FALSE, &moo);
910
911 // Remove all recent files submenus
912 for(x = 0; x < MAX_NUMBER_OF_MOVIE_RECENT_FILES; x++)
913 {
914 RemoveMenu(menu, baseid + x, MF_BYCOMMAND);
915 }
916
917 // Recreate the menus
918 for(x = MAX_NUMBER_OF_MOVIE_RECENT_FILES - 1; x >= 0; x--)
919 {
920 // Skip empty strings
921 if(!strs[x])
922 continue;
923
924 string tmp = strs[x];
925
926 //clamp this string to 128 chars
927 if(tmp.size()>128)
928 tmp = tmp.substr(0,128);
929
930 moo.cbSize = sizeof(moo);
931 moo.fMask = MIIM_DATA | MIIM_ID | MIIM_TYPE;
932
933 // Insert the menu item
934 moo.cch = tmp.size();
935 moo.fType = 0;
936 moo.wID = baseid + x;
937 moo.dwTypeData = (LPSTR)tmp.c_str();
938 InsertMenuItem(menu, 0, 1, &moo);
939 }
940
941 DrawMenuBar(hAppWnd);
942}
943
944void UpdateRecentMovieArray(const char* addString, char** bufferArray, unsigned int arrayLen, HMENU menu, unsigned int menuItem, unsigned int baseId)
945{

Callers 3

UpdateRecentMovieArrayFunction · 0.85
AppWndProcFunction · 0.85
CreateMainWindowFunction · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected