Jump to content

ControlSend ComboBox in service system


Recommended Posts

Hello!
Sry for my english, is a second language. I will try to explain my problem the best I can!

Im currently working on a program that select something in a ComboBox and then press okay. That generate a file that I need to transfert after. The number I want to enter in the ComboBox is "016" but everytime it seems that the combo box get "001" (The default value) or "100"... I think one time I got "010". When i launch my code normally in windows it worked fine! But the program run every minute and required to put the focus on the screen which make the computer unable to use.

For info, it was working fine before we updated in windows 10. 

If you need more info simply ask and you should receive! 

Here some code that change the combobox (Some window name and extension have been changed to post here.)
 

#include <FileConstants.au3>
#include <MsgBoxConstants.au3>
#include <AutoItConstants.au3>

      local $hWndMain = WinWait("[CLASS:PLACEHOLDER]", "", 10) ; 10sec timout max
      ControlSend($hWndMain,"","","{ALT}{F}{O}") ; Ouverture de la selection de fichier (shortcut)
      local $hWndSel = WinWait("[TITLE:PLACEHOLDER2]") ; Fen de selection du fichier
      ControlFocus($hWndSel, "", "ComboBox1")
      Send( "{BACKSPACE}" )
      Send( "{BACKSPACE}" )
      Send( "{BACKSPACE}" )
      Sleep(1000)
      ;ControlSetText($hWndSel, "", "ComboBox1", "016")
      ControlSend($hWndSel,"","","016") ; Sel du fichier avec son numéro dans la liste
      Sleep(500)
      ControlSend($hWndSel,"","","6") ; Sel du fichier avec son numéro dans la liste
      ControlSend($hWndSel,"","","!f")
      ControlSend($hWndSel,"","","{ALT}{F}") ; Fermeture
      While WinExists($hWndSel)
         sleep(1000)
      WEnd

      FileMove($DirSrc & $Filename & ".ext1", $DirDst & $Filename & ".ext1", $FC_OVERWRITE + $FC_CREATEPATH)
      FileMove($DirSrc & $Filename & ".ext2", $DirDst & $Filename & ".ext2", $FC_OVERWRITE + $FC_CREATEPATH)

      If $Close Then
         ProcessClose($PID)
      EndIf

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...