!define APPNAME "Drag & Drop"
NAME "${APPNAME}"
OutFile "${APPNAME}.exe"
InstallDir $temp
ShowInstDetails show
RequestExecutionLevel user
CompletedText "Drop files on me..."
DirText "You can drop a folder on the text field!"
SpaceTexts none
!include "MUI.nsh"
!include "WinCore.nsh"
!include "nsDialogs.nsh"
!include "LogicLib.nsh"
!include "WinMessages.nsh"
Page Custom "PageShow"
Page InstFiles
!insertmacro MUI_LANGUAGE 'English'
var LabelText
Function "PageShow"
FindWindow $1 "#32770" "" $HWNDPARENT
GetDlgItem $0 $1 0x3E9
EnableWindow $0 0
GetDlgItem $0 $1 0x3FB
HandleFileDragDrop::MakeDropWindow $0 ""
nsDialogs::Create 1044
Pop $0
${If} $0 == error
Abort
${EndIf}
${NSD_CreateText} 0% 0% 100% 95% "$\r$\n$\r$\n$\r$\n$\r$\nDrag & Drop$\r$\n$\r$\n$\r$\n$\r$\nYour file here"
Pop $LabelText
${NSD_Onchange} $LabelText "InstPageDrop"
GetFunctionAddress $0 "InstPageDrop"
HandleFileDragDrop::MakeDropWindow $HWNDPARENT $0
nsDialogs::Show
FunctionEnd
Function "InstPageDrop"
DetailPrint Drop:$0
SendMessage $LabelText ${WM_SETTEXT} 0 'STR:$0'
StrCpy $0 ""
FunctionEnd
Section
SectionEnd
Function .OnGuiEnd
HandleFileDragDrop::NOP
FunctionEnd Drag & Drop File
I have a question NSIS can use the drag and drop files {NSD_CreateText}?