Jump to content
Sign in to follow this  
h3ir

Send Key to inactive Window

Recommended Posts

h3ir

Hello, i want to send a key to an inactive window. Its the game "lord of the rings" and this is my code ;-) (i am using the german client)

ControlSend("Der Herr der Ringe Online: Schatten von Angmar", "", "", "c")

This are my WindowInfos:

CODE
>>>> Window <<<<

Title: Der Herr der Ringe Online: Schatten von Angmar

Class: Turbine Device Class

Position: 124, 96

Size: 1032, 802

Style: 0x16CE0000

ExStyle: 0x00000100

Handle: 0x0005047A

>>>> Control <<<<

Class:

Instance:

ClassnameNN:

Advanced (Class):

ID:

Text:

Position:

Size:

ControlClick Coords:

Style:

ExStyle:

Handle: 0x000803B8

>>>> Mouse <<<<

Position: 816, 466

Cursor ID: 0

Color: 0x201F0E

I tried many things, but nothing work. And my Script shouldnt run with the send function in "active-mode"

Share this post


Link to post
Share on other sites
Cha0sBG

Umm i Dont See Anything Wrong :S

Maybe The Problem is With The Title ?

Edited by Cha0sBG

Have Questions About GUI (Graphical User Interface) ? Post Them Here :GUI Help And Support ForumHave Questions About General AutoIt ? Post Them Here : General Help And Support ForumNew To AutoIt ? Be Shure To Check Out The FaQ's (Frequently Asked Questions) Or FaQ ¹ There You May Find Great Help That Will Guide You True The Wonderful Programming Language AutoItOthere Good Place To Get Some Knolage Of AutoIt Is The Example Script ForumNotice A Bug ? Please Go And Report it At Bug Report Section And Help The Devolepers Of AutoIt Update And Fix The Programming LanguageWant To Thank The People For This Great Forum And Programming Language ? Then DonateWhen You Found The Answer Your Looking For Please Add [Resolved] To The Thread's Name That Will Show Otheres That You Have Found What Your Looking For And They Whount Have To Enter The Thread.

Share this post


Link to post
Share on other sites
h3ir

There is no Problem with the title, i checked it many times...

i tested this:

ControlFocus ("Der Herr der Ringe Online: Schatten von Angmar", "", "")
ControlSend("Der Herr der Ringe Online: Schatten von Angmar", "", "", "c")

Works, but Window gets focus

and this:

ControlSend("[Class:Turbine Device Class]", "", "", "c")

Dont work

Share this post


Link to post
Share on other sites
Cha0sBG

umm try this

Global $Window = WinGetTitle("[CLASS:CLIENT]")

While 1
Tryout()
WEnd

Func Tryout()
    While 1
    ControlSend($Window, "", "", "2")
    Exit
    ExitLoop
    WEnd
    EndFunc
Edited by Cha0sBG

Have Questions About GUI (Graphical User Interface) ? Post Them Here :GUI Help And Support ForumHave Questions About General AutoIt ? Post Them Here : General Help And Support ForumNew To AutoIt ? Be Shure To Check Out The FaQ's (Frequently Asked Questions) Or FaQ ¹ There You May Find Great Help That Will Guide You True The Wonderful Programming Language AutoItOthere Good Place To Get Some Knolage Of AutoIt Is The Example Script ForumNotice A Bug ? Please Go And Report it At Bug Report Section And Help The Devolepers Of AutoIt Update And Fix The Programming LanguageWant To Thank The People For This Great Forum And Programming Language ? Then DonateWhen You Found The Answer Your Looking For Please Add [Resolved] To The Thread's Name That Will Show Otheres That You Have Found What Your Looking For And They Whount Have To Enter The Thread.

Share this post


Link to post
Share on other sites
Cha0sBG

theres a bug in Control Send functionality Hope the admin will fix it


Have Questions About GUI (Graphical User Interface) ? Post Them Here :GUI Help And Support ForumHave Questions About General AutoIt ? Post Them Here : General Help And Support ForumNew To AutoIt ? Be Shure To Check Out The FaQ's (Frequently Asked Questions) Or FaQ ¹ There You May Find Great Help That Will Guide You True The Wonderful Programming Language AutoItOthere Good Place To Get Some Knolage Of AutoIt Is The Example Script ForumNotice A Bug ? Please Go And Report it At Bug Report Section And Help The Devolepers Of AutoIt Update And Fix The Programming LanguageWant To Thank The People For This Great Forum And Programming Language ? Then DonateWhen You Found The Answer Your Looking For Please Add [Resolved] To The Thread's Name That Will Show Otheres That You Have Found What Your Looking For And They Whount Have To Enter The Thread.

Share this post


Link to post
Share on other sites
h3ir

is there a method to send the key to a inactive window WITHOUT using controlsend?

Share this post


Link to post
Share on other sites
Cha0sBG

no :S there is anothere way that you may try but don't think you will like it here:

