mdd Posted October 3, 2018 Posted October 3, 2018 Hi, Please share the code for Drag'n'drop from Windows Explorer to Application for windows 10 Thanks
Earthshine Posted October 3, 2018 Posted October 3, 2018 (edited) You write it, we help get it working Edited October 3, 2018 by Earthshine Skeletor 1 My resources are limited. You must ask the right questions
FrancescoDiMuro Posted October 3, 2018 Posted October 3, 2018 (edited) 3 minutes ago, mdd said: Please share the code for Drag'n'drop from Windows Explorer to Application for windows 10 Which code? But, mostly, which application? Need more information about what you're attempting to do Edited October 3, 2018 by FrancescoDiMuro Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette
AutoBert Posted October 3, 2018 Posted October 3, 2018 (edited) Here's a old script, a MP3 player with this feature. The included bilderdaten.au3 is to big for upload. I'm sure you can get it runing without to see the result. The func's WM_DROPFILES_FUNC, _FilesDropped and lines Global $idfrmChild = GUICreate($sProgTitel & $sProgVer, $iWidht, $iHeight - 35, 1, 35, $WS_POPUP, BitOR($WS_EX_MDICHILD, $WS_EX_ACCEPTFILES), $idfrmMain) ... ... GUISetOnEvent($GUI_EVENT_DROPPED, "_FilesDropped") are the most important for your own project. Wiped my script: expandcollapse popup#include <StaticConstants.au3> #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <ButtonConstants.au3> #include <GuiListView.au3> ;#include <array.au3> #include <File.au3> #include <Misc.au3> #include <EditConstants.au3> #include <String.au3> Opt("GUIOnEventMode", 1) ;ONEvent Mode. Opt("MustDeclareVars", 1) Global $sLiz = "Settings.Dat", $sLVdat = "Files" Global $iWidht = 600, $iHeight = 600, $hListView Global $idContextmenu, $idInsertitem, $idRenameitem, $idDeletemenu, $idDeleteAll, $idDeleteitem Global $aDropFiles[1] Global $sProgTitel = "Drag&Drop files to LV DEMO ", $sProgVer = "0.8.5.8" Global $out ;#cs If _Singleton($sProgTitel & $sProgVer, 1) = 0 Then ; MsgBox(64, $sProgTitel & $sProgVer, $sProgTitel & $sProgVer & ' ist bereits gestartet',5) WinActivate($sProgTitel & $sProgVer) If _Singleton($sProgTitel & "Einstellungen", 1) Then WinActivate($sProgTitel & "Einstellungen") EndIf Exit EndIf ;#ce Global $hGUI = GUICreate($sProgTitel & $sProgVer, $iWidht, $iHeight - 35, 1, 35, Default, $WS_EX_ACCEPTFILES) GUISetOnEvent($GUI_EVENT_DROPPED, "_FilesDropped") GUISetOnEvent($GUI_EVENT_CLOSE, "_ExitMain") Local $idLV_Player = GUICtrlCreateListView("Name: |Beschreibung |Pfad", 5, 5, $iWidht - 10, $iHeight - 45, BitOR($LVS_SHOWSELALWAYS, $LVS_REPORT)) GUICtrlSetState(-1, $GUI_DROPACCEPTED) GUICtrlSetFont(-1, 9, 800) GUICtrlSetResizing(-1, $GUI_DOCKBORDERS) _LoadLVs() _GUICtrlListView_SetColumnWidth($idLV_Player, 0, $LVSCW_AUTOSIZE) _GUICtrlListView_SetColumnWidth($idLV_Player, 1, 0) ;zweite Spalte versteckt wird derzeit nicht benutzt _GUICtrlListView_SetColumnWidth($idLV_Player, 2, $LVSCW_AUTOSIZE) ;dritte Spalte versteckt $idContextmenu = GUICtrlCreateContextMenu($idLV_Player) $idDeletemenu = GUICtrlCreateMenu("Löschen...", $idContextmenu) $idDeleteAll = GUICtrlCreateMenuItem("Alle Einträge", $idDeletemenu) GUICtrlSetOnEvent(-1, '_DeleteAll') $idDeleteitem = GUICtrlCreateMenuItem("ausgewählte Einträge", $idDeletemenu) GUICtrlSetOnEvent(-1, '_DeleteItem') GUICtrlCreateMenuItem("", $idContextmenu) _Config() GUISetState() GUIRegisterMsg($WM_DROPFILES, "WM_DROPFILES_FUNC") While 1 Sleep(1000) WEnd #Region ;funcs für Fensterhandling Func _Config() Local $aPos[4], $i, $j $aPos[0] = IniRead($sLiz, "Pos", "x", "20") $aPos[1] = IniRead($sLiz, "Pos", "y", "20") WinMove($hGUI, '', $aPos[0], $aPos[1]) EndFunc ;==>_Config Func _SaveConfig() Local $i, $aPos = WinGetPos($hGUI) IniWrite($sLiz, "Pos", "x", $aPos[0]) IniWrite($sLiz, "Pos", "y", $aPos[1]) IniWrite($sLiz, "Pos", "width", $aPos[2]) IniWrite($sLiz, "Pos", "height", $aPos[3]) For $i = 0 To _GUICtrlListView_GetColumnCount($idLV_Player) - 1 IniWrite($sLiz, "Player", "Col[" & $i & "]", _GUICtrlListView_GetColumnWidth($idLV_Player, $i)) Next EndFunc ;==>_SaveConfig Func _exitMain() _saveLVs() _SaveConfig() Exit EndFunc ;==>_exitMain Func _Minimize() GUISetState(@SW_MINIMIZE, $hGUI) EndFunc ;==>_Minimize Func _DeleteAll() _GUICtrlListView_DeleteAllItems(GUICtrlGetHandle($idLV_Player)) EndFunc ;==>_DeleteAll Func _Deleteitem() _GUICtrlListView_DeleteItemsSelected(GUICtrlGetHandle($idLV_Player)) EndFunc ;==>_Deleteitem #EndRegion ;funcs für Fensterhandling Func _saveLVs() Local $sFile, $aItem, $hFileOut $hFileOut = FileOpen($sLVdat, 2) For $j = 0 To _GUICtrlListView_GetItemCount($idLV_Player) - 1 $aItem = _GUICtrlListView_GetItemTextString($idLV_Player, $j) FileWriteLine($hFileOut, $aItem) Next FileClose($hFileOut) EndFunc ;==>_saveLVs Func _LoadLVs() Local $aItems If FileExists($sLVdat) Then $aItems = "" _FileReadToArray($sLVdat, $aItems) If IsArray($aItems) Then _GUICtrlListView_DeleteAllItems($idLV_Player) ;;;_ArrayDisplay($aItems) For $j = 1 To $aItems[0] GUICtrlCreateListViewItem($aItems[$j], $idLV_Player) Next EndIf EndIf EndFunc ;==>_LoadLVs #Region ;Drag and Drop Func WM_DROPFILES_FUNC($hWnd, $msgID, $wParam, $lParam) Local $nSize, $pFileName Local $nAmt = DllCall("shell32.dll", "int", "DragQueryFile", "hwnd", $wParam, "int", 0xFFFFFFFF, "ptr", 0, "int", 255) For $i = 0 To $nAmt[0] - 1 $nSize = DllCall("shell32.dll", "int", "DragQueryFile", "hwnd", $wParam, "int", $i, "ptr", 0, "int", 0) $nSize = $nSize[0] + 1 $pFileName = DllStructCreate("char[" & $nSize & "]") DllCall("shell32.dll", "int", "DragQueryFile", "hwnd", $wParam, "int", $i, "ptr", DllStructGetPtr($pFileName), "int", $nSize) ReDim $aDropFiles[$i + 1] $aDropFiles[$i] = DllStructGetData($pFileName, 1) $pFileName = 0 Next EndFunc ;==>WM_DROPFILES_FUNC Func _FilesDropped() Local $szDrive, $szDir, $szFName, $szExt, $split _GUICtrlListView_BeginUpdate($idLV_Player) For $i = 0 To UBound($aDropFiles) - 1 $split = _PathSplit($aDropFiles[$i], $szDrive, $szDir, $szFName, $szExt) $szExt = StringUpper($szExt) ;;consolewrite($aDropFiles[$i] & ", " & $szExt & @CRLF) Switch $szExt ;Case ".MP3", ".MPEG", ".MPG", ".WAV" ; Case ".MP3", ".WMV", ".WAV" ;bei MPEG gehen Fenster mit Video auf werden aber nciht wieder geschlossen ;wenn das gerade laufende Video geschlossen wird hängt sich Programm auf ;daher keine MPEG MPG GUICtrlCreateListViewItem($szFName & "||" & $aDropFiles[$i], $idLV_Player) EndSwitch Next _GUICtrlListView_SetColumnWidth($idLV_Player, 0, $LVSCW_AUTOSIZE) _GUICtrlListView_EndUpdate($idLV_Player) EndFunc ;==>_FilesDropped #EndRegion ;Drag and Drop Only MP3, WMV, MPG and WAV Files are allowed in this demo, other files are ignored. Edited October 3, 2018 by AutoBert
mdd Posted October 4, 2018 Author Posted October 4, 2018 (edited) 18 hours ago, FrancescoDiMuro said: Which code? But, mostly, which application? Need more information about what you're attempting to do is it possible to drag and drop the folder from explorer into image application using autoit automation tool? The folder contains .arw or .arq files if yes, please share some inputs for the same Edited October 4, 2018 by mdd
FrancescoDiMuro Posted October 4, 2018 Posted October 4, 2018 @mdd Your request is not clear enough. Do you want to drag and drop ANY folder from Windows Explorer to ANY application? Is this application created by you? Then, if those files are images, you want to display them after the drag and drop finished? Give us as much information as you can. Post some code if you have. Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette
mdd Posted October 4, 2018 Author Posted October 4, 2018 (edited) 5 hours ago, FrancescoDiMuro said: Do you want to drag and drop ANY folder from Windows Explorer to ANY application? @FrancescoDiMuro yes, drag and drop any folder from windows explorer to the application folder Edited October 4, 2018 by mdd
mdd Posted October 4, 2018 Author Posted October 4, 2018 (edited) 40 minutes ago, FrancescoDiMuro said: Is this application created by you? @FrancescoDiMuro no, application is developed in mfc programming Edited October 4, 2018 by mdd
mdd Posted October 4, 2018 Author Posted October 4, 2018 (edited) 40 minutes ago, FrancescoDiMuro said: if those files are images, you want to display them after the drag and drop finished? @FrancescoDiMuro yes, it should display the images(.arw/ arq images) after drag and drop is finished into the application Edited October 4, 2018 by mdd
mdd Posted October 4, 2018 Author Posted October 4, 2018 (edited) 1 hour ago, FrancescoDiMuro said: Post some code if you have @FrancescoDiMuro i dont have the code, is it possible to drag and drop the images from explorer to the application folder? Edited October 4, 2018 by mdd
FrancescoDiMuro Posted October 4, 2018 Posted October 4, 2018 1 hour ago, mdd said: is it possible to drag and drop the images from explorer to the application folder? Couldn't you simply copy instead of dragging and dropping them folder to folder? Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette
mdd Posted October 4, 2018 Author Posted October 4, 2018 1 hour ago, FrancescoDiMuro said: Couldn't you simply copy instead of dragging and dropping them folder to folder? @FrancescoDiMuro No copy functionality exist in the application, we have to drag and drop the images from the explorer to the application
mdd Posted October 9, 2018 Author Posted October 9, 2018 Hi @Melba23 please give some inputs/information for the above query Thanks
Moderators Melba23 Posted October 12, 2018 Moderators Posted October 12, 2018 mdd, I dislike people demanding by name that I respond to their threads - just as I do not appreciate being PMed about the same matter. Please do neither again. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
mdd Posted October 17, 2018 Author Posted October 17, 2018 ok @Melba23, sorry for inconvenience, i will not do again for the same
FrancescoDiMuro Posted October 17, 2018 Posted October 17, 2018 @mdd So, you have a list of files ( pictures ) in a folder, and you would like to drag and drop them in another application. If this is what you're trying to do, the first thing you should do is get the list of files with _FileListToArray() or _FileListToArrayRec(). Then, you could think to copy these files to the clipboard, and pasting them in your application... Did you already try that manually? Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette
mdd Posted October 17, 2018 Author Posted October 17, 2018 3 minutes ago, FrancescoDiMuro said: copy these files to the clipboard, and pasting them in your application... Did you already try that manually @FrancescoDiMuro I tried manually, this functionality does not exist in the application
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