Jump to content
Sign in to follow this  


Recommended Posts


Hi friends, I need help with the process, I have a button to initiate a code but do not know how to configure it to be the button to start the process, thank you very much for your help.

Here I leave the code to see if I have to change some part.

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <ProgressConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=c:\users\juan.caballeron\desktop\ \programacion\autoit\capturas\koda_1.7.3.0\forms\grabar capturas.kxf
$Form1_1 = GUICreate("WhiteSnake", 655, 487, 192, 124)
GUISetIcon("C:\Users\juan.caballeron\Desktop\ \Programacion\Autoit\Capturas\koda_1.7.3.0\iconos\Avatar on ice-256.ico", -1)
$hechos = GUICtrlCreateGroup("Hechos", 16, 32, 385, 169)
GUICtrlSetColor(-1, 0x000000)
$box_fechah = GUICtrlCreateInput("", 112, 72, 81, 21)
GUICtrlSetLimit(-1, 10)
$box_hora = GUICtrlCreateInput("", 112, 104, 81, 21)
GUICtrlSetLimit(-1, 5)
$box_fechaf = GUICtrlCreateInput("", 112, 136, 81, 21)
GUICtrlSetLimit(-1, 10)
$box_fte = GUICtrlCreateInput("", 112, 168, 81, 21)
GUICtrlSetLimit(-1, 5)
$Label3 = GUICtrlCreateLabel("Fecha Hecho:", 24, 72, 72, 17)
$Label4 = GUICtrlCreateLabel("Hora:", 24, 104, 30, 17)
$Label5 = GUICtrlCreateLabel("Fecha Fuente:", 24, 136, 73, 17)
$Label6 = GUICtrlCreateLabel("Nro. Fuente:", 24, 168, 63, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$personas = GUICtrlCreateGroup("Datos de la Persona", 16, 224, 585, 185)
$Label1 = GUICtrlCreateLabel("Tipo Identificación:", 32, 256, 94, 17)
$Label2 = GUICtrlCreateLabel("No. Documento:", 32, 280, 82, 17)
$Label7 = GUICtrlCreateLabel("Apellidos", 32, 304, 46, 17)
$Label8 = GUICtrlCreateLabel("Nombres", 32, 328, 46, 17)
$Label9 = GUICtrlCreateLabel("Sexo", 32, 352, 28, 17)
$Label10 = GUICtrlCreateLabel("Fecha Nacimiento", 32, 376, 90, 17)
$Combo1 = GUICtrlCreateCombo("Selección", 128, 256, 193, 21)
$Combo1 = GUICtrlSetData(-1, "Tarjeta de Identidad|Cédula")
GUICtrlSetLimit(-1, 1)
$documento = GUICtrlCreateInput("", 128, 280, 193, 21)
$apellidos = GUICtrlCreateInput("", 128, 304, 377, 21)
$nombres = GUICtrlCreateInput("", 128, 328, 377, 21)
$Combo2 = GUICtrlCreateCombo("Selección", 128, 352, 121, 21)
$Combo2 = GUICtrlSetData(-1, "Masculino|Femenino")
GUICtrlSetLimit(-1, 1)
$fecha_naci = GUICtrlCreateInput("", 128, 376, 121, 21)
GUICtrlSetLimit(-1, 10)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$datoscap = GUICtrlCreateGroup("Datos Capturas", 456, 32, 145, 169)
$Label11 = GUICtrlCreateLabel("Label11", 472, 56, 42, 17)
$Label12 = GUICtrlCreateLabel("Label12", 472, 80, 42, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Titulo = GUICtrlCreateLabel("PROCESO PARA GRABAR CAPTURAS EN EL SIEDCO.", 175, 8, 277, 17, $SS_CENTER)
GUICtrlSetCursor (-1, 3)
$Progress1 = GUICtrlCreateProgress(448, 432, 169, 9)
GUICtrlSetCursor (-1, 15)
$creador = GUICtrlCreateLabel("By WhiteSnake", 8, 440, 78, 17)
GUICtrlSetColor(-1, 0xFF0000)
$Icon1 = GUICtrlCreateIcon("C:\Users\juan.caballeron\Desktop\ \Programacion\Autoit\Capturas\koda_1.7.3.0\iconos\1249549841170809086.ico", -1, 88, 432, 32, 32)
$iniciar = GUICtrlCreateButton("INICIAR PROCESO", 296, 424, 145, 25)
GUICtrlSetCursor (-1, 0)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE



I just need to know how to do that when you click the $iniciar start any process.

Edited by Jos
Put script in Codebox. Please use that the next time you post code.

Share this post

Link to post
Share on other sites
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
        Case  $iniciar
            ;  Put what ever you want to do after pushing the button here


  • Like 1

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post

Link to post
Share on other sites

Thank you very much.

Share this post

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Similar Content

    • nooneclose
      By nooneclose
      Hello again, I am in phase two of my help bot. I cannot figure out how to properly code Autoit to click on a webpage button using the I.E UDF. I want to click on the button that I have attached as an image. This button does not have a name but it has an ID. Here is the HTML code for this button that I found using chromes developer inspector.
      HTML Code: 
      <img role="button" tabindex="-1" id="toolactions_INSERT-tbb_image" src="nav_icon_insertkey.gif" alt="New Work Order CTRL+ALT+I" draggable="false"> Here is the code that I have so far:
      ;******************************************************************************* ; Opens IE and fill out a New Workorder ;******************************************************************************* ; Start IE at the ** Tracking Application in ****** $oIE = _IECreate("https:I_am_Bound_by_my_company_to_not_reveal_this_webpage") ; Wait for a browser page load to complete _IELoadWait($oIE) Sleep(6000) ; Store the field names where the important data will be sent Local $nWorkOrderB = _IEGetObjById($oIE, "toolactions_INSERT-tbb_image") _IEAction($nWorkOrderB, "click")  I want my program to click on the button that looks like a piece of paper with a blue # 
      (For those wondering, I am allowed to send images just not the URL.) 
      As always any help would be appreciated. 

    • MJ36
      By MJ36

      How to click this button ? 
      I Try 
      func test () $oCorrectObj = "" $tags = $oIE.document.GetElementsByTagName("button") For $tag in $tags $class_value = $tag.GetAttribute("type") If string($class_value) = "buttont" Then $oCorrectObj = $tag MsgBox(0, "Level: ", "Level found :)") Else MsgBox(16, "Failed", "Not found.") ExitLoop EndIf Next If IsObj ( $oCorrectObj ) Then _IEAction ($oCorrectObj, "click") EndIF  
      func klik () Local $oFound = "" Local $oBtns = _IETagNameGetCollection($oIE, "span") For $oBtn In $oBtns If String($oBtn.classname) = "yt-uix-button-content" Then $oFound = $oBtn EndIf Next _IEAction ($oFound, "click") EndFunc  
      Please Help 
      Can you click it by name?
    • faustf
      By faustf
      i guys , like title anyone  have idea if is possible , and if yes if  have example to post ?  i find in forum and in google but  i dont know   how can start  to create  button with icon over toolbar near  clock or is  goog before language layout .
      sorry i not post any script but i dont know  where to start
      at  all
    • caramen
      By caramen
      Hmmm i am sorry  i had simular problem but i cant find back post. 
      How to hide a gui button ? 
      I Want to dodge the variable non déclaréd when i make button in
      if statment 
      thx before 
    • Pike
      By Pike
      Hello Everyone,
      New Guy here. This is a two-part question, hopefully easy enough though. I know it's ugly coding, this is because I have only a couple hours worth of coding experience and could really use some help.
      1) When I single click the button I want one action (like playing a sound clip) and when I double click the button I want a different action (such as opening dialogue box to ask for soundclip directory address). At the bottom of the script I made a comment which one I would like single click versus double click.
      2) I can not get the FileOpenDialogue to save the file address to the config.ini file at the 'One' position on the .ini.
      #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <MsgBoxConstants.au3> #include <FileConstants.au3> #include <AutoItConstants.au3> #include <Sound.au3> Opt('MustDeclareVars', 1) Opt("GUIOnEventMode", 1) Global $OneID _Main() Func _Main() GUICreate("Form1", 156, 86, 281, 276) $OneID = GUICtrlCreateButton("Button", 15, 17, 122, 37) GUICtrlSetOnEvent($OneID, "OnOne") GUISetOnEvent($GUI_EVENT_CLOSE, "OnExit") GUISetState() While 1 While 1 Sleep(1000) WEnd WEnd EndFunc ;---------------Functions------------- While 1 Sleep(100) WEnd Func OnOne() ; ******************Single Click for this action**************** $OneID = IniRead("config.ini", "Config", "One", $OneID) If $OneID = True Then SoundPlay($OneID, @HotKeyPressed) Else ; *******Double Click for this action*****And Help Saving File Address to config.ini 'One'*********** $OneID = FileOpenDialog("Select file", @WorkingDir, "All (*.*)") IniWrite("config.ini", "Config", "One", $OneID) $OneID = InputBox("Enter Information", "Short Name for File?", "") IniWrite("config.ini", "Config", "NameOne", $OneID) EndIf EndFunc Any help would be greatly appreciated, and if you need anymore clarity as to what exactly I'm trying to do, please do not hesitate to ask. Thanks so much!