Added ability to eject hard drive.

ALT no longer opens menus when mouse captured or in fullscreen mode.
Patches from HalfMinute.
This commit is contained in:
TomW 2014-03-24 19:15:11 +00:00
commit cb5f14349d
3 changed files with 38 additions and 5 deletions

View file

@ -77,19 +77,20 @@ BEGIN
LTEXT "Memory :",IDC_STATIC,15,156,40,10
END
HdConfDlg DIALOGEX 0, 0, 186, 172
HdConfDlg DIALOGEX 0, 0, 210, 172
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Configure Hard Discs"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "OK",IDOK,31,152,50,14
PUSHBUTTON "Cancel",IDCANCEL,101,152,50,14
DEFPUSHBUTTON "OK",IDOK,31+12,152,50,14
PUSHBUTTON "Cancel",IDCANCEL,101+12,152,50,14
LTEXT "C:",IDC_STATIC,7,6,27,10
EDITTEXT IDC_EDITC, 7, 22, 136, 12, WS_DISABLED
PUSHBUTTON "...",IDC_CFILE,7 + 136, 22, 16, 14
PUSHBUTTON "New",IDC_CNEW,7 + 136 + 16, 22, 24, 14
PUSHBUTTON "Eject", IDC_EJECTC, 7 + 136 + 16 + 24, 22, 24, 14
EDITTEXT IDC_EDIT1,36,38,16,12, WS_DISABLED
EDITTEXT IDC_EDIT2,94,38,16,12, WS_DISABLED
EDITTEXT IDC_EDIT3,152,38,28,12, WS_DISABLED
@ -102,6 +103,7 @@ BEGIN
EDITTEXT IDC_EDITD, 7, 92, 136, 12, WS_DISABLED
PUSHBUTTON "...",IDC_DFILE,7 + 136, 92, 16, 14
PUSHBUTTON "New",IDC_DNEW,7 + 136 + 16, 92, 24, 14
PUSHBUTTON "Eject", IDC_EJECTD, 7 + 136 + 16 + 24, 92, 24, 14
EDITTEXT IDC_EDIT4,36,108,16,12, WS_DISABLED
EDITTEXT IDC_EDIT5,94,108,16,12, WS_DISABLED

View file

@ -51,6 +51,8 @@
#define IDC_EDITD 1053
#define IDC_DFILE 1054
#define IDC_DNEW 1055
#define IDC_EJECTC 1056
#define IDC_EJECTD 1057
#define IDC_MEMSPIN 1070
#define IDC_MEMTEXT 1071
#define IDC_STEXT1 1100

View file

@ -1192,6 +1192,29 @@ BOOL CALLBACK hdconfdlgproc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lPara
pause=0;
return TRUE;
case IDC_EJECTC:
hd[0].spt = 0;
hd[0].hpc = 0;
hd[0].tracks = 0;
ide_fn[0][0] = 0;
SetDlgItemText(hdlg, IDC_EDIT1, "0");
SetDlgItemText(hdlg, IDC_EDIT2, "0");
SetDlgItemText(hdlg, IDC_EDIT3, "0");
SetDlgItemText(hdlg, IDC_EDITC, "");
hd_changed = 1;
return TRUE;
case IDC_EJECTD:
hd[1].spt = 0;
hd[1].hpc = 0;
hd[1].tracks = 0;
ide_fn[1][0] = 0;
SetDlgItemText(hdlg, IDC_EDIT4, "0");
SetDlgItemText(hdlg, IDC_EDIT5, "0");
SetDlgItemText(hdlg, IDC_EDIT6, "0");
SetDlgItemText(hdlg, IDC_EDITD, "");
hd_changed = 1;
return TRUE;
case IDC_CNEW:
if (DialogBox(hinstance,TEXT("HdNewDlg"),hdlg,hdnewdlgproc) == 1)
{
@ -1703,12 +1726,18 @@ LRESULT CALLBACK WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM
// if (mousecapture)
return 0;
// return DefWindowProc (hwnd, message, wParam, lParam);
case WM_DESTROY:
UnhookWindowsHookEx( hKeyboardHook );
KillTimer(hwnd, TIMER_1SEC);
PostQuitMessage (0); /* send a WM_QUIT to the message queue */
break;
case WM_SYSCOMMAND:
if (wParam == SC_KEYMENU && HIWORD(lParam) <= 0 && (video_fullscreen || mousecapture))
return 0; /*disable ALT key for menu*/
default:
// pclog("Def %08X %i\n",message,message);
return DefWindowProc (hwnd, message, wParam, lParam);