Moderators Melba23 Posted February 25, 2009 Moderators Share Posted February 25, 2009 Evening,I have been playing with Drag and Drop this afternoon and could not get it to work at all when run from within SciTE. Running out of ideas, I tried compiling the same script and then running the .exe and bingo - success!My question: Is it normal that Drag and Drop does not work when the script run in SciTE? Or is it a function of Vista - AutoIt 3.3.0.0 - SciTE 1.77? Or just me (perhaps the most likely!)? I would be grateful if someone could offer an answer - and explanation if required.The code I was using:#include <ListviewConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Include <GuiListView.au3> $hGUI = GUICreate("Dropped Files", 500, 400, Default, Default, Default, $WS_EX_ACCEPTFILES) $hListview = GUICtrlCreateListView("File List", 10, 10, 480, 380) GUICtrlSetState(-1, $GUI_DROPACCEPTED) _GUICtrlListView_SetColumnWidth(-1, 0, $LVSCW_AUTOSIZE_USEHEADER) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $GUI_EVENT_DROPPED $file = @GUI_DragFile _GUICtrlListView_AddItem($hListview, $file) EndSwitch WEndThanks in advance for any enlightenment.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 Link to comment Share on other sites More sharing options...
motionman95 Posted February 25, 2009 Share Posted February 25, 2009 I think your sytax for _GUICtrlListView_AddItem is wrong... Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 25, 2009 Author Moderators Share Posted February 25, 2009 motionman95,Well I do not. From the Help file:"_GUICtrlListView_AddItem($hWnd, $sText[, $iImage = -1[, $iParam = 0]])"$hWnd - Handle to the control, $sText - Item text"As I stated above, but repeat here for those who apparently cannot read: this script works perfectly - but only when compiled. That is the question I am looking to have answered - NOT does this script work!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 Link to comment Share on other sites More sharing options...
martin Posted February 25, 2009 Share Posted February 25, 2009 I think your sytax for _GUICtrlListView_AddItem is wrong... Yes _GUICtrlListView_AddItem(GuiCtrlGetHandle($hListview), $file) Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
SpookMeister Posted February 25, 2009 Share Posted February 25, 2009 Evening, I have been playing with Drag and Drop this afternoon and could not get it to work at all when run from within SciTE. Running out of ideas, I tried compiling the same script and then running the .exe and bingo - success! My question: Is it normal that Drag and Drop does not work when the script run in SciTE? Or is it a function of Vista - AutoIt 3.3.0.0 - SciTE 1.77? Or just me (perhaps the most likely!)? I would be grateful if someone could offer an answer - and explanation if required. The code I was using:#include <ListviewConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Include <GuiListView.au3> $hGUI = GUICreate("Dropped Files", 500, 400, Default, Default, Default, $WS_EX_ACCEPTFILES) $hListview = GUICtrlCreateListView("File List", 10, 10, 480, 380) GUICtrlSetState(-1, $GUI_DROPACCEPTED) _GUICtrlListView_SetColumnWidth(-1, 0, $LVSCW_AUTOSIZE_USEHEADER) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit Case $GUI_EVENT_DROPPED $file = @GUI_DragFile _GUICtrlListView_AddItem($hListview, $file) EndSwitch WEnd Thanks in advance for any enlightenment. M23This code worked as expected (got a listing of paths for files I dragged and dropped into the window) from SciTE on my system. Win XP Pro SP3 SciTE Version 1.77 Oct 23 2008 19:06:08 AutoIt v3.3.0.0 [u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote] Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 25, 2009 Author Moderators Share Posted February 25, 2009 martin,From that Help file again - taken from the example for _GUICtrlListView_AddItem:GUICreate("ListView Add Item", 400, 300) $hListView = GUICtrlCreateListView("", 2, 2, 394, 268) ..... _GUICtrlListView_AddItem($hListView, "Row 1: Col 1", 0)But even more confusingly your syntax does work for me as well......but only when I run it compiled and not when I run it in SciTE.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 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 25, 2009 Author Moderators Share Posted February 25, 2009 SpookMeister,Thank you for that. I wonder if it is Vista thing given that the other 2 elements (AutoIt and SciTE) are the same for both of us? Would not surprise me!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 Link to comment Share on other sites More sharing options...
martin Posted February 25, 2009 Share Posted February 25, 2009 martin, From that Help file again - taken from the example for _GUICtrlListView_AddItem:GUICreate("ListView Add Item", 400, 300) $hListView = GUICtrlCreateListView("", 2, 2, 394, 268) ..... _GUICtrlListView_AddItem($hListView, "Row 1: Col 1", 0) But even more confusingly your syntax does work for me as well......but only when I run it compiled and not when I run it in SciTE. M23GUICtrlCreateListView returns an identifer not a handle. Maybe in Vista the identifiers in a compiled script are handles, I don't know, but your script is incorrect. Some UDFs test to see if the parameter passed is a handle and if not assume it is the id and then get the handle from it. Maybe you are running one version of the udf in scrite and another version when you compile. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
SpookMeister Posted February 25, 2009 Share Posted February 25, 2009 Just a weird thought... when you start scite do you do the run as administrator deal? [u]Helpful tips:[/u]If you want better answers to your questions, take the time to reproduce your issue in a small "stand alone" example script whenever possible. Also, make sure you tell us 1) what you tried, 2) what you expected to happen, and 3) what happened instead.[u]Useful links:[/u]BrettF's update to LxP's "How to AutoIt" pdfValuater's Autoit 1-2-3 Download page for the latest versions of Autoit and SciTE[quote]<glyph> For example - if you came in here asking "how do I use a jackhammer" we might ask "why do you need to use a jackhammer"<glyph> If the answer to the latter question is "to knock my grandmother's head off to let out the evil spirits that gave her cancer", then maybe the problem is actually unrelated to jackhammers[/quote] Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 25, 2009 Author Moderators Share Posted February 25, 2009 martin, Digging down into GUIListView.au3 there is a test for "handle or ControlID" here - so either syntax should work:Func _GUICtrlListView_GetUnicodeFormat($hWnd) If $Debug_LV Then _GUICtrlListView_ValidateClassName($hWnd) If IsHWnd($hWnd) Then Return _SendMessage($hWnd, $LVM_GETUNICODEFORMAT) <> 0 Else Return GUICtrlSendMsg($hWnd, $LVM_GETUNICODEFORMAT, 0, 0) <> 0 EndIf EndFunc ;==>_GUICtrlListView_GetUnicodeFormat But that still leaves the question of why there is the difference (for me at least) between running in SciTE and as a compiled .exe. I am only using the same include files as were supplied in the AutoIt install package and not changing it when compiling. 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 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 25, 2009 Author Moderators Share Posted February 25, 2009 SpookMeister, Thanks for the thought - but the answer is yes. 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 Link to comment Share on other sites More sharing options...
martin Posted February 25, 2009 Share Posted February 25, 2009 martin, Digging down into GUIListView.au3 there is a test for "handle or ControlID" here - so either syntax should work:Func _GUICtrlListView_GetUnicodeFormat($hWnd) If $Debug_LV Then _GUICtrlListView_ValidateClassName($hWnd) If IsHWnd($hWnd) Then Return _SendMessage($hWnd, $LVM_GETUNICODEFORMAT) <> 0 Else Return GUICtrlSendMsg($hWnd, $LVM_GETUNICODEFORMAT, 0, 0) <> 0 EndIf EndFunc ;==>_GUICtrlListView_GetUnicodeFormat But that still leaves the question of why there is the difference (for me at least) between running in SciTE and as a compiled .exe. I am only using the same include files as were supplied in the AutoIt install package and not changing it when compiling. M23Looking at the GuiListView.au3 udf for Beta 3.3.0.0 and production 3.2.13.13, they both allow for either an ID or a handle, so I would think that what I said before is most likely, that unknowingly you are compiling with a different version of GuiListView.au3. Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 25, 2009 Author Moderators Share Posted February 25, 2009 martin,Sorry, just the one GuiListView.au3 file from the 3.3.0.0 install on the whole machine that Search can find. It must be Vista not liking it for some reason.Thanks for taking the time to reply.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 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