Skip to content
⌘ NSIS Forum Archive

nsDialogs::SelectFileDialog Issue with pre-selected file

2 posts

Koopa#

nsDialogs::SelectFileDialog Issue with pre-selected file

Hi,

I have added a open file window to my Backup Tool, which is working fine,
When I preselect a file which should be added windows always shows it like this:



I manually must move the cursor to the left to make it look normal:



I haven't found any info related to that issue neither in the NSIS docu nor in MSDN.
Using NSIS v3.0RC1 and Unicode scripts.

Any idea?

Function OnRMBackup_BrowseButtonClick

Var /GLOBAL Restore_Mode_Backup_Browser_Value

nsDialogs::SelectFileDialog /NOUNLOAD open "$Selected_Backup_File" "$(BACKUP_FOLDER_ZIP_FILE_PICKER)|*.zip;*.7z"

Pop $Restore_Mode_Backup_Browser_Value

${If} $Restore_Mode_Backup_Browser_Value != "error"
SendMessage $Restore_Mode_Backup_Text ${WM_SETTEXT} 0 "STR:$Restore_Mode_Backup_Browser_Value"
StrCpy $Restore_Mode_Backup_Text "$Restore_Mode_Backup_Browser_Value" ; Update path variable
Pop $Restore_Mode_Backup_Text
${Else}
SendMessage $Restore_Mode_Backup_Text ${WM_SETTEXT} 0 "STR:"
StrCpy $Restore_Mode_Backup_Text "" ; if error store it in default path
Pop $Restore_Mode_Backup_Text
${EndIf}

FunctionEnd
Anders#
I can confirm that this bug happens on Windows 8 as well but it must be a bug in Windows when the filename is long. NSIS just calls GetOpenFileName with OPENFILENAME.lpstrFile set to the path you specify...