Jump to content

GUICtrlRead doesnt work from yestarday?


Go to solution Solved by Melba23,

Recommended Posts

Sorry, I couldn't do that from home, also I'm forbidden to post entire codes... (don't really understand why not but company police) but here is the function code that is running right know. Also I must add that the original code had nothing wrong with it, I just messed up with the nameing of a new textbox, very unprofessional i know.

Func Arfolyam()

    If Not WinExists("UD Operátor") Then
        MsgBox(0, "Üzenet", "Kérem nyissa meg az UD_OPER programot!", 10)
        Return
    EndIf
    Local $penznem = GUICtrlRead($iPenznem)
    Local $spenznem = String($penznem)
    Local $iarfolyam = GUICtrlRead($arfolyam)
    MsgBox(0, "This", $iarfolyam)
    WinActivate("UD Operátor")
    If $spenznem = "" Then
        MsgBox(0, "Hiba", "Adjon meg Pénznem kódot!")
        Return
    EndIf
    If $iarfolyam = "" Then
        MsgBox(0, "Hiba", "Adjon meg Új árfolyamot!" & $iarfolyam)
        Return
    EndIf
    ;MsgBox(0, "Árfolyam Teszt", "Az" & $penznem)
    ControlClick("UD Operátor", "Valuta", "[CLASSNN:TAdvBitBtn7]")
    WinWaitActive("Pénznem", "")
    ;ControlSetText("Pénznem", "", "[CLASSNN:TDEdit6]", $spenznem) --> nem értem miért nem működik
    ControlClick("Pénznem", "", "[CLASSNN:TDEdit6]")
    Send($spenznem)
    Sleep(200)
    MsgBox(0, "pip", "pup")
    ControlClick("Pénznem", "", "[CLASSNN:TAdvBitBtn6]")
    Sleep(200)
    ControlClick("Pénznem", "", "[CLASSNN:TAdvBitBtn8]")
    WinWaitActive("Árfolyam", "", 5)
    If Not WinExists("Árfolyam") Then
        MsgBox(0, "Hiba", "Hiba történt, biztos, hogy létező árfolyamot adott meg?")
        WinClose("Pénznem", "")
        Return
    EndIf
    ControlClick("Árfolyam", "", "[CLASSNN:TAdvBitBtn7]")
    WinWaitActive("Új Áfolyam", "")
    Send($iarfolyam)
    ControlClick("Új Áfolyam", "", "[CLASSNN:TBitBtn1]")
    Sleep(200)
    WinClose("Pénznem", "")
    Sleep(200)
    WinClose("Árfolyam", "")
    ;ControlClick("Új Árfolyam", "",)
    ;ControlSetText("Új Áfolyam", "", "[CLASSNN:TTDCustimeEdit2]", $arfolyam)
    ;Pénznem ablak, [CLASSNN:TAdvBitBtn8]
    ;Árfolyam ablak, [CLASSNN:TAdvBitBtn7]

EndFunc   ;==>Arfolyam

$arfolyam is declered as global at the beginning of the script but it is not really needed since it is "created" from the isf file.

Edit: Also its not really the problem of the thread but do you have a guess why would controlsettext doesnt work? (neither gettext) Its not a very big problem since I can circumnavigate it. I dont remember, because this is an old problem, I think I tried to give/put focus on it before useing the function before. I can only think that somehow the programs (i only tried to use them at home developed programms) doesnt declere their controls, the way autoit would like to eat them or i dont know

Edited by SorryButImaNewbie
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...