Raq

Got empty value using GUICtrlComboBoxEx_GetItemText

1 post in this topic

Hello!

 I would like to ask for your help, regarding getting the value of the combo box in a desktop application.

I tried the codes below, but I got an empty value. I am really asking for your help if how can I display the value of the combox.

Func CheckStockCode()
    $stockWin = Call(OpenClass_32770)
    Sleep(4000)
    Local $sText
    _GUICtrlComboBoxEx_GetItemText(4029, 1, $sText)
    MsgBox(1, "OUTPUT", $sText)
EndFunc   ;==>CheckStockCode

 Thanks in advance,

Raq

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

  • Similar Content

    • Hoth2001
      By Hoth2001
      I installed AutoIt to my computer 3 days ago...and have invested the last 3 days learning how to use it.
      As learned in the tutorials, whenever opening I new file in Scite editor I'd immediatley save the file
      I left the Scite Editor open for the past 3 consecutive days on my laptop
       
      No problem
       
      Today I closed Autoit for the first time, restarted my computer, and opened up the Scite Editor
      Now whenever I try to save a file I am prevented from doing so because I apparently don't have permission!?  
      And whenever I try to run any of the programs I've created over the past 3 days now I keep getting annoying popup notifications before I run them
       
      Problem
       
      To go around the issue, I copied a program originally saved in the AUtoIt folder to another folder (since I was barred from saving it in it's original AutoIt location)
      NOw when I run the code the mouse coordiantes are all off
      and I still get that pesky notification whenever I try to run a program
       
      Big Problem!!!
      Anyone have any clue why I'm going through this BS?
       
      1. I checked my User settings and YES I am the administrator on this cpu
      2. I tried to de-select the "read only" attribute for the AutoIt folder (everytime after doing this successfully the folder immediately and automatically reverts back to "read only")
       
      Any help would be MOST appreciated. I've attached screen shots of the annoying bus I keep getting
       
       


    • FrancescoDiMuro
      By FrancescoDiMuro
      Good morning
      I'm working on a little project, and I was wondering if there's a way ( sure there is ) to insert data to a ComboBox control everytime the user insert some text in the ComboBox which is not in the ComboBox data. I'll try to explain with an example:
      - Form with some data ( ComboBox is empty );
      - User prompt something in the ComboBox: if what the user prompts is not in the ComboBox values ( at the moment empty ), then insert the value in the ComboBox values, in order to have, next time the user prompts the form, the value that he entered.
      More pratical example:
      - First call of the form, ComboBox empty;
      - I prompt "A" in the ComboBox;
      - Second call, in the ComboBox I should see "A";
      - I prompt "B" in the ComboBox;
      - Third call, I should see "A"
                                                 "B";
      - And so on...
      Everytime the form is called, I re-create it, so I think I can't use _GUICtrlComboBox_AddStrings().
      I tried with
      Global $strCboStrings = "" ; When the user prompt the form, the code below is executed. ; I.E. : User prompt "A", after the if I should have "A"; ; In the second call, If I write "B", I should see "A" ; "B"; ; If I write "A" again, in the combobox values should not be any changes. If Not StringInStr($strCboStrings, GUICtrlRead($cboVoiceCategory)) <> 0 Then $strCboStrings &= $strCboStrings & "|" & GUICtrlRead($cboVoiceCategory) EndIf Any suggestion?
      Thanks
    • kstriyhon
      By kstriyhon
      hello Comunity i am new to autoit and i bump into a pitfall regarding the creation of objects in a dinamyc way but more especific  creating combobox at runtime
      i need many comboboxes and sofar i createdthem manually 
      like this 
      $idCombo_1 = GUICtrlCreateCombo("", 500, 40, 130, 21)     $idCombo_2 = GUICtrlCreateCombo("", 500, 70, 130, 21)     $idCombo_3 = GUICtrlCreateCombo("", 500, 100, 130, 21)     $idCombo_4 = GUICtrlCreateCombo("", 500, 130, 130, 21)     $idCombo_5 = GUICtrlCreateCombo("", 500, 160, 130, 21)     $idCombo_6 = GUICtrlCreateCombo("", 500, 190, 130, 21)     $idCombo_7 = GUICtrlCreateCombo("", 500, 220, 130, 21)     $idCombo_8 = GUICtrlCreateCombo("", 500, 250, 130, 21)     $idCombo_9 = GUICtrlCreateCombo("", 500, 280, 130, 21)     GUICtrlSetData($idCombo_1, "Item1|Item2|Item3|Item4|Item5")     GUICtrlSetData($idCombo_2, "Item1|Item2|Item3|Item4|Item5")     GUICtrlSetData($idCombo_3, "Item1|Item2|Item3|Item4|Item5")     GUICtrlSetData($idCombo_4, "Item1|Item2|Item3|Item4|Item5")     GUICtrlSetData($idCombo_5, "Item1|Item2|Item3|Item4|Item5")     GUICtrlSetData($idCombo_6, "Item1|Item2|Item3|Item4|Item5")     GUICtrlSetData($idCombo_7, "Item1|Item2|Item3|Item4|Item5")     GUICtrlSetData($idCombo_8, "Item1|Item2|Item3|Item4|Item5")     GUICtrlSetData($idCombo_9, "Item1|Item2|Item3|Item4|Item5") now i need this example but create them at runtime as there are more than 9 combos what i need thanks in advance kind regards
    • algiuxas
      By algiuxas
      Hello everybody!
      I get these weird errors in SciTE console:
      [0801/210405:ERROR:tcp_socket_win.cc(335)] bind() returned an error: Only one usage of each socket address (protocol/network address/port) is normally permitted. (0x2740) [0801/210405:ERROR:devtools_http_handler.cc(229)] Cannot start http server for devtools. Stop devtools. [0801/210405:ERROR:browser_gpu_channel_host_factory.cc(119)] Failed to launch GPU process. [0801/210405:ERROR:browser_gpu_channel_host_factory.cc(119)] Failed to launch GPU process. My script:
      #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <Misc.au3> #NoTrayIcon $title = "Hello" $txt = "..." ; TODO: Make 4 of them ;~ #Region ### START Koda GUI section ### Form= ;~ $1_GUI = GUICreate($title, 370, 120, -1, -1) ;~ GUISetBkColor(0xFFFFFF) ;~ $1_B1 = GUICtrlCreateButton("B1", 136, 80, 107, 25) ;~ GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") ;~ $1_B2 = GUICtrlCreateButton("B2", 248, 80, 107, 25) ;~ GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") ;~ GUICtrlCreateLabel($txt, 16, 24, 338, 52) ;~ GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif") ;~ GUICtrlSetColor(-1, 0x000000) ;~ GUISetState(@SW_SHOW) ;~ #EndRegion ### END Koda GUI section ### #Region ### START Koda GUI section ### Form= $2_GUI = GUICreate($title, 370, 0?"Hi :)":120, -1, -1) GUISetBkColor(0xFFFFFF) $2_B1 = GUICtrlCreateButton("B1", 136, 80, 107, 25) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") $2_B2 = GUICtrlCreateButton(0?":D":"B2", 248, 80, 107, 25) GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif") GUICtrlCreateLabel($txt, 16, 24, 338, 52) GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0x000000) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### $u32dll = DllOpen("user32.dll") ;~ Opt("GUIOnEventMode", 1) ;~ GUICtrlSetOnEvent(-3, "_Exit") ; TODO: Fix, doesn't work with 2 GUI at the same time ;~ GUICtrlSetOnEvent($B11, "_Exit") ;~ GUICtrlSetOnEvent($B21, "_Exit") ;~ GUICtrlSetOnEvent($B12, "_Exit") ;~ GUICtrlSetOnEvent($B22, "_Exit") ;~ $pos1 = WinGetPos($GUI1) ;~ $pos2 = WinGetPos($GUI1) While 1 ;~ $pos1 = WinGetPos($GUI1) ;~ $pos2 = WinGetPos($GUI1) ;~ $x = $pos1[0] - 370 ;~ $y = $pos1[1] ;~ WinMove($GUI2, "", $x, $y, $pos1[2], $pos1[3], 1) ; Press middle mouse button to close (it's gonna be a non malicious prank for my friend) If _IsPressed(4, $u32dll) Then Exit $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE _Exit() ;~ Case $1_B1 ;~ _Exit() ;~ Case $1_B2 ;~ _Exit() Case $2_B1 _Exit() Case $2_B2 _Exit() EndSwitch WEnd Func _Exit() ; TODO: ... ;~ GUIDelete($1_GUI) GUIDelete($2_GUI) Exit EndFunc ;==>_Exit How to get rid of these errors?
    • Nareshm
      By Nareshm
      I create message box but i dont know how to add button action when i click it.

      Help for : Add script for Button : Left, Right, Right Finger
      example when i press Left finger button do Case $idNotepad
                      $iPID = WinActivate ( " :PS :: Version - 2.8.0.0  - [eFS Bill]")
                              ControlSend(" :DS  - eF :: Version - 2.8.0.0  - [eF Bill]", "", "[NAME:btnReset]", "{esc}")
                              ControlClick ( " :DS  - eF :: Version - 2.8.0.0  - [eF Bill]", "", "[NAME:txtrdNo]")
                              ControlSend(" :DS  - eF:: Version - 2.8.0.0  - [eF Bill]", "", "[NAME:txtrdNo]", "^v")
                              ControlSend(" :DS  - eF :: Version - 2.8.0.0  - [eF Bill]", "", "[NAME:txtrdNo]", "{enter}")
      How to add like above ?
                    
                                                                sorry for my bad english