1
1
Fork 0
mirror of https://github.com/pbatard/rufus.git synced 2024-08-14 23:57:05 +00:00

[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) { if (IsWindowEnabled(GetDlgItem(hMainDialog, IDC_RUFUS_MBR)) && !actual_enable_mbr) {
uMBRChecked = IsChecked(IDC_RUFUS_MBR); uMBRChecked = IsChecked(IDC_RUFUS_MBR);
CheckDlgButton(hMainDialog, IDC_RUFUS_MBR, BST_UNCHECKED); 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) { } else if (!IsWindowEnabled(GetDlgItem(hMainDialog, IDC_RUFUS_MBR)) && actual_enable_mbr) {
CheckDlgButton(hMainDialog, IDC_RUFUS_MBR, uMBRChecked); 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); 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 // Enable or disable the Start button and the other boot options
bEnable = ((boot_type == BT_IMAGE) && (image_path == NULL)) ? FALSE : bEnable; bEnable = ((boot_type == BT_IMAGE) && (image_path == NULL)) ? FALSE : bEnable;
EnableWindow(hStart, 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 // 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; 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)); partition_type = (int)ComboBox_GetItemData(hPartitionScheme, ComboBox_GetCurSel(hPartitionScheme));
SetPartitionSchemeAndTargetSystem(TRUE); SetPartitionSchemeAndTargetSystem(TRUE);
SetFileSystemAndClusterSize(NULL); SetFileSystemAndClusterSize(NULL);
EnableMBRBootOptions(TRUE, FALSE); EnableMBRBootOptions(TRUE, TRUE);
selected_pt = partition_type; selected_pt = partition_type;
break; break;
case IDC_FILE_SYSTEM: case IDC_FILE_SYSTEM:
@ -2171,7 +2174,7 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA
SetClusterSizes(fs_type); SetClusterSizes(fs_type);
if (set_selected_fs && (fs_type > 0)) if (set_selected_fs && (fs_type > 0))
selected_fs = fs_type; selected_fs = fs_type;
EnableMBRBootOptions(TRUE, FALSE); EnableMBRBootOptions(TRUE, TRUE);
SetMBRProps(); SetMBRProps();
EnableExtendedLabel((fs_type < FS_EXT2)); EnableExtendedLabel((fs_type < FS_EXT2));
break; break;
@ -3221,10 +3224,10 @@ relaunch:
SetWindowPos(hDlg, HWND_TOP, relaunch_rc.left, relaunch_rc.top, 0, 0, SWP_NOSIZE); SetWindowPos(hDlg, HWND_TOP, relaunch_rc.left, relaunch_rc.top, 0, 0, SWP_NOSIZE);
// Enable drag-n-drop through the message filter // Enable drag-n-drop through the message filter
ChangeWindowMessageFilter(WM_DROPFILES, MSGFLT_ADD); ChangeWindowMessageFilterEx(hDlg, WM_DROPFILES, MSGFLT_ADD, NULL);
ChangeWindowMessageFilter(WM_COPYDATA, MSGFLT_ADD); ChangeWindowMessageFilterEx(hDlg, WM_COPYDATA, MSGFLT_ADD, NULL);
// CopyGlobalData is needed sine we are running elevated // CopyGlobalData is needed since we are running elevated
ChangeWindowMessageFilter(WM_COPYGLOBALDATA, MSGFLT_ADD); ChangeWindowMessageFilterEx(hDlg, WM_COPYGLOBALDATA, MSGFLT_ADD, NULL);
// Set the hook to automatically close Windows' "You need to format the disk in drive..." prompt // Set the hook to automatically close Windows' "You need to format the disk in drive..." prompt
SetAlertPromptMessages(); SetAlertPromptMessages();

View file

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