comparison Gui/win32/gui.c @ 20235:c7f580aa091d

Set SetErrorMode to make sure no dialog box will pop up when no disk in CD/DVD drive.
author reimar
date Sun, 15 Oct 2006 15:34:50 +0000
parents 26867dede11c
children f4780fd3a73c
comparison
equal deleted inserted replaced
20234:7e258473172d 20235:c7f580aa091d
836 char searchpath2[MAX_PATH]; 836 char searchpath2[MAX_PATH];
837 #ifdef HAVE_LIBCDIO 837 #ifdef HAVE_LIBCDIO
838 char searchpath3[MAX_PATH]; 838 char searchpath3[MAX_PATH];
839 #endif 839 #endif
840 int len, pos = 0, cdromdrive = 0; 840 int len, pos = 0, cdromdrive = 0;
841 UINT errmode;
841 point.x = GET_X_LPARAM(lParam); 842 point.x = GET_X_LPARAM(lParam);
842 point.y = GET_Y_LPARAM(lParam); 843 point.y = GET_Y_LPARAM(lParam);
843 ClientToScreen(hWnd, &point); 844 ClientToScreen(hWnd, &point);
845 errmode = SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX);
844 len = GetLogicalDriveStrings(MAX_PATH, device); 846 len = GetLogicalDriveStrings(MAX_PATH, device);
845 while(pos < len) 847 while(pos < len)
846 { 848 {
847 if(GetDriveType(device + pos) == DRIVE_CDROM) 849 if(GetDriveType(device + pos) == DRIVE_CDROM)
848 { 850 {
863 else EnableMenuItem(gui->diskmenu, IDPLAYDISK + cdromdrive, MF_BYCOMMAND | MF_GRAYED); 865 else EnableMenuItem(gui->diskmenu, IDPLAYDISK + cdromdrive, MF_BYCOMMAND | MF_GRAYED);
864 cdromdrive++; 866 cdromdrive++;
865 } 867 }
866 pos += strlen(device + pos) + 1; 868 pos += strlen(device + pos) + 1;
867 } 869 }
870 SetErrorMode(errmode);
868 TrackPopupMenu(gui->menu, 0, point.x, point.y, 0, hWnd, NULL); 871 TrackPopupMenu(gui->menu, 0, point.x, point.y, 0, hWnd, NULL);
869 return 0; 872 return 0;
870 } 873 }
871 case WM_MOUSEMOVE: 874 case WM_MOUSEMOVE:
872 { 875 {