OnMessage problem Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
HIAC
Posts: 111
Joined: 11 Oct 2017, 17:59
Location: Republic of Serbia

OnMessage problem

14 Nov 2017, 02:19

Code: Select all

OnMessage(0x201, "AutoLang")

AutoLang()
{
    If A_GuiControl = RuskiTxt
        Send, ^+2
    else if A_GuiControl = SrpskiTxt
        Send, ^+1
    else if A_GuiControl = PREVODILAC
    {
        if NaRuski = 1
            Send, ^+1
        else if NaSrpski = 1
            Send, ^+2
    }
    else
        Send, ^+1
}
return

Everything works, except "if NaRuski = 1" and "else if NaSrpski = 1" (These are Radio buttons).. what am I doing wrong?
Last edited by HIAC on 14 Nov 2017, 03:58, edited 1 time in total.
Helgef
Posts: 3202
Joined: 17 Jul 2016, 01:02
Contact:

Re: OnMessage problem  Topic is solved

14 Nov 2017, 03:26

Hello, please see functions and global. Example

Code: Select all

AutoLang()
{
    global NaRuski, NaSrpski	; < --- Note
    If A_GuiControl = RuskiTxt
        Send, ^+2
    else if A_GuiControl = SrpskiTxt
        Send, ^+1
    else if A_GuiControl = PREVODILAC
    {
        if NaRuski = 1
            Send, ^+1
        else if NaSrpski = 1
            Send, ^+2
    }
    else
        Send, ^+1
}
Cheers.

Edit: I didn't see they where radio buttons, also see [docs]gui[/docs], [url=https://autohotkey.com/docs/commands/Gui.htm#Submit]submit[/url].
HIAC
Posts: 111
Joined: 11 Oct 2017, 17:59
Location: Republic of Serbia

Re: OnMessage problem

14 Nov 2017, 04:28

Thanks a lot!

Return to “Ask For Help”

Who is online

Users browsing this forum: Google [Bot], MannyKSoSo, masok, Rohwedder, roysubs, Scr1pter and 29 guests