From eb36e472a5a0c0dbee10a3ab2ee46da4af680046 Mon Sep 17 00:00:00 2001 From: mpohoreski Date: Tue, 7 Mar 2006 18:17:57 +0000 Subject: [PATCH] Added menu check to easily tell if write protection is on / off --- source/Frame.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/source/Frame.cpp b/source/Frame.cpp index 4cd2bf15..08fa0b85 100644 --- a/source/Frame.cpp +++ b/source/Frame.cpp @@ -959,6 +959,15 @@ void ProcessDiskPopupMenu(HWND hwnd, POINT pt, const int iDrive) // coordinates of the mouse click to screen coordinates. ClientToScreen(hwnd, (LPPOINT) &pt); + int iMenuItem = ID_DISKMENU_WRITEPROTECTION_OFF; + if (DiskGetProtect( iDrive )) + iMenuItem = ID_DISKMENU_WRITEPROTECTION_ON; + + CheckMenuItem( hmenu, + iMenuItem, + MF_CHECKED // MF_BYPOSITION + ); + // Draw and track the shortcut menu. int iCommand = TrackPopupMenu( hmenuTrackPopup @@ -971,10 +980,10 @@ void ProcessDiskPopupMenu(HWND hwnd, POINT pt, const int iDrive) DiskEject( iDrive ); else if (iCommand == ID_DISKMENU_WRITEPROTECTION_ON) - DiskProtect( iDrive, true ); + DiskSetProtect( iDrive, true ); else if (iCommand == ID_DISKMENU_WRITEPROTECTION_OFF) - DiskProtect( iDrive, false ); + DiskSetProtect( iDrive, false ); // Destroy the menu. DestroyMenu(hmenu);