Hi, my name is Mariusz, im in AHK since 1 week and i can make macro that will work only on specific window. I made macro that works but it works only when i have aplication on top
could someone help me with this task that i could do something else while im on pc, here is my code:
#h::
Loop
{
Send {Enter} Landrynka
Sleep, 2500
Send {Enter} Landrynka
}
return
#j::Pause
Window Spy:
Landrynka
ahk_class GAME
ahk_exe Landrynka.exe
ahk_pid 4480
Problem with working in background
- Yakshongas
- Posts: 590
- Joined: 21 Jan 2020, 08:41
Re: Problem with working in background
Consider learning a bit about ControlSend if you want to send keys to background windows.
Code: Select all
#h::
Loop
{
ControlSend,, {Enter} Landrynka, AHK_exe Landrynka.exe
Sleep, 2500
ControlSend,, {Enter} Landrynka, AHK_exe Landrynka.exe
}
return
#j::Pause
Please mark your topics as solved if you don't need any further help.
Need a little more help? Discord : Yakshongas#9893 🕹
Need a little more help? Discord : Yakshongas#9893 🕹
Re: Problem with working in background
but what if i have meny of window with same nickname you know how to implement ahk_pid ?
and can i even do that kind of stuff ?
and can i even do that kind of stuff ?
- Yakshongas
- Posts: 590
- Joined: 21 Jan 2020, 08:41
Re: Problem with working in background
@Mariousz
Yes just change the "AHK_exe Landryka.exe" with "AHK_pid" and the pid that shows in the window spy.
Yes just change the "AHK_exe Landryka.exe" with "AHK_pid" and the pid that shows in the window spy.
Please mark your topics as solved if you don't need any further help.
Need a little more help? Discord : Yakshongas#9893 🕹
Need a little more help? Discord : Yakshongas#9893 🕹
Re: Problem with working in background
i think that contolsend don't work in my case any other idea ?
- Yakshongas
- Posts: 590
- Joined: 21 Jan 2020, 08:41
Re: Problem with working in background
If you have to send text to a specific text field you need to select it first with ControlClick.
Use this script to know the coordinates of the text field:
ControlClick Works like this:
ControlClick [, Control-or-Pos, WinTitle, WinText, WhichButton, ClickCount, Options, ExcludeTitle, ExcludeText]
Use this script to know the coordinates of the text field:
Code: Select all
CoordMode, Mouse, Relative
Loop
{
MouseGetPos, posX, PosY
ToolTip, X: %posX% Y: %posY%
}
ControlClick [, Control-or-Pos, WinTitle, WinText, WhichButton, ClickCount, Options, ExcludeTitle, ExcludeText]
Please mark your topics as solved if you don't need any further help.
Need a little more help? Discord : Yakshongas#9893 🕹
Need a little more help? Discord : Yakshongas#9893 🕹
Re: Problem with working in background
it is just that after pressing enter a dialogbox should appear in which you can enter Text but it does not appear
Re: Problem with working in background
Do you have discord ? That we could tak and show you what do i mean ?
- Yakshongas
- Posts: 590
- Joined: 21 Jan 2020, 08:41
Re: Problem with working in background
Try getting the focus of the window first.
Code: Select all
#h::
Loop
{
ControlFocus,, AHK_exe Landrynka.exe
ControlSend,, {Enter} Landrynka, AHK_exe Landrynka.exe
Sleep, 2500
ControlSend,, {Enter} Landrynka, AHK_exe Landrynka.exe
}
return
#j::Pause
Please mark your topics as solved if you don't need any further help.
Need a little more help? Discord : Yakshongas#9893 🕹
Need a little more help? Discord : Yakshongas#9893 🕹
- Yakshongas
- Posts: 590
- Joined: 21 Jan 2020, 08:41
Re: Problem with working in background
@Mariousz
I sent you my discord in a private message
I sent you my discord in a private message
Please mark your topics as solved if you don't need any further help.
Need a little more help? Discord : Yakshongas#9893 🕹
Need a little more help? Discord : Yakshongas#9893 🕹
Re: Problem with working in background
i sended you firend request
Who is online
Users browsing this forum: Bing [Bot] and 68 guests