[ui] remove check box when old BIOS/Rufus MBR is disabled

* Also use ChangeWindowMessageFilterEx() instead of ChangeWindowMessageFilter()
This commit is contained in:
Pete Batard 2019-07-02 17:49:33 +01:00
parent 1ae4cb722e
commit 3c1ef23ff3
No known key found for this signature in database
GPG Key ID: 38E0CF5E69EDD671
2 changed files with 17 additions and 14 deletions

View File

@ -698,10 +698,13 @@ static void EnableMBRBootOptions(BOOL enable, BOOL remove_checkboxes)
if (IsWindowEnabled(GetDlgItem(hMainDialog, IDC_RUFUS_MBR)) && !actual_enable_mbr) {
uMBRChecked = IsChecked(IDC_RUFUS_MBR);
CheckDlgButton(hMainDialog, IDC_RUFUS_MBR, BST_UNCHECKED);
uXPartChecked = IsChecked(IDC_OLD_BIOS_FIXES);
CheckDlgButton(hMainDialog, IDC_OLD_BIOS_FIXES, BST_UNCHECKED);
} else if (!IsWindowEnabled(GetDlgItem(hMainDialog, IDC_RUFUS_MBR)) && actual_enable_mbr) {
CheckDlgButton(hMainDialog, IDC_RUFUS_MBR, uMBRChecked);
}
if (IsWindowEnabled(GetDlgItem(hMainDialog, IDC_OLD_BIOS_FIXES)) && !actual_enable_fix) {
uXPartChecked = IsChecked(IDC_OLD_BIOS_FIXES);
CheckDlgButton(hMainDialog, IDC_OLD_BIOS_FIXES, BST_UNCHECKED);
} else if (!IsWindowEnabled(GetDlgItem(hMainDialog, IDC_OLD_BIOS_FIXES)) && actual_enable_fix) {
CheckDlgButton(hMainDialog, IDC_OLD_BIOS_FIXES, uXPartChecked);
}
}
@ -812,7 +815,7 @@ static void EnableControls(BOOL bEnable)
// Enable or disable the Start button and the other boot options
bEnable = ((boot_type == BT_IMAGE) && (image_path == NULL)) ? FALSE : bEnable;
EnableWindow(hStart, bEnable);
EnableBootOptions(bEnable, FALSE);
EnableBootOptions(bEnable, TRUE);
// Finally, only enable the half-size dropdowns if we aren't dealing with a pure DD image
bEnable = ((boot_type == BT_IMAGE) && (image_path != NULL) && (!img_report.is_iso)) ? FALSE : bEnable;
@ -2158,7 +2161,7 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA
partition_type = (int)ComboBox_GetItemData(hPartitionScheme, ComboBox_GetCurSel(hPartitionScheme));
SetPartitionSchemeAndTargetSystem(TRUE);
SetFileSystemAndClusterSize(NULL);
EnableMBRBootOptions(TRUE, FALSE);
EnableMBRBootOptions(TRUE, TRUE);
selected_pt = partition_type;
break;
case IDC_FILE_SYSTEM:
@ -2171,7 +2174,7 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA
SetClusterSizes(fs_type);
if (set_selected_fs && (fs_type > 0))
selected_fs = fs_type;
EnableMBRBootOptions(TRUE, FALSE);
EnableMBRBootOptions(TRUE, TRUE);
SetMBRProps();
EnableExtendedLabel((fs_type < FS_EXT2));
break;
@ -3221,10 +3224,10 @@ relaunch:
SetWindowPos(hDlg, HWND_TOP, relaunch_rc.left, relaunch_rc.top, 0, 0, SWP_NOSIZE);
// Enable drag-n-drop through the message filter
ChangeWindowMessageFilter(WM_DROPFILES, MSGFLT_ADD);
ChangeWindowMessageFilter(WM_COPYDATA, MSGFLT_ADD);
// CopyGlobalData is needed sine we are running elevated
ChangeWindowMessageFilter(WM_COPYGLOBALDATA, MSGFLT_ADD);
ChangeWindowMessageFilterEx(hDlg, WM_DROPFILES, MSGFLT_ADD, NULL);
ChangeWindowMessageFilterEx(hDlg, WM_COPYDATA, MSGFLT_ADD, NULL);
// CopyGlobalData is needed since we are running elevated
ChangeWindowMessageFilterEx(hDlg, WM_COPYGLOBALDATA, MSGFLT_ADD, NULL);
// Set the hook to automatically close Windows' "You need to format the disk in drive..." prompt
SetAlertPromptMessages();

View File

@ -33,7 +33,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
IDD_DIALOG DIALOGEX 12, 12, 232, 326
STYLE DS_SETFONT | DS_MODALFRAME | DS_CENTER | WS_MINIMIZEBOX | WS_POPUP | WS_CAPTION | WS_SYSMENU
EXSTYLE WS_EX_ACCEPTFILES
CAPTION "Rufus 3.6.1542"
CAPTION "Rufus 3.6.1543"
FONT 9, "Segoe UI Symbol", 400, 0, 0x0
BEGIN
LTEXT "Drive Properties",IDS_DRIVE_PROPERTIES_TXT,8,6,53,12,NOT WS_GROUP
@ -394,8 +394,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 3,6,1542,0
PRODUCTVERSION 3,6,1542,0
FILEVERSION 3,6,1543,0
PRODUCTVERSION 3,6,1543,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -413,13 +413,13 @@ BEGIN
VALUE "Comments", "https://akeo.ie"
VALUE "CompanyName", "Akeo Consulting"
VALUE "FileDescription", "Rufus"
VALUE "FileVersion", "3.6.1542"
VALUE "FileVersion", "3.6.1543"
VALUE "InternalName", "Rufus"
VALUE "LegalCopyright", "© 2011-2019 Pete Batard (GPL v3)"
VALUE "LegalTrademarks", "https://www.gnu.org/copyleft/gpl.html"
VALUE "OriginalFilename", "rufus-3.6.exe"
VALUE "ProductName", "Rufus"
VALUE "ProductVersion", "3.6.1542"
VALUE "ProductVersion", "3.6.1543"
END
END
BLOCK "VarFileInfo"