Jump to content

Search the Community

Showing results for tags 'guictrlread'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 13 results

  1. Hello! Please help me with this small problem I've encountered while learning to make GUI. I'm not able to get the set slider values out of sliders and I can't figure out why. The slider value in the example is preset to 1, but whatever I set the slider to, it returns the value 3 when I click Apply and I havn't set any value to 3. Where is that 3 coming from? #include <SliderConstants.au3> #include <MsgBoxConstants.au3> #include <GUIConstantsEx.au3> Global $LRSlider Opt("GUIOnEventMode", 1) Global $Form1 = GUICreate("test slider", 200, 200, -1, -1) Global $LRSlider = GUICtrlCreateSlider(50, 50, 100, 20, $TBS_TOOLTIPS) GUICtrlSetLimit($LRSlider, 50, 1) GUICtrlSetData($LRSlider, 1) GUISetOnEvent($GUI_EVENT_CLOSE, "Exit1") Global $ApplyButton = GUICtrlCreateButton("APPLY", 100, 150, 89, 17) GUICtrlSetOnEvent($ApplyButton, "Apply") GUISetState(@SW_SHOW) Func Apply() GUICtrlRead($LRSlider) MsgBox(0, 0, $LRSlider) GUICtrlSetData($LRSlider, $LRSlider) EndFunc ;==>Apply Func Exit1() Exit EndFunc ;==>Exit1 While 1 Sleep(200) WEnd
  2. One statement of GUICtrlRead() fails. Result is always "Long/Short" in written file. The other GUICtrlRead() calls work as expected Func GetScanSettings() ; Read User Input for scan Local $collectusername, $collectlot, $collectsample $UserFile = "Sample.dat" ; Global $UserFile = save this scan's parameters $datafile = FileOpen($UserFile) If( $datafile <> -1) Then $collectusername = FileReadLine($datafile, 1) EndIf FileClose($datafile) ; now open a new 'clean' file.. $datafile = FileOpen($UserFile,$FO_OVERWRITE ) ;Create GUI $Main = GUICreate('Enter Sample Detail', 500, 500) Opt("GUICoordMode",1) If( $collectusername <> "") Then $username = GUICtrlCreateInput($collectusername,100,20,100,20) Else $username = GUICtrlCreateInput('',100,20,100,20) EndIf $usernamelabel = GUICtrlCreateLabel('Username',30,22) $FileName = GUICtrlCreateInput("",100,45,100,0) $FileNamelabel = GUICtrlCreateLabel('File Name',30,47) $BatchNum = GUICtrlCreateInput("",100,65,100,0) $BatchNumlabel = GUICtrlCreateLabel('Lot',30,72) $SampleNum = GUICtrlCreateInput("",100,85,100,0) $SampleNumlabel = GUICtrlCreateLabel('Sample',30,97) $SampleLS = GUICtrlCreateInput("",100,105,100,0) $SampleNumLS = GUICtrlCreateLabel('Long/Short',30,117) $Button_1 = GUICtrlCreateButton ("OK", 190, 170, 0, 0, 0x0001) GUISetState (); Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() ; complete data entries Select Case $msg = $Button_1 $collectusername = GUICtrlRead($username) WinSetState('Collect Username','',@SW_HIDE) $collectfilename = GUICtrlRead($FileName) $collectlot = GUICtrlRead($BatchNum) $collectsample = GUICtrlRead($SampleNum) $collectLS = GUICtrlRead($SampleNumLS) ; Do ; $collectLS = GUICtrlRead($SampleNumLS) ; If $collectLS <> 'Long' And $collectLS <> 'Short' Then ; Soundplay("Windows XP Error.wav", 1) ; $collectLS = "" ; EndIf ; Until $collectLS = 'Long' Or $collectLS = 'Short' ExitLoop EndSelect Wend GUIDelete($Main) FileWrite($datafile,$collectusername & @CRLF & $collectfilename & @CRLF & $collectlot _ & @CRLF & $collectsample & @CRLF & 'Long' & @CRLF ) ; $collectLS & @CRLF) FileClose($datafile) EndFunc ;<=== GetScanSettings ================== I also tried to force user to enter either 'Short' or 'Long' but I got that wrong also The final FileWrite() edited so I do have a correct result. sample.dat Pete FilenamePete Num1 Samp2 Long/Short
  3. im getting strange output in array display,$split_[1] is not properly aligned to other arrays and why guictrlsetdata is not writting any data if i put comma(,) at the end of the text in $Input1??? #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Array.au3> #Region ### START Koda GUI section ### Form=C:\Users\user\Desktop\Script\StringSplit.kxf $Form1 = GUICreate("Form1", 623, 449, 192, 114) $Input1 = GUICtrlCreateInput("50UGITQ421X, 50UGITQ422X, 50UGITQ423X, 50UGITQ427X, 50UGITQ431X, 50UGITQ435X, 50UGITQ436X, 50UGITQ437X, 50UGITQ441X, 50UGITQ445X, 50UGITQ449X, 50UGITQ453X, 50UGITQ454X, 50UGITQ455X, 50UGITQ459X", 24, 16, 553, 21) $Split = GUICtrlCreateButton("Split", 24, 48, 75, 25) $List1 = GUICtrlCreateList("", 24, 96, 553, 97) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Split $read = GUICtrlRead($Input1) $split_ = StringSplit($read, ",") $Max = UBound($split_, 1) For $i = 1 To UBound($split_) - 1 ConsoleWrite($split_[$i] & @CRLF) ;~ ControlSetText($Form1, "", $List1, $split_[$i]) GUICtrlSetData($List1, $split_[$i]) ;~ GUICtrlSetData($List1, $split_[$i]) ;~ GUICtrlSetData($List1, $i) Next _ArrayDisplay($split_) EndSwitch WEnd
  4. Hello World!!!, please I need help I wanted to read the GUICreateInput, I don't know whats wrong with my script. #include <GUIConstantsEx.au3> #include <GUIListView.au3> #include <GUIListViewEx.au3> GUICreate("My GUI", 300, 100) GUISetState(@SW_SHOW) Local $sInput = GUICtrlCreateInput("", 150, 50, 50, 20) Local $sRead = GUICtrlRead($sInput,0) Local $sAdd = GUICtrlCreateButton("Read", 80, 50, 50, 20) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $iAdd MsgBox(0, "Input!!!", $sRead) EndSwitch WEnd
  5. Hi Wiki has this entry: https://www.autoitscript.com/wiki/Label, which differs from the actual Help file. I can not READ the value of a LABEL. Code GuiCtrlRead($myLabel) returns "False". Help appreciated.
  6. Hi guys When I run this part of my script If GUICtrlRead(Input1) = "" Then on_Close() it closes that gui window but still sends 0 I want it to send nothing if the user don't type anything anyone know how to fix this? thanks this is my full script the GUICtrlRead(input1) = "" Then on_Close() is near the bottom of the script #RequireAdmin #include <IE.au3> #include <ComboConstants.au3> #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <File.au3> #include <AutoEmail.au3> Opt("GUIOnEventMode", 1) AutoItSetOption ( "TrayIconDebug", 1 ) Global $AutoEmail, $AutoReplace_GUI = 9999, $Gmail_Button, $Hotmail_Button, $AutoReplace_Button = 9999 ; Predeclare the variables with dummy values to prevent firing the Case statements Global $Gmail1_Button, $Gmail2_Button, $Hotmail1_Button, $Hotmail2_Button, $Input1, $Input2, $Input3, $Input4 Global $Gmail, $Hotmail, $cCombo, $cCombo2 Global $sFilename = @ScriptFullPath Global $DataFromUser GUI_AutoEmail() Func GUI_AutoEmail() $AutoEmail = GUICreate("Auto Email", 339, 125, @DesktopWidth, @DesktopHeight) $aTaskbar = WinGetPos("[CLASS:Shell_TrayWnd]", "") $aWin = WinGetPos($AutoEmail) WinMove($AutoEmail, "", @DesktopWidth - $aWin[2] - 4, @DesktopHeight - $aWin[3] - $aTaskbar[3] - 4) GUISetOnEvent($GUI_EVENT_CLOSE, "On_Close") ; Call a common GUI close function $Gmail_Button = GUICtrlCreateButton("Gmail", 64, 16, 49, 41, $BS_ICON) GUICtrlSetImage(-1, "C:\Program Files\AutoEmail\gmail_icon.ico", 1) $Hotmail_Button = GUICtrlCreateButton("Hotmail", 223, 16, 49, 41, $BS_ICON) GUICtrlSetImage(-1, "C:\Program Files\AutoEmail\MSMail_icon.ico", 1) Global $cCombo = GUICtrlCreateCombo("", 16, 72, 145, 25) GUICtrlSetData(-1, "YourAccount1@gmail.com|YourAccount2@gmail.com", "YourAccount1@gmail.com") $cCombo2 = GUICtrlCreateCombo("", 176, 72, 145, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) GUICtrlSetData(-1, "YourAccount1@hotmail.com|YourAccount2@hotmail.com", "YourAccount1@hotmail.com") Global $msg GUICtrlSetOnEvent(3, "On_Button") GUICtrlSetOnEvent(4, "On_Button") GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function $AutoReplace_Button = GUICtrlCreateButton("Add Your Email", 10, 100, 80, 30) GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function GUISetState() EndFunc Func On_Button() Switch @GUI_CTRLID ; See which button sent the message Case $Gmail_Button Gmail() Case $Hotmail_Button Hotmail() Case $AutoReplace_Button GUICtrlSetState($AutoReplace_Button, $GUI_DISABLE) GUI_AutoReplace() Case $Gmail1_Button AddEmail1() Case $Gmail2_Button AddEmail2() Case $Hotmail1_Button AddEmail3() Case $Hotmail2_Button AddEmail4() EndSwitch EndFunc ;--------------------------------------- This is the Main App Read Combos --------------------------------------------------------------------- While 1 Sleep(10) WEnd Func Gmail() $DataFromUser = GUICtrlRead($cCombo) If $DataFromUser = "YourAccount1@gmail.com" Then gmail_login1() EndIf $DataFromUser = GUICtrlRead($cCombo) If $DataFromUser = "YourAccount2@gmail.com" Then gmail_login2() EndIf EndFunc Func Hotmail() $DataFromUser = GUICtrlRead($cCombo2) If $DataFromUser = "YourAccount1@hotmail.com" Then hotmail_login1() EndIf $DataFromUser = GUICtrlRead($cCombo2) If $DataFromUser = "YourAccount2@hotmail.com" Then hotmail_login2() EndIf EndFunc ;----------------------------------------------------- This sends account info to web Browser & Logs in ------------------------------------------------------------ Func gmail_login1() Sleep (60) Global $oIE =_IECreate ("https://accounts.google.com/ServiceLogin?sacu=1&continue=http%3A%2F%2Fmail.google.com%2Fmail%2F%3Fpc%3Dtopnav-about-en&hl=en&service=mail") local $username = _IEGetObjByName ($oIE, "Email") Local $password = _IEGetObjByName ($oIE, "Passwd") Local $Email_button = _IEGetObjByName ($oIE, "Email") Local $Signin_button = _IEGetObjByName ($oIE,"signIn") _IEFormElementSetValue ($username, "YourAccount1@gmail.com") ;<===== Here you put your Gmail Account Name _IEFormElementSetValue ($password, "Your Password") ;<===== Here you put your Gmail Account Password _IEAction ($Email_button, "click") _IEAction ($Signin_button, "click") EndFunc Func gmail_login2() Sleep(60) Global $oIE =_IECreate ("https://accounts.google.com/ServiceLogin?sacu=1&continue=http%3A%2F%2Fmail.google.com%2Fmail%2F%3Fpc%3Dtopnav-about-en&hl=en&service=mail") local $username = _IEGetObjByName ($oIE, "Email") Local $password = _IEGetObjByName ($oIE, "Passwd") Local $Email_button = _IEGetObjByName ($oIE, "account-email") Local $Signin_button = _IEGetObjByName ($oIE,"signIn") _IEFormElementSetValue ($username, "YourAccount2@gmail.com") ;<===== Here you put your 2nd Gmail Account Name _IEFormElementSetValue ($password, "Your Password") ;<===== Here you put your 2nd Gmail Account Password _IEAction ($Email_button, "click") _IEAction ($Signin_button, "click") EndFunc Func hotmail_login1() Sleep(60) Global $oIE =_IECreate ("http://www.live.com") local $username = _IEGetObjByName ($oIE, "login") Local $password = _IEGetObjByName ($oIE, "passwd") Local $Signin_button = _IEGetObjByName ($oIE,"SI") _IEFormElementSetValue ($username, "YourAccount1@hotmail.com") ;<===== Here you put your Hotmail Account Name _IEFormElementSetValue ($password, "Your Password") ;<===== Here you put your Hotmail Account Password _IEAction ($Signin_button, "click") EndFunc Func hotmail_login2() Sleep(60) Global $oIE =_IECreate ("http://www.live.com") local $username = _IEGetObjByName ($oIE, "login") Local $password = _IEGetObjByName ($oIE, "passwd") Local $Signin_button = _IEGetObjByName ($oIE,"SI") _IEFormElementSetValue ($username, "YourAccount2@hotmail.com") ;<===== Here you put your Hotmail Account Name _IEFormElementSetValue ($password, "Your Password") ;<===== Here you put your Hotmail Account Password _IEAction ($Signin_button, "click") EndFunc Func On_Close() Switch @GUI_WINHANDLE ; See which GUI sent the CLOSE message Case $AutoEmail Exit ; If it was this GUI - we exit <<<<<<<<<<<<<<< Case $AutoReplace_GUI GUIDelete($AutoReplace_GUI) ; If it was this GUI - we just delete the GUI <<<<<<<<<<<<<<< GUICtrlSetState($AutoReplace_Button, $GUI_ENABLE) EndSwitch EndFunc Func GUI_AutoReplace() $AutoReplace_GUI = GUICreate("Auto Add Email", 474, 324, 969, 306) $Input1 = GUICtrlCreateInput("", 24, 32, 329, 21) $Gmail1_Button = GUICtrlCreateButton("Add Gmail", 360, 30, 89, 25) $Label_AddGmail1 = GUICtrlCreateLabel("Type Your Gmail Account1", 24, 8, 131, 17) $Input2 = GUICtrlCreateInput("", 24, 106, 329, 21) $Gmail2_Button = GUICtrlCreateButton("Add Gmail", 360, 104, 89, 25) $Label_AddGmail2 = GUICtrlCreateLabel("Type Your Gmail Account2", 24, 82, 131, 17) $Input3 = GUICtrlCreateInput("", 24, 183, 329, 21) $Hotmail1_Button = GUICtrlCreateButton("Add Hotmail", 360, 181, 89, 25) $Label1 = GUICtrlCreateLabel("Type Your Hotmail Account1", 21, 159, 140, 17) $Input4 = GUICtrlCreateInput("", 24, 257, 329, 21) $Hotmail2_Button = GUICtrlCreateButton("Add Hotmail", 360, 255, 89, 25) $Label2 = GUICtrlCreateLabel("Type Your Homail Account2", 21, 233, 137, 17) GUISetOnEvent($GUI_EVENT_CLOSE, "On_Close") ; Call a common GUI close function GUICtrlSetOnEvent(-1, "On_Button") ; Call a common button function GUICtrlSetOnEvent(9, "On_Button") GUICtrlSetOnEvent(12, "On_Button") GUICtrlSetOnEvent(15, "On_Button") GUICtrlSetOnEvent(18, "On_Button") GUICtrlSetOnEvent(3, "On_Button") GUICtrlSetOnEvent(4, "On_Button") GUISetState() EndFunc Func AddEmail1() If GUICtrlRead($Input1) = "" Then On_Close() $DataFromUser = GUICtrlRead($Input1) _ReplaceStringInFile ($sFilename, $sFindg1, $DataFromUser) ;FileSaveDialog("Save File", @ScriptDir, "Au3 Files (*.au3)", 16) EndFunc Func AddEmail2() If GUICtrlRead($Input2) = "" Then On_Close() $DataFromUser = GUICtrlRead($Input2) _ReplaceStringInFile ($sFilename, $sFindg2, $DataFromUser) ;FileSaveDialog("Save File", @ScriptDir, "Au3 Files (*.au3)", 16) EndFunc Func AddEmail3() If GUICtrlRead($Input3) = "" Then On_Close() $DataFromUser = GUICtrlRead($Input3) _ReplaceStringInFile ($sFilename, $sFindh1, $DataFromUser) ;FileSaveDialog("Save File", @ScriptDir, "Au3 Files (*.au3)", 16) EndFunc Func AddEmail4() If GUICtrlRead($Input4) = "" Then On_Close() $DataFromUser = GUICtrlRead($Input4) _ReplaceStringInFile ($sFilename, $sFindh2, $DataFromUser) ;FileSaveDialog("Save File", @ScriptDir, "Au3 Files (*.au3)", 16) EndFunc
  7. Good Morning Yes, it's 12 AM here LOL.. so can't say good evening... anywho lol... it's late and I'm losing it haha sry... Love you guys, love the apps and all the support! I have somewhat lost my mind in the forums and trying to get my gui to update a label from an input box on the same gui without the gui flashing like crazy... Point is I want to take that user input and VISUALLY use it to update the text in the rest of the gui... Is this possible without this insane flicker / flashing every time the mouse moves? Am I attacking this the wrong way? I know people have used OnEvent Mode - but I need it where folks type... not just when the mouse moves or clicks... $GUI_EVENT_MOUSEMOVE or $GUI_EVENT_PRIMARYDOWN If I'm screwed I'm screwed... I'm just to tired to do this right, right now. "Yeah, to hell with it TARS. Just give it to me straight" - Interstellar Also - If I offended anyone, please let me know and I'll edit my forum text. I'm just tired. While 1 If GuiCtrlRead($I_IPAddress01) <> "IP ADDRESS" and GuiCtrlRead($I_ComputerName01) <> "COMPUTER NAME" Then GUICtrlSetData($L_IP01, GuiCtrlRead($I_IPAddress01)) GUICtrlSetData($L_Hostname01, GuiCtrlRead($I_ComputerName01)) EndIf $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $B_Ping01 Ping01() Case $B_EXIT01 Exit Case $B_NBTSTAT01 NBTSTAT01() EndSwitch WEnd
  8. Hey guys! I just started to work on a script to convert/encrypt strings in a simple GUI. First of all, here is my code: #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <String.au3> $Form1 = GUICreate("Form1", 615, 438, 574, 290) $Text = GUICtrlCreateEdit("", 8, 40, 601, 353) GUICtrlSetData(-1, "") $Convert = GUICtrlCreateButton("Convert", 8, 400, 297, 33) $Close = GUICtrlCreateButton("Close", 312, 400, 297, 33) $StringReverse = GUICtrlCreateRadio("String Reverse", 16, 8, 89, 17) $StringEncrypt = GUICtrlCreateRadio("String Encrypt", 128, 8, 89, 17) $Frame1 = GUICtrlCreateGroup("", 8, 0, 105, 33) GUICtrlCreateGroup("", -99, -99, 1, 1) $Password = GUICtrlCreateInput("", 216, 8, 385, 21) $Frame2 = GUICtrlCreateGroup("", 120, 0, 489, 33) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Close Exit Case $Convert If GUICtrlRead($StringReverse) = 1 Then $ReadText = GUICtrlRead($Text) $ReverseText = _StringReverse($ReadText) GUICtrlSetData($Text, $ReverseText) ElseIf GUICtrlRead($StringEncrypt) = 1 Then $ReadText = GUICtrlRead($Text) $ReadPassword = GUICtrlRead($Password) If $ReadPassword = Not 0 Then $TextEncrypt = _StringEncrypt(1, $ReadText, $ReadPassword) GUICtrlSetData($Text, $TextEncrypt) Else MsgBox(0,"Error","String encryption requires a password") EndIf Else MsgBox(0,"Error","No manipulation method specified") EndIf EndSwitch WEnd The problem with this is, if i want to convert for example somthing like this: "String1" "String2" "String3" GUICtrlRead will read it as "String1""String2""String3". I tried to mess around with StringSplit, but can't get it to work. Any indeas?
  9. Can someone tell me where I've gone wrong here - it keeps returning the same value - IT Infrastructure I want it to return the selection from the combo box. #include <ButtonConstants.au3> #include <ComboConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #region ### START Koda GUI section ### Form= Local $em, $Combo1 $Form1 = GUICreate("Form1", 424, 170, 192, 114) $Input1 = GUICtrlCreateInput("IP Address", 64, 48, 121, 21) $Combo1 = GUICtrlCreateCombo("Combo1", 216, 48, 185, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL)) GUICtrlSetData(-1, "|Name1|Name2|Name3l|Name4|Name5|Name6|IT Infrastructure", "IT Infrastructure") $Button1 = GUICtrlCreateButton("Button1", 288, 96, 81, 33) GUISetState(@SW_SHOW) #endregion ### END Koda GUI section ### $em = GUICtrlRead($Combo1) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop ;EndSelect Case $msg = $Button1 #Region --- CodeWizard generated code Start --- ;MsgBox features: Title=Yes, Text=Yes, Buttons=OK, Icon=None MsgBox(0,"Test", $em) #EndRegion --- CodeWizard generated code End --- EndSelect WEnd Exit
  10. Hello everyone! Hope you are having great days. I unfortunately am in need of assistance. I am in the process of creating a program that will allow me to search 2 systems that my company uses that store customer info. At this time if a customer places an order it could be in our online only system, our in-store system, or both at the same time. So instead of searching one manually, then the other, I decided to code a script that would look in both at the same time until it find the order. It has a few issues though. Issue #1 (Solved, Thank you BrewManNH!): I have two GUIs that I created, but apparently created wrong as the first one never closes until the script ends completely or if they press the red X, but is supposed to close when the user presses okay, but not end the script. This GUI is called in my code by a function called RefGui(). Issue #2 (Solved): This same GUI is supposed to return a reference id entered by the user in an input field and what type of reference number it is by selecting a radio button. However, when used like it was intended it only returns the data from the input field. If nothing is put in the input field then it will return both the data in the input field and which radio selection is made. I have other issues but will probably deal with them once I have those figured out. If someone could take a look at my code and give me some ideas I would appreciate it. #include "CSV.au3" #include "Array.au3" #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> #include <StaticConstants.au3> #include <ButtonConstants.au3> Opt("WinWaitDelay",100) Opt("WinDetectHiddenText",1) Opt("MouseCoordMode",0) Opt("SendCapslockMode",1) $objErr = ObjEvent("AutoIt.Error","MyErrFunc") ;Open Connection to OsCommerce database $oConn = ObjCreate("ADODB.Connection") $oConn.Open(;Connection string to my first database) ;Open Connection to Mas90 database $conn = ObjCreate("ADODB.Connection") $DSN = ;Connection string for my second database $conn.Open($DSN) ;Define var for reference type as global w/ initial value/Moved per BrewManNH's suggestion Global $refType="Internet" ;Loop until user closes first GUI w/ close button While 1 ;~ ;Define var for reference type as global w/ initial value ;~ Global $refType="Internet" ;Ask for order number or invoice number: (This opens first gui) $refNum=RefGui() ;Start text var to display message. $OrderMsg=$refNum & @CRLF & $refType ;If user selected internet search OsCommerce. Otherwise this won't be necessarily. If $refType="Internet" Then ;Query status and comments $rs = $oConn.Execute("SELECT orders.orders_status,orders_status_history.comments FROM orders,orders_status_history WHERE orders.orders_id='"& $refNum &"' AND orders_status_history.orders_status_id=orders.orders_status AND orders_status_history.orders_id=orders.orders_id") ;Make sure a result was returned then get results If IsObj($rs) And $rs.EOF=False Then $osStatus = $rs.GetRows() $rs = $oConn.Execute("SELECT orders_status_name FROM orders_status WHERE orders_status_id ='"& $osStatus[UBound($osStatus)-1][0] &"'") $temp=$rs.GetRows() $osStatus[UBound($osStatus)-1][0]=$temp[0][0] $OrderMsg+="OsCommerce:" & @CRLF $OrderMsg+=@TAB & "Status:" & $osStatus[UBound($osStatus)-1][0] & @CRLF $OrderMsg+=@TAB & "Comments:" & $osStatus[UBound($osStatus)-1][1] & @CRLF Else $osStatus = 0 EndIf EndIf ;If internet or sales were chosen then check if it has been put in Mas90 yet. If $refType="Internet" Or $refType="Sales" Then $rs = $conn.Execute("SELECT OrderType FROM SO_SalesOrderHeader WHERE (SalesOrderNo='"& $refNum &"')") If IsObj($rs) And $rs.EOF=False Then $SOStatus = $rs.GetRows() $OrderMsg+="Sales Order:" & @CRLF $OrderMsg+=@TAB & "Status:" & $SOStatus[0][0] & @CRLF $rs = $conn.Execute("SELECT ItemCode,ItemCodeDesc,QuantityOrdered,QuantityBackordered FROM SO_SalesOrderDetail WHERE (SalesOrderNo='"& $refNum &"' AND ItemType='1')") If IsObj($rs) And $rs.EOF=False Then $SOItems = $rs.GetRows() $OrderMsg+=@TAB & "Items:" & @CRLF $i=0 While $i<UBound($SOItems)-1 $OrderMsg+=@TAB & @TAB & "(" & $SOItems[$i][0] & ") " & $SOItems[$i][1] & @CRLF $rs = $conn.Execute("SELECT TotalQuantityOnHand FROM CI_Item WHERE (ItemCode='"& $SOItems[$i][0] &"')") If IsObj($rs) And $rs.EOF=False Then $item = $rs.GetRows() $OrderMsg+=@TAB & @TAB & "Ordered/Available: " & $SOItems[$i][2] & "/" & $item[0][0] & @TAB & "Backordered: " & $SOItems[$i][3] & @CRLF EndIf $i+=1 WEnd Else $SOItems = 0 EndIf Else $SOStatus = 0 EndIf $rs = $conn.Execute("SELECT InvoiceNo, SalesOrderNo FROM SO_InvoiceHeader WHERE (SalesOrderNo='"& $refNum &"')") If IsObj($rs) And $rs.EOF=False Then $InvStatus = $rs.GetRows() $rs = $conn.Execute("SELECT InvoiceNo,ItemCode,ItemCodeDesc,QuantityOrdered,QuantityBackordered FROM SO_InvoiceDetail WHERE (InvoiceNo='"& $InvStatus[0][0] &"' AND ItemType=1)") If IsObj($rs) And $rs.EOF=False Then $InvItems = $rs.GetRows() Else $InvItems = 0 EndIf Else $InvStatus = 0 EndIf $rs = $conn.Execute("SELECT InvoiceNo, SalesOrderNo FROM AR_InvoiceHistoryHeader WHERE (SalesOrderNo='"& $refNum &"')") If IsObj($rs) And $rs.EOF=False Then $InvHst = $rs.GetRows() $rs = $conn.Execute("SELECT InvoiceNo,ItemCode,ItemCodeDesc,QuantityOrdered,QuantityBackordered FROM AR_InvoiceHistoryDetail WHERE (InvoiceNo='"& $InvHst[0][0] &"' AND ItemType=1)") If IsObj($rs) And $rs.EOF=False Then $InvItems = $rs.GetRows() Else $InvItems = 0 EndIf Else $InvHst = 0 EndIf ElseIf $refType="Invoice" Then $rs = $conn.Execute("SELECT InvoiceNo, SalesOrderNo FROM AR_InvoiceHistoryHeader WHERE (InvoiceNo='"& $refNum &"')") If IsObj($rs) And $rs.EOF=False Then $InvHst = $rs.GetRows() $rs = $conn.Execute("SELECT InvoiceNo,ItemCode,ItemCodeDesc,QuantityOrdered,QuantityBackordered FROM AR_InvoiceHistoryDetail WHERE (InvoiceNo='"& $refNum &"' AND ItemType=1)") If IsObj($rs) And $rs.EOF=False Then $InvItems = $rs.GetRows() Else $InvItems = 0 EndIf Else $InvHst = 0 EndIf EndIf Gui($OrderMsg) WEnd ;This is the second GUI that displays the results Func Gui($txt) Local $myedit, $msg $hGUI=GUICreate("Details:", 500, 300, Default, Default,$WS_OVERLAPPEDWINDOW) ; will create a dialog box that when displayed is centered $GUISize=WinGetClientSize($hGUI) $myedit = GUICtrlCreateEdit($txt,-1, -1, $GUISize[0], $GUISize[1],$ES_READONLY) GUICtrlSetResizing ( $myedit, $GUI_DOCKBORDERS ) GUISetState() DllCall("user32.dll","int","HideCaret","int",0) Send("{END}") ; Run the GUI until the dialog is closed While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd GUIDelete($hGUI) EndFunc ;This is the first GUI. It asks for the information required to look up the order Func RefGui() $RefGui = GUICreate("Reference#", 261, 156, -1, -1) GUISetFont(10, 400, 0, "Verdana") GUICtrlCreateLabel("Enter Reference:", 15, 12, 116, 20) $RefNum = GUICtrlCreateInput("REFERENCE #", 136, 8, 110, 24, BitOR($GUI_SS_DEFAULT_INPUT,$ES_UPPERCASE)) $OK = GUICtrlCreateButton("OK", 176, 120, 75, 25, BitOR($BS_DEFPUSHBUTTON,$BS_NOTIFY)) GUICtrlCreateGroup("Select Ref Type:", 16, 40, 145, 105, BitOR($GUI_SS_DEFAULT_GROUP,$WS_CLIPSIBLINGS)) $Internet = GUICtrlCreateRadio("Internet Order", 24, 64, 113, 17) GUICtrlSetState(-1, $GUI_CHECKED) $Sales = GUICtrlCreateRadio("Sales Order", 24, 88, 113, 17) $Invoice = GUICtrlCreateRadio("Invoice", 24, 112, 113, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() If $nMsg = $GUI_EVENT_CLOSE Then Exit If $nMsg = $OK Then ExitLoop EndIf WEnd If GUICtrlRead($Internet) = 1 Then $refType="Internet" ElseIf GUICtrlRead($Sales) = 1 Then $refType="Sales" ElseIf GUICtrlRead($Invoice) = 1 Then $refType="Invoice" EndIf $temp=GUICtrlRead($RefNum) GUIDelete($RefGui) Return $temp EndFunc Func MyErrFunc() $hexnum=hex($objErr.number,8) Msgbox(0,"","We intercepted a COM Error!!" & @CRLF & @CRLF & _ "err.description is: " & $objErr.description & @CRLF & _ "err.windescription is: " & $objErr.windescription & @CRLF & _ "err.lastdllerror is: " & $objErr.lastdllerror & @CRLF & _ "err.scriptline is: " & $objErr.scriptline & @CRLF & _ "err.number is: " & $hexnum & @CRLF & _ "err.source is: " & $objErr.source & @CRLF & _ "err.helpfile is: " & $objErr.helpfile & @CRLF & _ "err.helpcontext is: " & $objErr.helpcontext _ ) exit EndFunc Here is just the code for the first GUI so you don't have to look through all that: Func RefGui() $RefGui = GUICreate("Reference#", 261, 156, -1, -1) GUISetFont(10, 400, 0, "Verdana") GUICtrlCreateLabel("Enter Reference:", 15, 12, 116, 20) $RefNum = GUICtrlCreateInput("REFERENCE #", 136, 8, 110, 24, BitOR($GUI_SS_DEFAULT_INPUT,$ES_UPPERCASE)) $OK = GUICtrlCreateButton("OK", 176, 120, 75, 25, BitOR($BS_DEFPUSHBUTTON,$BS_NOTIFY)) GUICtrlCreateGroup("Select Ref Type:", 16, 40, 145, 105, BitOR($GUI_SS_DEFAULT_GROUP,$WS_CLIPSIBLINGS)) $Internet = GUICtrlCreateRadio("Internet Order", 24, 64, 113, 17) GUICtrlSetState(-1, $GUI_CHECKED) $Sales = GUICtrlCreateRadio("Sales Order", 24, 88, 113, 17) $Invoice = GUICtrlCreateRadio("Invoice", 24, 112, 113, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() If $nMsg = $GUI_EVENT_CLOSE Then Exit If $nMsg = $OK Then ExitLoop EndIf WEnd If GUICtrlRead($Internet) = 1 Then $refType="Internet" ElseIf GUICtrlRead($Sales) = 1 Then $refType="Sales" ElseIf GUICtrlRead($Invoice) = 1 Then $refType="Invoice" EndIf $temp=GUICtrlRead($RefNum) GUIDelete($RefGui) Return $temp EndFunc
  11. Hello, i'm making this tool to convert "English" letters To "Arabic" letters but i have some problems in reading "input1" Notice: it isn't translator!! here's the script: #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <GuiEdit.au3> $Form1 = GUICreate("Form1", 257, 155, 339, 282) $Input1 = GUICtrlCreateInput("", 32, 32, 201, 21) $Input2 = GUICtrlCreateInput("", 32, 88, 201, 21, BitOR($GUI_SS_DEFAULT_INPUT, $ES_RIGHT)) $Label1 = GUICtrlCreateLabel("English", 104, 8, 38, 17) $Button1 = GUICtrlCreateButton("Ta7weel", 96, 120, 75, 25) $Label2 = GUICtrlCreateLabel("Franco", 104, 64, 37, 17) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 Local $Read1 = GUICtrlRead($Input1) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; If StringInStr($Read1, "3") Then _GUICtrlEdit_AppendText($Input2, "ع") EndIf If StringInStr($Read1, "3'") Then _GUICtrlEdit_AppendText($Input2, "غ") EndIf If StringInStr($Read1, "5") Then _GUICtrlEdit_AppendText($Input2, "خ") EndIf If StringInStr($Read1, "7") Then _GUICtrlEdit_AppendText($Input2, "ح") EndIf If StringInStr($Read1, "9") Then _GUICtrlEdit_AppendText($Input2, "ص") EndIf If StringInStr($Read1, "a") Then _GUICtrlEdit_AppendText($Input2, "ا") EndIf If StringInStr($Read1, "b") Then _GUICtrlEdit_AppendText($Input2, "ب") EndIf If StringInStr($Read1, "c") Then _GUICtrlEdit_AppendText($Input2, "س") EndIf If StringInStr($Read1, "d") Then _GUICtrlEdit_AppendText($Input2, "د") EndIf If StringInStr($Read1, "e") Then _GUICtrlEdit_AppendText($Input2, "ي") EndIf If StringInStr($Read1, "f") Then _GUICtrlEdit_AppendText($Input2, "ف") EndIf If StringInStr($Read1, "g") Then _GUICtrlEdit_AppendText($Input2, "ج") EndIf If StringInStr($Read1, "h") Then _GUICtrlEdit_AppendText($Input2, "ه") EndIf If StringInStr($Read1, "i") Then _GUICtrlEdit_AppendText($Input2, "ي") EndIf If StringInStr($Read1, "j") Then _GUICtrlEdit_AppendText($Input2, "ج") EndIf If StringInStr($Read1, "k") Then _GUICtrlEdit_AppendText($Input2, "ك") EndIf If StringInStr($Read1, "l") Then _GUICtrlEdit_AppendText($Input2, "ل") EndIf If StringInStr($Read1, "m") Then _GUICtrlEdit_AppendText($Input2, "م") EndIf If StringInStr($Read1, "n") Then _GUICtrlEdit_AppendText($Input2, "ن") EndIf If StringInStr($Read1, "o") Then _GUICtrlEdit_AppendText($Input2, "و") EndIf If StringInStr($Read1, "p") Then _GUICtrlEdit_AppendText($Input2, "ب") EndIf If StringInStr($Read1, "q") Then _GUICtrlEdit_AppendText($Input2, "ق") EndIf If StringInStr($Read1, "r") Then _GUICtrlEdit_AppendText($Input2, "ر") EndIf If StringInStr($Read1, "s") Then _GUICtrlEdit_AppendText($Input2, "س") EndIf If StringInStr($Read1, "t") Then _GUICtrlEdit_AppendText($Input2, "ت") EndIf If StringInStr($Read1, "u") Then _GUICtrlEdit_AppendText($Input2, "و") EndIf If StringInStr($Read1, "v") Then _GUICtrlEdit_AppendText($Input2, "ف") EndIf If StringInStr($Read1, "w") Then _GUICtrlEdit_AppendText($Input2, "و") EndIf If StringInStr($Read1, "x") Then _GUICtrlEdit_AppendText($Input2, "ق") EndIf If StringInStr($Read1, "y") Then _GUICtrlEdit_AppendText($Input2, "ي") EndIf If StringInStr($Read1, "z") Then _GUICtrlEdit_AppendText($Input2, "ز") EndIf ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; EndSwitch WEnd the script working well. but the problem is arranging the output letters e.g. i want convert this word "fas"... it must be "فاس" but it converted to "افس". problem reason: autoit has read "A" letter before "F" & "S" so output will be arranged as reading. what i need: convert and arragne "Arabic" letters wherever it is as "English" letters. !! e.g. A= 1 B= 2 C= 3 D=4 Text what will be converted: "CBDA" so it must be convert like that "3241" but in the script above it converting like that "123". sorry for bad english and thanks for help Resolved: Edit: resolved
  12. Trying to put in a GUI(textbox) and want it to get the information only if the input is numbers --------------- Case $Start_button $var[2] = GUICtrlRead($TimeoutInput) If $TimeoutInput = ???? --------------- Anyone? =)
  13. Here's a quick thing that i just can't make work correctly. Put a screen up to capture a user's input. Force that input to lowercase and put it in a variable to replace at a certain place in a third file. My problem is that i cannot get the user's input to tell me anything other than "3." i HAVE to be doing something wrong but darned if i can spot it. #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> Opt("GUIOnEventMode", 1) #Region ### START Koda GUI section ### Form=f:\vuwin60\form1.kxf Local $Form1, $txtInput, $btnOK, $btnCancel, $Label1 $Form1 = GUICreate("Enter User ID", 335, 90, -1, -1) ;343, 140);, $WS_SYSMENU) GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close") $txtInput = GUICtrlCreateInput("", 256, 16, 65, 21) ;GUICtrlSetOnEvent(-1, "txtInputChange") $Label1 = GUICtrlCreateLabel("Please input your IWIMS User ID:", 8, 16, 232, 20) GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif") ;GUICtrlSetOnEvent(-1, "Label1Click") $btnOK = GUICtrlCreateButton("&Ok", 32, 48, 100, 30, $BS_NOTIFY) ;GUICtrlSetResizing(-1, $GUI_DOCKHCENTER+$GUI_DOCKVCENTER+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT) GUICtrlSetOnEvent(-1, "btnOKClick") $btnCancel = GUICtrlCreateButton("&Cancel", 200, 48, 100, 30, $BS_NOTIFY) ;GUICtrlSetResizing(-1, $GUI_DOCKHCENTER+$GUI_DOCKVCENTER+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT) GUICtrlSetOnEvent(-1, "btnCancelClick") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 Sleep(100) WEnd Func btnCancelClick() Exit EndFunc Func btnOKClick() GUICtrlRead($txtInput) ConsoleWrite($txtInput & @crlf & StringLen($txtInput) & @CRLF) Exit EndFunc Func Form1Close() Exit EndFunc Can someone please straighten me out here? i expect the lowercase of whatever the user types in, not just "3." Thanks, Dave
×
×
  • Create New...