最新消息:

TSFD是NSIS增强FileDialog打开文件窗口的插件

nsis 永恒心锁 1911浏览 0评论
/*
TSFD是NSIS增强FileDialog打开文件窗口的插件
TSFD可以指定要打开的文件的类型,通过open/save控制打开文件还是保存文件对话框.
*/
!AddPluginDir "."
!include "MUI2.nsh"
!include nsDialogs.nsh
!include LogicLib.nsh
!include winmessages.nsh
Var INST_SDAT_LOC1
Var INST_SDAT_BTN1
Name "test"
OutFile "nsDialogFileBrowse.exe"
Page custom SettingsPage
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"
Function SettingsPage
nsDialogs::Create /NOUNLOAD 1018
Pop $0
;; Only looking inside a specific folder
${NSD_CreateBrowseButton} 410 130 25 12u "..."
Pop $INST_SDAT_BTN1
nsDialogs::SetUserData /NOUNLOAD $INST_SDAT_BTN1 FileRequest # remember field id
GetFunctionAddress $0 FolderBrowseButton
nsDialogs::OnClick /NOUNLOAD $INST_SDAT_BTN1 $0
${NSD_CreateFileRequest} 110 130 300 12u ""
Pop $INST_SDAT_LOC1
nsDialogs::Show
FunctionEnd
Function FolderBrowseButton
StrCpy $2 "C:WindowsSystem32"
tSFD::SelectFileDialog /NOUNLOAD save $2 "*.exe|*.exe"
Pop $2
${If} $2 != ""
SendMessage $INST_SDAT_LOC1 ${WM_SETTEXT} 0 STR:$2
${EndIf}
FunctionEnd
Section
SectionEnd
永恒心锁,版权所有丨如未注明,均为转载丨本网站采用BY-NC-SA协议进行授权

转载请注明:永恒心锁-分享互联网 » TSFD是NSIS增强FileDialog打开文件窗口的插件

您必须 登录 才能发表评论!