Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/29/2012 in all areas

  1. Crazyace, I am sorry I didn't fully explore your code last time, and just went directly to answering your questions. I have modified your code a bit so that it will perform more to your needs. I noticed from your original post you had a large sleep function at the bottom to keep your GUI open. When a button is pressed during sleep mode, it will not perform your needs. You need to create a loop after your gui creation to watch for user input and activity. Hope this helps a bit. #include <GUIConstants.au3> GUICreate("Drivers/Manuals/Warranty", 280, 110) $Driver = GUICtrlCreateCheckbox("Drivers", 10, 10) GUICtrlSetState(-1, $GUI_CHECKED) $Manual = GUICtrlCreateCheckbox("Manual", 80, 10) $Warranty = GUICtrlCreateCheckbox("Warranty", 150, 10) GUICtrlCreateLabel("Service Tag #:", 10, 45) $Input = GUICtrlCreateInput("", 90, 40) $Submit = GUICtrlCreateButton("Submit", 40, 70, 50) $Exit = GUICtrlCreateButton("Cancel", 150, 70, 50) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Submit $serv_tag = GUICtrlRead($Input) If GUICtrlGetState($Driver) = $GUI_CHECKED Then _Fire($serv_tag) Case $msg = $Exit ExitLoop EndSelect WEnd Exit 0 Func _Fire($sServiceTag) ;IE functin that will handle $sServiceTag that is the passed input read from control $Input EndFunc Realm Edit: If you are using Scite, this only works for the AutoIt version that was included with the standard Install, to create your scripts, you may also type 'setupgui' then press space and it will create a basic template shell of a gui window code for you, including the while loop.
    1 point
  2. Hello Crazyace, #1) Use GUICtrlSetState() to set the state of controls. ;This will set the checkbox control to checked GUICtrlSetState( $Driver, $GUI_CHECKED ) ;just as this example will set it's state as unchecked. GUICtrlSetState( $Driver, $GUI_UNCHECKED ) Embedded with your code, you will get this: $Driver = GUICtrlCreateCheckbox("Drivers", 10, 10) GUICtrlSetState( -1, $GUI_CHECKED ) $Manual = GUICtrlCreateCheckbox("Manual", 80, 10) $Warranty = GUICtrlCreateCheckbox("Warranty", 150, 10) GUICtrlCreateLabel("Service Tag #:", 10, 45) $Input = GUICtrlCreateInput("", 90, 40) GUICtrlCreateButton("Submit", 40, 70, 50) GUICtrlCreateButton("Cancel", 150, 70, 50) #2) You will want to use GUICtrlGetState() to retrieve the state of a control GUICtrlGetState($Driver) to perform a _Function() when this is checked you would: If GUICtrlGetState($Driver) = $GUI_CHECKED Then _Function() Sorry to verify, but you are right that your AHK com code will not work properly with AutoIt. However, and on a brighter side, if you read up on IE.au3 UDF in your help file, I am certain you will find it moderately easy to convert your AHK code to better interact with AutoIt. Some functions that may help are: _IECreate() ;To create com object with Internet Explorer _IENavigate() ;Navigates _IELoadWait() ;Sleep function while the page loads Good Luck & Happy Coding! Realm
    1 point
  3. BinaryBrother

    Portable RDP

    I've yet to find a good Windows based (up to date) portable version of RDP... So, I pulled all the necessary files from an XP Install and made a little portable client... Possible Applications: PE Windows (BartPE) TinyXP (Does not come installed, and gives issues when attempting to install) Windows 2000 Linux (Wine) issues... Any other Windows based machine without RDP installed... Source: ; Start-up CreateTempDIRs() OnAutoItExitRegister("CleanTMP") ; ; File Unpacking FileInstall("***RDP Thinclientmstscax.dll", @TempDir & "RDP", 1) FileInstall("***RDP Thinclientmstsc.exe", @TempDir & "RDP", 1) FileInstall("***RDP Thinclienten-usmstsc.exe.mui", @TempDir & "RDPen-us", 1) FileInstall("***RDP Thinclienten-usmstscax.dll.mui", @TempDir & "RDPen-us", 1) ; ;User Config ################################################### $Auto = True ;// If True defined input below is used, else it just opens mstsc (RDP) $Server = "" ;// IP or hostname $Port = "" ;// Leave Blank for Default $FullScreen = True ;// Pretty obvious ; ############################################################## ; I'm messing with a little method now for generating RDP connection files on the fly and using them... ; It's a little messy, but allows you to utilize many more parameters such as username and password... ;Primary Code Base If $Auto = True Then If $Port <> "" Then $Switch = $Server & ":" & $Port Else $Switch = $Server EndIf If $FullScreen = True Then $Switch &= " /f" EndIf ShellExecuteWait(@TempDir & "RDPmstsc.exe", "/v:" & $Switch) Else ShellExecuteWait(@TempDir & "RDPmstsc.exe") EndIf ; ; Functions Func CreateTempDIRs() While Not FileExists(@TempDir & "RDP") DirCreate(@TempDir & "RDP") WEnd While Not FileExists(@TempDir & "RDPen-us") DirCreate(@TempDir & "RDPen-us") WEnd EndFunc ;==>CreateTempDIRs Func CleanTMP() DirRemove(@TempDir & "RDP", 1) EndFunc Required Files: (Found in most WinXP installs) [*system32, *system32en-us] mstsc.exe mstscax.dll mstsc.exe.mui mstscax.dll.mui [Download Zip] Binary: http://goo.gl/J6ujX P.S.: If your having trouble finding the required files in Windows installs, PM me.
    1 point
  4. jasc2v8

    RunCMD UDF

    My attempt to pull together several posts on this topic (credits noted in the UDF). _WinPath ends my frustration tring to get the quotes right for a Windows path with spaces. I hope this is helpful to others. Run a DOS or external program from the command line _RunCMD _RunWaitCMD Run with stdin+stdout+stderr output to a DOS window _RunCMD_Window _RunWaitCMD_Window Run with stdin+stdout+stderr output to a GUI window Copy button to copy text to clipboard _RunCMD_GUI Add quotes around a Windows path if it has spaces _WinPath Attached is the UDF and a few examples. RunCMD.au3 RunCMD_Examples.au3
    1 point
  5. water

    quick if then question

    You can't connect two statements in AutoIt like you would do it in a DOS batch file. Use something like this: if (Not ProcessExists("program1.exe")) Then Run("program1.exe") Soundplay("program_running.wav",0) EndIf
    1 point
  6. You get better response when you post your (even unfinished/bugged) AU3 version - your try. Just asking "translate it for me" is bad idea.
    1 point
  7. guinness

    reshacker.exe ?

    Here >> https://en.wikipedia.org/wiki/Resource_Hacker
    1 point
  8. armoros, No need to be - just look a bit harder next time. M23
    1 point
  9. Thread locked because of the stupidity of the OP in asking their question in a manner that immediately raised everyone's suspicions as to their intentions. And also because the answer is so obvious that the question did not need to be asked in the first place. M23
    1 point
×
×
  • Create New...