diff --git a/src/rufus.c b/src/rufus.c index 37499201..1af107b2 100644 --- a/src/rufus.c +++ b/src/rufus.c @@ -496,7 +496,8 @@ void SetMBRProps(void) return; } - CheckDlgButton(hMainDialog, IDC_RUFUS_MBR, (needs_masquerading || mbr_selected_by_user)?BST_CHECKED:BST_UNCHECKED); + CheckDlgButton(hMainDialog, IDC_RUFUS_MBR, + (needs_masquerading || iso_report.has_bootmgr || mbr_selected_by_user)?BST_CHECKED:BST_UNCHECKED); IGNORE_RETVAL(ComboBox_SetCurSel(hDiskID, needs_masquerading?1:0)); } @@ -1585,6 +1586,8 @@ static INT_PTR CALLBACK MainCallback(HWND hDlg, UINT message, WPARAM wParam, LPA // Display the log Window log_displayed = !log_displayed; ShowWindow(hLogDlg, log_displayed?SW_SHOW:SW_HIDE); + if (IsShown(hISOProgressDlg)) + SetFocus(hISOProgressDlg); // Set focus on the start button SendMessage(hMainDialog, WM_NEXTDLGCTL, (WPARAM)FALSE, 0); SendMessage(hMainDialog, WM_NEXTDLGCTL, (WPARAM)GetDlgItem(hMainDialog, IDC_START), TRUE); diff --git a/src/rufus.h b/src/rufus.h index fce96327..5d7e3e6d 100644 --- a/src/rufus.h +++ b/src/rufus.h @@ -237,6 +237,7 @@ extern char* FileDialog(BOOL save, char* path, char* filename, char* ext, char* extern BOOL FileIO(BOOL save, char* path, char** buffer, DWORD* size); extern LONG GetEntryWidth(HWND hDropDown, const char* entry); extern BOOL DownloadFile(const char* url, const char* file); +extern BOOL IsShown(HWND hDlg); extern char* get_token_data(const char* filename, const char* token); extern char* insert_section_data(const char* filename, const char* section, const char* data, BOOL dos2unix); extern char* replace_in_token_data(const char* filename, const char* token, const char* src, const char* rep, BOOL dos2unix); diff --git a/src/rufus.rc b/src/rufus.rc index db99ff2b..19fdd11e 100644 --- a/src/rufus.rc +++ b/src/rufus.rc @@ -30,7 +30,7 @@ LANGUAGE LANG_ENGLISH, SUBLANG_NEUTRAL IDD_DIALOG DIALOGEX 12, 12, 206, 316 STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU EXSTYLE WS_EX_APPWINDOW -CAPTION "Rufus v1.2.0.180" +CAPTION "Rufus v1.2.0.181" FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN DEFPUSHBUTTON "Start",IDC_START,94,278,50,14 @@ -77,7 +77,7 @@ BEGIN DEFPUSHBUTTON "OK",IDOK,231,175,50,14,WS_GROUP CONTROL "http://rufus.akeo.ie",IDC_ABOUT_RUFUS_URL, "SysLink",WS_TABSTOP,46,47,114,9 - LTEXT "Version 1.2.0 (Build 180)",IDC_STATIC,46,19,78,8 + LTEXT "Version 1.2.0 (Build 181)",IDC_STATIC,46,19,78,8 PUSHBUTTON "License...",IDC_ABOUT_LICENSE,46,175,50,14,WS_GROUP EDITTEXT IDC_ABOUT_COPYRIGHTS,46,107,235,63,ES_MULTILINE | ES_READONLY | WS_VSCROLL LTEXT "Report bugs or request enhancements at:",IDC_STATIC,46,66,187,8 @@ -237,8 +237,8 @@ END // VS_VERSION_INFO VERSIONINFO - FILEVERSION 1,2,0,180 - PRODUCTVERSION 1,2,0,180 + FILEVERSION 1,2,0,181 + PRODUCTVERSION 1,2,0,181 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L @@ -255,13 +255,13 @@ BEGIN BEGIN VALUE "CompanyName", "akeo.ie" VALUE "FileDescription", "Rufus" - VALUE "FileVersion", "1.2.0.180" + VALUE "FileVersion", "1.2.0.181" VALUE "InternalName", "Rufus" VALUE "LegalCopyright", "© 2011 Pete Batard (GPL v3)" VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html" VALUE "OriginalFilename", "rufus.exe" VALUE "ProductName", "Rufus" - VALUE "ProductVersion", "1.2.0.180" + VALUE "ProductVersion", "1.2.0.181" END END BLOCK "VarFileInfo" diff --git a/src/stdlg.c b/src/stdlg.c index 1c450f3b..6cd5f54d 100644 --- a/src/stdlg.c +++ b/src/stdlg.c @@ -923,6 +923,23 @@ void DestroyAllTooltips(void) } } +/* Determine if a Windows is being displayed or not */ +BOOL IsShown(HWND hDlg) +{ + WINDOWPLACEMENT placement; + if (!GetWindowPlacement(hDlg, &placement)) + return FALSE; + switch (placement.showCmd) { + case SW_SHOWNORMAL: + case SW_SHOWMAXIMIZED: + case SW_SHOW: + case SW_SHOWDEFAULT: + return TRUE; + default: + return FALSE; + } +} + /* Compute the width of a dropdown list entry */ LONG GetEntryWidth(HWND hDropDown, const char *entry) {