anzacfalcon Posted November 20, 2009 Share Posted November 20, 2009 I have currently working on a small tool which supports Drag And Drop. Here is a screenshot:As you's can see. There are 5 input boxes which do support drag and drop. What i want my program to do is when the first input box is not blank "", Enable the second input box and so on. Thank's. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 20, 2009 Moderators Share Posted November 20, 2009 anzacfalcon,And what have you tried so far? Any code to show for it? You need to trap the EN_UPDATE message. Have a go yourself and come back if you run into problems.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...
anzacfalcon Posted November 25, 2009 Author Share Posted November 25, 2009 anzacfalcon, And what have you tried so far? Any code to show for it? You need to trap the EN_UPDATE message. Have a go yourself and come back if you run into problems. M23 So faar i have tried using a while statement and made it so that if Input1 = Not "" then Input2.Enabled = True LoL dont get confused with my example code im more of a VB6 coder so i used Input2.Enabled = True as an example. What happens with this way is that the while statement rapidly check's the input box causing a flickering and this is obviously not a acceptable piece of code for this action. Understand? kthnxbai Link to comment Share on other sites More sharing options...
GEOSoft Posted November 25, 2009 Share Posted November 25, 2009 #include<GuiConstantsEx> If GUICtrlRead($input1) <> "" Then If BitAND(GuiCtrlGetState($input2), $GUI_ENABLED) <> $GUI_ENABLED Then GUICtrlSetState($Inputs, $GUI_ENABLED) EndIf Else If BitAND(GuiCtrlGetState($input2), $GUI_DISABLED) <> $GUI_DISABLED Then GUICtrlSetState($Inputs, $GUI_DISABLED) EndIf EndIf George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
anzacfalcon Posted November 25, 2009 Author Share Posted November 25, 2009 Thnx but doesn't this need a loop? Link to comment Share on other sites More sharing options...
GEOSoft Posted November 25, 2009 Share Posted November 25, 2009 Thnx but doesn't this need a loop?It would normally be used in a loop situation but it could also be in a Function or anyplace else you want it. You wanted to know how to do the AutoIt equivalent to the VBS so I showed you but I also added in state checking to prevent control flicker. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
anzacfalcon Posted November 26, 2009 Author Share Posted November 26, 2009 It would normally be used in a loop situation but it could also be in a Function or anyplace else you want it. You wanted to know how to do the AutoIt equivalent to the VBS so I showed you but I also added in state checking to prevent control flicker.Thnx alot! Link to comment Share on other sites More sharing options...
anzacfalcon Posted November 26, 2009 Author Share Posted November 26, 2009 Ok im getting "WARNING: $GUI_ENABLED: possibly used before declaration. If BitAND(GuiCtrlGetState($input2), $GUI_ENABLED)" Link to comment Share on other sites More sharing options...
GEOSoft Posted November 26, 2009 Share Posted November 26, 2009 Ok im getting "WARNING: $GUI_ENABLED: possibly used before declaration. If BitAND(GuiCtrlGetState($input2), $GUI_ENABLED)"That was my fault. Change $GUI_ENABLED to $GUI_ENABLE and change $GUI_DISABLED to $GUI_DISABLE. I generally don't use constants in my scripts so I get them wrong once in a while. George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" Link to comment Share on other sites More sharing options...
anzacfalcon Posted November 26, 2009 Author Share Posted November 26, 2009 That was my fault. Change $GUI_ENABLED to $GUI_ENABLE and change $GUI_DISABLED to $GUI_DISABLE. I generally don't use constants in my scripts so I get them wrong once in a while.Yes i figured this out. If i didnt, i would of been having a stress tandrum lmao. Link to comment Share on other sites More sharing options...
anzacfalcon Posted November 26, 2009 Author Share Posted November 26, 2009 expandcollapse popup#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> Local $Button1 #Region ### START Koda GUI section ### Form=C:\Documents and Settings\Haluk\Desktop\Form1_1.kxf $Form1_1 = GUICreate("Form1", 414, 554, 707, 340, -1, BitOR($WS_EX_ACCEPTFILES,$WS_EX_WINDOWEDGE)) GUISetBkColor(0xFFFFFF) $Label1 = GUICtrlCreateLabel("Auto NoVirusThanks Scanner", 54, 24, 311, 44) GUICtrlSetFont(-1, 16, 400, 0, "MS Reference Sans Serif") $Button1 = GUICtrlCreateButton("Scan", 112, 496, 193, 41, $WS_GROUP) GUICtrlSetFont(-1, 20, 400, 0, "Microsoft Sans Serif") $Input1 = GUICtrlCreateInput("", 63, 120, 321, 21) GUICtrlSetState($Input1,$GUI_DROPACCEPTED) $Input2 = GUICtrlCreateInput("", 64, 152, 321, 21) $Input3 = GUICtrlCreateInput("", 64, 184, 321, 21) $Input4 = GUICtrlCreateInput("", 64, 216, 321, 21) $Input5 = GUICtrlCreateInput("", 64, 248, 321, 21) GUICtrlSetState ( $Input2, $GUI_DISABLE ) GUICtrlSetState ( $Input3, $GUI_DISABLE ) GUICtrlSetState ( $Input4, $GUI_DISABLE ) GUICtrlSetState ( $Input5, $GUI_DISABLE ) $Label2 = GUICtrlCreateLabel("File 1", 24, 120, 29, 25) $Label3 = GUICtrlCreateLabel("File 2", 24, 152, 29, 17) $Label4 = GUICtrlCreateLabel("File 3", 24, 184, 29, 17) $Label5 = GUICtrlCreateLabel("File 4", 24, 216, 29, 17) $Label6 = GUICtrlCreateLabel("File 5", 24, 248, 29, 17) $Label7 = GUICtrlCreateLabel("Choose Browser:", 117, 360, 168, 28) GUICtrlSetFont(-1, 14, 400, 0, "MS Reference Sans Serif") $Firefox = GUICtrlCreateRadio("Firefox 3", 24, 437, 121, 25) GUICtrlSetState(-1, $GUI_CHECKED) GUICtrlSetFont(-1, 16, 400, 0, "MS Reference Sans Serif") $IE = GUICtrlCreateRadio("Internet Explorer 8", 166, 437, 225, 25) GUICtrlSetFont(-1, 16, 400, 0, "MS Reference Sans Serif") $Group1 = GUICtrlCreateGroup("Browser Setting's", 16, 328, 377, 145) GUICtrlCreateGroup("", -99, -99, 1, 1) $Group2 = GUICtrlCreateGroup("Main", 8, 96, 393, 209) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $msg = GUIGetMsg() If $msg = -3 Then Exit If $msg = $Button1 And GUICtrlRead ( $Firefox ) = $GUI_CHECKED Then ;ScanFF() $Input1 = GUICtrlRead($input1) MsgBox ( 64, "lol", $Input1) EndIf If GUICtrlRead($input1) <> "" Then If BitAND(GuiCtrlGetState($input2), $GUI_ENABLE) <> $GUI_ENABLE Then GUICtrlSetState($Input2, $GUI_ENABLE) GUICtrlSetState($Input2,$GUI_DROPACCEPTED) EndIf EndIf If GUICtrlRead($input2) <> "" Then If BitAND(GuiCtrlGetState($input3), $GUI_ENABLE) <> $GUI_ENABLE Then GUICtrlSetState($Input3, $GUI_ENABLE) GUICtrlSetState($Input3,$GUI_DROPACCEPTED) EndIf EndIf If GUICtrlRead($input3) <> "" Then If BitAND(GuiCtrlGetState($input4), $GUI_ENABLE) <> $GUI_ENABLE Then GUICtrlSetState($Input4, $GUI_ENABLE) GUICtrlSetState($input4,$GUI_DROPACCEPTED) EndIf EndIf If GUICtrlRead($input4) <> "" Then If BitAND(GuiCtrlGetState($input5), $GUI_ENABLE) <> $GUI_ENABLE Then GUICtrlSetState($Input5, $GUI_ENABLE) GUICtrlSetState($Input5,$GUI_DROPACCEPTED) EndIf EndIf WEnd Func ScanFF() Run("C:\Program Files\Mozilla Firefox\firefox.exe") WinWaitActive("Mozilla Firefox") MouseClick( "left" , 662, 68 ) Sleep ( 500 ) Send("http://scanner.novirusthanks.org/") Send("{ENTER}") WinWaitActive("NoVirusThanks - Free Online Virus & Malware Scan Service - Mozilla Firefox") Sleep(1000) MouseClick("left" ,482, 649) MouseClick("left" ,821, 561) Send($Input1) Send("{ENTER}") MouseClick("left" ,552, 606) Ok, when the value of say for example "Input1" is read, i get a "0" or a number. I have managed to get the result the first time i drag the file into the inputbox and use my messagebox to show it but the second time it changes to a "0". Anyone know the problem? Link to comment Share on other sites More sharing options...
anzacfalcon Posted November 28, 2009 Author Share Posted November 28, 2009 Somebody please reply! Link to comment Share on other sites More sharing options...
anzacfalcon Posted November 28, 2009 Author Share Posted November 28, 2009 I figured it out. 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