menu = GetSubMenu(menu, 15); if(menu != NULL) updateLayersMenu(menu);
HMENU sub = GetSubMenu(menu, 15); if(sub == NULL) sub= GetSubMenu(menu, 16); if(sub != NULL) updateLayersMenu(sub);
void updateVideoMenu(HMENU menu){  menu = GetSubMenu(menu, MENU_OPTIONS_VIDEO);  if(menu == NULL)    return;    CheckMenuItem(menu, ID_OPTIONS_VIDEO_VSYNC,                CHECKMENUSTATE(vsync == 1));  CheckMenuItem(menu, ID_OPTIONS_VIDEO_X1,                CHECKMENUSTATE(videoOption == VIDEO_1X));  CheckMenuItem(menu, ID_OPTIONS_VIDEO_X2,                CHECKMENUSTATE(videoOption == VIDEO_2X));  CheckMenuItem(menu, ID_OPTIONS_VIDEO_X3,                CHECKMENUSTATE(videoOption == VIDEO_3X));  CheckMenuItem(menu, ID_OPTIONS_VIDEO_X4,                CHECKMENUSTATE(videoOption == VIDEO_4X));  CheckMenuItem(menu, ID_OPTIONS_VIDEO_FULLSCREEN320X240,                CHECKMENUSTATE((videoOption == VIDEO_320x240)));  EnableMenuItem(menu, ID_OPTIONS_VIDEO_FULLSCREEN320X240,                 ENABLEMENU(mode320Available));  CheckMenuItem(menu, ID_OPTIONS_VIDEO_FULLSCREEN640X480,                CHECKMENUSTATE((videoOption == VIDEO_640x480)));  EnableMenuItem(menu, ID_OPTIONS_VIDEO_FULLSCREEN640X480,                 ENABLEMENU(mode640Available));    CheckMenuItem(menu, ID_OPTIONS_VIDEO_FULLSCREEN800X600,                CHECKMENUSTATE((videoOption == VIDEO_800x600)));  EnableMenuItem(menu, ID_OPTIONS_VIDEO_FULLSCREEN800X600,                 ENABLEMENU(mode800Available));    CheckMenuItem(menu, ID_OPTIONS_VIDEO_DISABLESFX,                CHECKMENUSTATE(cpuDisableSfx));  CheckMenuItem(menu, ID_OPTIONS_VIDEO_FULLSCREENSTRETCHTOFIT,                CHECKMENUSTATE(fullScreenStretch));  CheckMenuItem(menu, ID_OPTIONS_VIDEO_DDRAWEMULATIONONLY,                CHECKMENUSTATE(ddrawEmulationOnly));  CheckMenuItem(menu, ID_OPTIONS_VIDEO_DDRAWUSEVIDEOMEMORY,                CHECKMENUSTATE(ddrawUseVideoMemory));  menu = GetSubMenu(menu, 15);  if(menu != NULL)    updateLayersMenu(menu);}