James78 Posted August 24, 2008 Share Posted August 24, 2008 (edited) Ok, so far I have this code here... my GUI is looking just like I want it. #include <GUIConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 259, 309, 316, 231) $Label1 = GUICtrlCreateLabel("Drag the files you want to analyze into the box", 8, 0, 221, 17) $Button1 = GUICtrlCreateButton("Start", 8, 280, 65, 25, 0) $Label2 = GUICtrlCreateLabel("below and click start. Use the Escape key anytime", 8, 16, 242, 17) $Label3 = GUICtrlCreateLabel("during the analyzation to stop the program.", 8, 32, 204, 17) $Label4 = GUICtrlCreateLabel("Copyright (c) 2008 James Roe", 104, 288, 146, 17) $List1 = GUICtrlCreateList("", 8, 48, 241, 227) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd What I need to do after this, is pretty extensive, or maybe not for one of you guys who knows more than I. What I'm trying to do, is allow someone to drag and drop files of a specific type (html/htm only) from Windows Explorer (the file browser in Windows), and have every file be a separate item in the list. Every item in the list needs to be able to be deleted out of the list somehow (delete key, anything will work really). Then, when the start button is pressed, the program starts running through some code that I already have made. However, one small hard thing, is that every item I have in the list, I need it entered into an array (full file path needed of course). $array[0] = "C:\folder\file.html", $array[1], etc. until all the files are done. Please someone help me!! I would be appreciative of any help anyone can give me to get this done. P.S. On that note, is there anyway to figure out the last value in an array? What I mean is like, a function to count how many arrays there are. If the array goes up to $array[45], it'll count 46. Edited August 24, 2008 by James78 Link to comment Share on other sites More sharing options...
dbzfanatic Posted August 24, 2008 Share Posted August 24, 2008 (edited) For counting the arrays you can use UBound and this is taken from the helpfile. $WS_EX_ACCEPTFILES Allow an edit or input control within the created GUI window to receive filenames via drag and drop. The control must have also the $GUI_DROPACCEPTED state set by GUICtrlSetState. for other controls the drag&drop info can be retrieved with @GUI_DRAGID, @GUI_DRAGFILE, @GUIDROPID. Also for when you click the start button use Case $Button1 then just type your code below that Edited August 24, 2008 by dbzfanatic Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote] Link to comment Share on other sites More sharing options...
James78 Posted August 24, 2008 Author Share Posted August 24, 2008 (edited) Thanks, that should bring me a little closer to getting it done. If anyone can give any code examples, that'd help a lot too. Edited August 24, 2008 by James78 Link to comment Share on other sites More sharing options...
James78 Posted August 24, 2008 Author Share Posted August 24, 2008 I can't get the case to work without errors. Also, anyone have any ideas how I can get every file path to display in the list box, and be able to be removed out of it? And I really need help with setting every file to an array. Link to comment Share on other sites More sharing options...
YellowLab Posted August 24, 2008 Share Posted August 24, 2008 (edited) Put the "Case" statements in the "Switch": While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 ;whatever you want the button to do EndSwitch WEnd For the other question regarding ListBoxes, you may want to look under the GUI_ListBox Management user defined functions. Good luck! Bob Edited August 24, 2008 by YellowLab You can't see a rainbow without first experiencing the rain. 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