AZJIO Posted October 12, 2012 Share Posted October 12, 2012 (edited) You can do it more simply and more stable? #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GuiEdit.au3> $hGui = GUICreate("GUI", 400, 500, -1, -1, -1, $WS_EX_ACCEPTFILES) $iEdit = GUICtrlCreateEdit("The first line of the" & @CRLF & "The second line", 3, 3, 400 - 6, 500 - 6, $ES_AUTOVSCROLL + $WS_VSCROLL + $ES_NOHIDESEL + $ES_WANTRETURN) GUICtrlSetState(-1, $GUI_DROPACCEPTED) GUICtrlSendMsg(-1, $EM_LIMITTEXT, -1, 0) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_DROPPED If $iEdit = @GUI_DropId Then $sPos = _GUICtrlEdit_GetSel($iEdit) $sText = StringMid(GUICtrlRead($iEdit), $sPos[0] + 1) $sPath = StringRegExpReplace($sText, '(?s)^(.+?)(?:R.*)', '1') WinSetTitle($hGui, '', StringRegExpReplace($sPath, '^(?:.*)([^]*?)(?:.[^.]+)?$', '1')) If FileExists($sPath) And Not StringInStr(FileGetAttrib($sPath), "D") Then GUICtrlSetData($iEdit, FileRead($sPath)) Else _GUICtrlEdit_ReplaceSel($iEdit, '') EndIf EndIf Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Edited July 20, 2013 by AZJIO My other projects or all Link to comment Share on other sites More sharing options...
guinness Posted October 12, 2012 Share Posted October 12, 2012 What's wrong with what you have now? UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
AZJIO Posted October 12, 2012 Author Share Posted October 12, 2012 Added $EM_LIMITTEXT. It was the limit for large files and data in the end is not inserted. Now works. My other projects or all Link to comment Share on other sites More sharing options...
guinness Posted October 12, 2012 Share Posted October 12, 2012 OK so it's solved. Great. UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
AZJIO Posted October 12, 2012 Author Share Posted October 12, 2012 There is a little problem. If I do not want to update "Edit" when you move a folder? I have to copy the text, then insert it again. Is there a notification? My other projects or all Link to comment Share on other sites More sharing options...
UEZ Posted October 12, 2012 Share Posted October 12, 2012 WM_DROPFILES will help you. Br, UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
guinness Posted October 12, 2012 Share Posted October 12, 2012 I don't know if that will fix the problem UEZ. expandcollapse popup#include <GUIConstantsEx.au3> #include <GUIEdit.au3> #include <WinAPIEx.au3> #include <WindowsConstants.au3> GLobal $__aDropFiles = 0 Example() Func Example() Local $hGUI = GUICreate('GUI', 400, 500, -1, -1, -1, $WS_EX_ACCEPTFILES) Local $iEdit = GUICtrlCreateEdit('The first line of the' & @CRLF & 'The second line', 3, 3, 400 - 6, 500 - 6, $ES_AUTOVSCROLL + $WS_VSCROLL + $ES_NOHIDESEL + $ES_WANTRETURN) GUICtrlSetState($iEdit, $GUI_DROPACCEPTED) _GUICtrlEdit_SetLimitText($iEdit, 0) GUIRegisterMsg($WM_DROPFILES, 'WM_DROPFILES') GUISetState(@SW_SHOW, $hGUI) Local $sPath = '', $sPos = '', $sText = '' While 1 Switch GUIGetMsg() Case $GUI_EVENT_DROPPED If $iEdit = @GUI_DropId Then $sPos = _GUICtrlEdit_GetSel($iEdit) $sText = StringMid(GUICtrlRead($iEdit), $sPos[0] + 1) $sPath = StringRegExpReplace($sText, '(?s)^(.+?)(?:R.*)', '1') If FileExists($sPath) And Not StringInStr(FileGetAttrib($sPath), 'D') Then GUICtrlSetData($iEdit, FileRead($sPath)) Else ; AZJIO wants it to revert to the text before and not the folder that is added to the Edit control. ; GUICtrlSetData($iEdit, '') EndIf EndIf Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd GUIDelete($hGUI) EndFunc ;==>Example Func WM_DROPFILES($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $lParam Return $GUI_RUNDEFMSG ; Intercept WM_DROPFILES. ;~ Switch $iMsg ;~ Case $WM_DROPFILES ;~ Local $aReturn = _WinAPI_DragQueryFileEx($wParam) ;~ If IsArray($aReturn) Then ;~ $__aDropFiles = $aReturn ;~ Else ;~ Local $aError[1] = [0] ;~ $__aDropFiles = $aError ;~ EndIf ;~ EndSwitch ;~ Return $GUI_RUNDEFMSG EndFunc ;==>WM_DROPFILES UDF List: _AdapterConnections() • _AlwaysRun() • _AppMon() • _AppMonEx() • _ArrayFilter/_ArrayReduce • _BinaryBin() • _CheckMsgBox() • _CmdLineRaw() • _ContextMenu() • _ConvertLHWebColor()/_ConvertSHWebColor() • _DesktopDimensions() • _DisplayPassword() • _DotNet_Load()/_DotNet_Unload() • _Fibonacci() • _FileCompare() • _FileCompareContents() • _FileNameByHandle() • _FilePrefix/SRE() • _FindInFile() • _GetBackgroundColor()/_SetBackgroundColor() • _GetConrolID() • _GetCtrlClass() • _GetDirectoryFormat() • _GetDriveMediaType() • _GetFilename()/_GetFilenameExt() • _GetHardwareID() • _GetIP() • _GetIP_Country() • _GetOSLanguage() • _GetSavedSource() • _GetStringSize() • _GetSystemPaths() • _GetURLImage() • _GIFImage() • _GoogleWeather() • _GUICtrlCreateGroup() • _GUICtrlListBox_CreateArray() • _GUICtrlListView_CreateArray() • _GUICtrlListView_SaveCSV() • _GUICtrlListView_SaveHTML() • _GUICtrlListView_SaveTxt() • _GUICtrlListView_SaveXML() • _GUICtrlMenu_Recent() • _GUICtrlMenu_SetItemImage() • _GUICtrlTreeView_CreateArray() • _GUIDisable() • _GUIImageList_SetIconFromHandle() • _GUIRegisterMsg() • _GUISetIcon() • _Icon_Clear()/_Icon_Set() • _IdleTime() • _InetGet() • _InetGetGUI() • _InetGetProgress() • _IPDetails() • _IsFileOlder() • _IsGUID() • _IsHex() • _IsPalindrome() • _IsRegKey() • _IsStringRegExp() • _IsSystemDrive() • _IsUPX() • _IsValidType() • _IsWebColor() • _Language() • _Log() • _MicrosoftInternetConnectivity() • _MSDNDataType() • _PathFull/GetRelative/Split() • _PathSplitEx() • _PrintFromArray() • _ProgressSetMarquee() • _ReDim() • _RockPaperScissors()/_RockPaperScissorsLizardSpock() • _ScrollingCredits • _SelfDelete() • _SelfRename() • _SelfUpdate() • _SendTo() • _ShellAll() • _ShellFile() • _ShellFolder() • _SingletonHWID() • _SingletonPID() • _Startup() • _StringCompact() • _StringIsValid() • _StringRegExpMetaCharacters() • _StringReplaceWholeWord() • _StringStripChars() • _Temperature() • _TrialPeriod() • _UKToUSDate()/_USToUKDate() • _WinAPI_Create_CTL_CODE() • _WinAPI_CreateGUID() • _WMIDateStringToDate()/_DateToWMIDateString() • Au3 script parsing • AutoIt Search • AutoIt3 Portable • AutoIt3WrapperToPragma • AutoItWinGetTitle()/AutoItWinSetTitle() • Coding • DirToHTML5 • FileInstallr • FileReadLastChars() • GeoIP database • GUI - Only Close Button • GUI Examples • GUICtrlDeleteImage() • GUICtrlGetBkColor() • GUICtrlGetStyle() • GUIEvents • GUIGetBkColor() • Int_Parse() & Int_TryParse() • IsISBN() • LockFile() • Mapping CtrlIDs • OOP in AutoIt • ParseHeadersToSciTE() • PasswordValid • PasteBin • Posts Per Day • PreExpand • Protect Globals • Queue() • Resource Update • ResourcesEx • SciTE Jump • Settings INI • SHELLHOOK • Shunting-Yard • Signature Creator • Stack() • Stopwatch() • StringAddLF()/StringStripLF() • StringEOLToCRLF() • VSCROLL • WM_COPYDATA • More Examples... Updated: 22/04/2018 Link to comment Share on other sites More sharing options...
UEZ Posted October 12, 2012 Share Posted October 12, 2012 (edited) AZJIO, I don't know whether I understood you properly. Can you please explain again? Or does this help you? expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GuiEdit.au3> $hGui = GUICreate("GUI", 400, 500, -1, -1, -1, $WS_EX_ACCEPTFILES) $iEdit = GUICtrlCreateEdit("The first line of the" & @CRLF & "The second line", 3, 3, 400 - 6, 500 - 6, $ES_AUTOVSCROLL + $WS_VSCROLL + $ES_NOHIDESEL + $ES_WANTRETURN) GUICtrlSendMsg(-1, $EM_LIMITTEXT, -1, 0) GUISetState() GUIRegisterMsg($WM_DROPFILES, "WM_DROPFILES") While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE GUIRegisterMsg($WM_DROPFILES, "") Exit EndSwitch WEnd Func WM_DROPFILES($hwnd, $msg, $wParam, $lParam) Local $aRet = DllCall("shell32.dll", "int", "DragQueryFile", "int", $wParam, "int", -1, "ptr", 0, "int", 0) If @error Then Return SetError(1, 0, 0) Local $sDroppedFiles, $tBuffer = DllStructCreate("char[256]") If $aRet[0] = 1 Then DllCall("shell32.dll", "int", "DragQueryFile", "int", $wParam, "int", 0, "ptr", DllStructGetPtr($tBuffer), "int", DllStructGetSize($tBuffer)) $sDroppedFiles = DllStructGetData($tBuffer, 1) If StringInStr(FileGetAttrib($sDroppedFiles), "D") Then DllCall("shell32.dll", "none", "DragFinish", "int", $wParam) Return MsgBox(16 + 262144, "Error", "A folder has been dragged to the GUI!", 20, $hGUI) EndIf EndIf DllCall("shell32.dll", "none", "DragFinish", "int", $wParam) $tBuffer = 0 GUICtrlSetData($iEdit, FileRead($sDroppedFiles)) Return "GUI_RUNDEFMSG" EndFunc Btw, I got a similar problem in File to Base64 String Code Generator which I fixed now. Br, UEZ Edited October 12, 2012 by UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
AZJIO Posted October 12, 2012 Author Share Posted October 12, 2012 There is food for thought. I have added in its example ReplaceSel. UEZ, If 2 files to throw? My other projects or all Link to comment Share on other sites More sharing options...
UEZ Posted October 12, 2012 Share Posted October 12, 2012 Have a look to WM_DROPFILES function in File to Base64 String Code Generator for an example.Br,UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
AZJIO Posted October 22, 2012 Author Share Posted October 22, 2012 (edited) Simplified the example to make it clearer #include <WindowsConstants.au3> Global Const $WM_DROPFILES = 0x0233 ; AutoIt3 v3.3.6.1 Global $k = 0 $sDescription = 'WM_DROPFILES + Edit' $hGui = GUICreate('WM_DROPFILES', 600, 360, -1, -1, -1, $WS_EX_ACCEPTFILES) $iEdit = GUICtrlCreateEdit($sDescription, 5, 5, 590, 300) GUISetState() GUIRegisterMsg($WM_DROPFILES, "WM_DROPFILES") Do Until GUIGetMsg() = -3 Func WM_DROPFILES($hwnd, $msg, $wParam, $lParam) ; Local $tPoint = DllStructCreate('int X;int Y') ; DllCall("shell32.dll", "int", "DragQueryPoint", "int", $wParam, "ptr", DllStructGetPtr($tPoint)) ; $iX = DllStructGetData($tPoint, "X") ; $iY = DllStructGetData($tPoint, "Y") $k += 1 WinSetTitle($hGui, '', 'Call ' & $k) $aCursorInfo = GUIGetCursorInfo($hGui) If Not @error And $aCursorInfo[4] = $iEdit Then Local $aRet = DllCall("shell32.dll", "int", "DragQueryFile", "int", $wParam, "int", -1, "ptr", 0, "int", 0) If @error Then Return SetError(1, 0, 0) Local $sDroppedFiles, $i, $tBuffer = DllStructCreate("char[256]") For $i = 0 To $aRet[0] - 1 DllCall("shell32.dll", "int", "DragQueryFile", "int", $wParam, "int", $i, "ptr", DllStructGetPtr($tBuffer), "int", DllStructGetSize($tBuffer)) $sDroppedFiles &= DllStructGetData($tBuffer, 1) & @CRLF Next DllCall("shell32.dll", "none", "DragFinish", "int", $wParam) $tBuffer = 0 GUICtrlSetData($iEdit, StringTrimRight($sDroppedFiles, 2)) ; WinActivate($hGUI) EndIf Return "GUI_RUNDEFMSG" EndFunc Edited July 20, 2013 by AZJIO My other projects or all Link to comment Share on other sites More sharing options...
AZJIO Posted November 27, 2012 Author Share Posted November 27, 2012 I don't like the sound when an event. Native way without sound. My other projects or all Link to comment Share on other sites More sharing options...
AZJIO Posted July 20, 2013 Author Share Posted July 20, 2013 (edited) Help make the processing of multiple files of the specified below example expandcollapse popup; drag-and-drop ; http://www.autoitscript.com/forum/topic/149659-alternate-data-streams-viewer/ #include <WindowsConstants.au3> Global Const $hUSER32 = DllOpen("user32.dll") Global Const $hSHELL32 = DllOpen("shell32.dll") ; Global Const $WM_DROPFILES = 0x0233 ; in AutoIt3 v 3.3.6.1 and below this constant is not defined $sDescription = 'The function is executed when you drag objects WM_DROPFILES on window elements' & @CRLF & _ 'Unlike the native does not insert the path in the Edit control' $hGui = GUICreate('GUI, drag-and-drop', 600, 360, -1, -1, -1, $WS_EX_ACCEPTFILES) $iEdit = GUICtrlCreateEdit($sDescription, 5, 5, 590, 300) GUISetState() GUIRegisterMsg($WM_DROPFILES, "WM_DROPFILES") Do Until GUIGetMsg() = -3 ;====================================================== ; Proccessing files dropped onto the GUI Func WM_DROPFILES($hWnd, $iMsg, $wParam, $lParam) #forceref $iMsg, $lParam If $hWnd = $hGUI Then $sFile = _DragQueryFile($wParam) If @error Or StringInStr(FileGetAttrib($sFile), "D") Then ; If the error or catalog _MessageBeep(48) Return 1 EndIf _DragFinish($wParam) GUICtrlSetData($iEdit, $sFile) ; If you need long processing, then this does not insert Return 1 EndIf _MessageBeep(48) ; Если в другое окно Return 1 EndFunc ;====================================================== ;====================================================== ; Functions to handle dropped files Func _DragQueryFile($hDrop, $iIndex = 0) Local $aCall = DllCall($hSHELL32, "dword", "DragQueryFileW", _ "handle", $hDrop, _ "dword", $iIndex, _ "wstr", "", _ "dword", 32767) If @error Or Not $aCall[0] Then Return SetError(1, 0, "") Return $aCall[3] EndFunc Func _DragFinish($hDrop) DllCall($hSHELL32, "none", "DragFinish", "handle", $hDrop) EndFunc Func _MessageBeep($iType) DllCall($hUSER32, "int", "MessageBeep", "dword", $iType) EndFunc ;====================================================== It's a go expandcollapse popup; drag-and-drop ; http://www.autoitscript.com/forum/topic/149659-alternate-data-streams-viewer/ #include <WindowsConstants.au3> Global Const $hUSER32 = DllOpen("user32.dll") Global Const $hSHELL32 = DllOpen("shell32.dll") ; Global Const $WM_DROPFILES = 0x0233 ; in AutoIt3 v 3.3.6.1 and below this constant is not defined $sDescription = 'The function is executed when you drag objects WM_DROPFILES on window elements' & @CRLF & _ 'Unlike the native does not insert the path in the Edit control' $hGui = GUICreate('GUI, drag-and-drop', 600, 360, -1, -1, -1, $WS_EX_ACCEPTFILES) $iEdit = GUICtrlCreateEdit($sDescription, 5, 5, 590, 300) GUISetState() GUIRegisterMsg($WM_DROPFILES, "WM_DROPFILES") Do Until GUIGetMsg() = -3 ;====================================================== ; Proccessing files dropped onto the GUI Func WM_DROPFILES($hWnd, $iMsg, $wParam, $lParam) #forceref $iMsg, $lParam If $hWnd = $hGUI Then Local $aCall, $sDroppedFiles $aCall = DllCall($hSHELL32, "dword", "DragQueryFileW", "handle", $wParam, "dword", -1, "wstr", "", "dword", 32767) If @error Or Not $aCall[0] Then Return SetError(1, 0, "") For $i = 0 To $aCall[0] - 1 $aCall = DllCall($hSHELL32, "dword", "DragQueryFileW", "handle", $wParam, "dword", $i, "wstr", "", "dword", 32767) If @error Or Not $aCall[0] Then ; Если ошибка или каталог ExitLoop Else $sDroppedFiles &= $aCall[3] & @CRLF EndIf Next DllCall($hSHELL32, "none", "DragFinish", "handle", $wParam) GUICtrlSetData($iEdit, $sDroppedFiles) ; If you need long processing, then this does not insert Return 1 EndIf EndFunc ;====================================================== Edited July 20, 2013 by AZJIO My other projects or all Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now