HandleFileDragDrop plug-in: Difference between revisions
From NSIS Wiki
Jump to navigationJump to search
(New plugin, w00t, v0.1) |
(v0.2) |
||
Line 2: | Line 2: | ||
== Links == | == Links == | ||
<attach> | <attach>HandleFileDragDrop.zip</attach> | ||
== Description == | == Description == | ||
'''Version:''' 0. | '''Version:''' 0.2 - 20181123<br> | ||
'''Supported on:''' Win95+/NT4+ (Only tested on XP, should work on any platform) | '''Supported on:''' Win95+/NT4+ (Only tested on XP, should work on any platform) | ||
This plugin will respond to files dropped on the window you specify, it can call a nsis function for each file/folder dropped on the window, or just set the window's text (Useful for file/folder inputs) | This plugin will respond to files dropped on the window you specify, it can call a nsis function for each file/folder dropped on the window, or just set the window's text (Useful for file/folder inputs) | ||
== Example == | |||
<highlight-nsis> | |||
OutFile Test.exe | |||
ShowInstDetails show | |||
RequestExecutionLevel user | |||
CompletedText "Drop files on me..." | |||
DirText "You can drop a folder on the text field!" | |||
SpaceTexts none | |||
InstallDir $temp | |||
Page Directory "" onDirShow | |||
Page InstFiles | |||
Function onDirShow | |||
FindWindow $1 "#32770" "" $HWNDPARENT ; Find inner dialog | |||
GetDlgItem $1 $1 0x3FB | |||
HandleFileDragDrop::Register $1 "" | |||
FunctionEnd | |||
Function InstPageDrop | |||
DetailPrint Drop:$0 | |||
StrCpy $0 "" ; Set to empty string if you want the next file (if any) | |||
FunctionEnd | |||
Section | |||
FindWindow $1 "#32770" "" $HWNDPARENT ; Find inner dialog | |||
GetFunctionAddress $0 InstPageDrop | |||
HandleFileDragDrop::Register $1 $0 | |||
SectionEnd | |||
</highlight-nsis> | |||
== Credits == | == Credits == |
Revision as of 19:22, 23 November 2018
Author: Anders (talk, contrib) |
Links
HandleFileDragDrop.zip (4 KB)
Description
Version: 0.2 - 20181123
Supported on: Win95+/NT4+ (Only tested on XP, should work on any platform)
This plugin will respond to files dropped on the window you specify, it can call a nsis function for each file/folder dropped on the window, or just set the window's text (Useful for file/folder inputs)
Example
OutFile Test.exe ShowInstDetails show RequestExecutionLevel user CompletedText "Drop files on me..." DirText "You can drop a folder on the text field!" SpaceTexts none InstallDir $temp Page Directory "" onDirShow Page InstFiles Function onDirShow FindWindow $1 "#32770" "" $HWNDPARENT ; Find inner dialog GetDlgItem $1 $1 0x3FB HandleFileDragDrop::Register $1 "" FunctionEnd Function InstPageDrop DetailPrint Drop:$0 StrCpy $0 "" ; Set to empty string if you want the next file (if any) FunctionEnd Section FindWindow $1 "#32770" "" $HWNDPARENT ; Find inner dialog GetFunctionAddress $0 InstPageDrop HandleFileDragDrop::Register $1 $0 SectionEnd
Credits
Written by Anders (For fun and profit?)