最新消息:

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

nsis 永恒心锁 1692浏览 0评论
/*
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 pythonschool
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 pythonschool
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
永恒心锁,版权所有丨如未注明,均为转载丨本网站采用BY-NC-SA协议进行授权

转载请注明:永恒心锁-分享互联网 » HandleFileDragDrop是NSIS拖动获取目录和文件路径的插件

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