HandleFileDragDrop是NSIS拖动获取目录和文件路径的插件

/*
HandleFileDragDrop是NSIS拖动获取目录和文件路径的插件
MakeDropWindow:第一个参数是接受拖动的目标控件.第二个参数是回调函数可以自定义操作.
*/
!addplugindir "."
OutFile "handleFileDragDrop.exe"
ShowInstDetails show
RequestExecutionLevel user
CompletedText "Drop files on me..."
SpaceTexts none
InstallDir $temp
!include "WinMessages.nsh"
page directory "" dirShow
page InstFiles
Function yhxs3344
FindWindow $1 "#32770" "" $HWNDPARENT
GetDlgItem $2 $1 0x3FB
SendMessage $2 ${WM_SETTEXT} 0 "STR:$0"
FunctionEnd
Function dirShow
FindWindow $1 "#32770" "" $HWNDPARENT
GetDlgItem $0 $1 0x3E9
EnableWindow $0 0
GetDlgItem $0 $1 0x3FB
#GetFunctionAddress $3 yhxs3344
HandleFileDragDrop::MakeDropWindow $0 '' ;blank string means no callback, auto sets text of the window
FunctionEnd
Function InstPageDrop
DetailPrint Drop:$0
StrCpy $0 "" ;set to blank if you want the next file (if any)
FunctionEnd
Section
GetFunctionAddress $0 InstPageDrop
HandleFileDragDrop::MakeDropWindow $hwndparent $0
;Error code is in $0, 0=success
SectionEnd
Function .OnGuiEnd
HandleFileDragDrop::NOP
FunctionEnd
© 版权声明
THE END
喜欢就支持一下吧
点赞10 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容