While 1
WinActivate("Der Herr der Ringe Online: Schatten von Angmar")
Send("c")
WinSetState("Der Herr der Ringe Online: Schatten von Angmar", "",@SW_Minimize)
exit
wend

Have Questions About GUI (Graphical User Interface) ? Post Them Here :GUI Help And Support ForumHave Questions About General AutoIt ? Post Them Here : General Help And Support ForumNew To AutoIt ? Be Shure To Check Out The FaQ's (Frequently Asked Questions) Or FaQ ¹ There You May Find Great Help That Will Guide You True The Wonderful Programming Language AutoItOthere Good Place To Get Some Knolage Of AutoIt Is The Example Script ForumNotice A Bug ? Please Go And Report it At Bug Report Section And Help The Devolepers Of AutoIt Update And Fix The Programming LanguageWant To Thank The People For This Great Forum And Programming Language ? Then DonateWhen You Found The Answer Your Looking For Please Add [Resolved] To The Thread's Name That Will Show Otheres That You Have Found What Your Looking For And They Whount Have To Enter The Thread.

Share this post


Link to post
Share on other sites
h3ir

no :S there is anothere way that you may try but don't think you will like it here:

While 1
WinActivate("Der Herr der Ringe Online: Schatten von Angmar")
Send("c")
WinSetState("Der Herr der Ringe Online: Schatten von Angmar", "",@SW_Minimize)
exit
wend
:)

i use the send function right now, but its to anoying for the user muttley

Share this post


Link to post
Share on other sites
Cha0sBG

Well As You See I Made It Activate It And When The Send Function Is Over minimize it again muttley


Have Questions About GUI (Graphical User Interface) ? Post Them Here :GUI Help And Support ForumHave Questions About General AutoIt ? Post Them Here : General Help And Support ForumNew To AutoIt ? Be Shure To Check Out The FaQ's (Frequently Asked Questions) Or FaQ ¹ There You May Find Great Help That Will Guide You True The Wonderful Programming Language AutoItOthere Good Place To Get Some Knolage Of AutoIt Is The Example Script ForumNotice A Bug ? Please Go And Report it At Bug Report Section And Help The Devolepers Of AutoIt Update And Fix The Programming LanguageWant To Thank The People For This Great Forum And Programming Language ? Then DonateWhen You Found The Answer Your Looking For Please Add [Resolved] To The Thread's Name That Will Show Otheres That You Have Found What Your Looking For And They Whount Have To Enter The Thread.

Share this post


Link to post
Share on other sites
h3ir

Well As You See I Made It Activate It And When The Send Function Is Over minimize it again :)

but, do you want to use a program, that pops every X seconds up and press a key? muttley

Share this post


Link to post
Share on other sites
Cha0sBG

it Works If Your Not On The Computer But .... nvm Contact The Admin And Make A Report That ControlSend Function Isn't Working Properly


Have Questions About GUI (Graphical User Interface) ? Post Them Here :GUI Help And Support ForumHave Questions About General AutoIt ? Post Them Here : General Help And Support ForumNew To AutoIt ? Be Shure To Check Out The FaQ's (Frequently Asked Questions) Or FaQ ¹ There You May Find Great Help That Will Guide You True The Wonderful Programming Language AutoItOthere Good Place To Get Some Knolage Of AutoIt Is The Example Script ForumNotice A Bug ? Please Go And Report it At Bug Report Section And Help The Devolepers Of AutoIt Update And Fix The Programming LanguageWant To Thank The People For This Great Forum And Programming Language ? Then DonateWhen You Found The Answer Your Looking For Please Add [Resolved] To The Thread's Name That Will Show Otheres That You Have Found What Your Looking For And They Whount Have To Enter The Thread.

Share this post


Link to post
Share on other sites
Cha0sBG

GooD Job Hope They Will Fix It In The Next AutoIt Beta Version muttley


Have Questions About GUI (Graphical User Interface) ? Post Them Here :GUI Help And Support ForumHave Questions About General AutoIt ? Post Them Here : General Help And Support ForumNew To AutoIt ? Be Shure To Check Out The FaQ's (Frequently Asked Questions) Or FaQ ¹ There You May Find Great Help That Will Guide You True The Wonderful Programming Language AutoItOthere Good Place To Get Some Knolage Of AutoIt Is The Example Script ForumNotice A Bug ? Please Go And Report it At Bug Report Section And Help The Devolepers Of AutoIt Update And Fix The Programming LanguageWant To Thank The People For This Great Forum And Programming Language ? Then DonateWhen You Found The Answer Your Looking For Please Add [Resolved] To The Thread's Name That Will Show Otheres That You Have Found What Your Looking For And They Whount Have To Enter The Thread.

Share this post


Link to post
Share on other sites
h3ir

GooD Job Hope They Will Fix It In The Next AutoIt Beta Version muttley

he sayed, that this is no bug...

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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.