Old 17th August 2017, 11:52   #1
Kuppy
Junior Member
 
Join Date: Sep 2016
Posts: 34
Drag & Drop File

I have a question NSIS can use the drag and drop files {NSD_CreateText}?

PHP Code:
!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 $"#32770" "" $HWNDPARENT
  GetDlgItem 
$$1 0x3E9
  EnableWindow 
$0 0
  GetDlgItem 
$$1 0x3FB
  HandleFileDragDrop
::MakeDropWindow $""

  
nsDialogs::Create 1044
  Pop 
$0
  
${If} $== error
    Abort
  
${EndIf}

  ${
NSD_CreateText0010095"$\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 $"InstPageDrop"
  
HandleFileDragDrop::MakeDropWindow $HWNDPARENT $0

  nsDialogs
::Show
FunctionEnd

Function "InstPageDrop"
  
DetailPrint Drop:$0
   SendMessage $LabelText 
${WM_SETTEXT'STR:$0'
  
StrCpy $""
FunctionEnd

Section

SectionEnd

Function .OnGuiEnd
  HandleFileDragDrop
::NOP
FunctionEnd 
Kuppy is offline   Reply With Quote
Reply
Go Back   Winamp & SHOUTcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump