Sign in to follow this  
Followers 0
NicePerson

ControlSend help

11 posts in this topic

#1 ·  Posted (edited)

Hi guys i am new here and also new to this cute AutoIt language.

i am writing a script to buzz yahoo chat screen with AutoIt but i don't know why it sends only G?

have a look on cede and plz help

; Identify the Yahoo window
; Change into the WinTitleMatchMode that supports classnames and handles
AutoItSetOption("WinTitleMatchMode", 4)

$handle = WinGetHandle("[CLASS:CConvWndBase]")
If @error Then
    MsgBox(4096, "Error", "Could not find the correct window")
Else
; Ctrl + G is shortcut for buzzing but not working here it sends only G
    ControlSend($handle, "", "YIMInputWindow1", "{LCtrl}G")
    EndIf
Edited by RMR

Share this post


Link to post
Share on other sites



It should be:

ControlSend($handle, "", "YIMInputWindow1", "^g")

http://www.autoitscript.com/autoit3/docs/functions/Send.htm

Share this post


Link to post
Share on other sites

Thanks for replying but boths are not working!!

is my question so difficult for experts???

Share this post


Link to post
Share on other sites

Hey if anyone did not understand my question then ask whatever you want about it but help me please??

It proves how helpful this forum is!

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

It proves how helpful this forum is!

Did you read rules from the forum about bumping your topic?

...that isnt someting to say when you did not provide enought info on your problem and did not read rules on forum.

Are you trying to activate hotkey from other window? If thats the case did you try to use Send instead ControlSend?

Send is difrent from controlsend in many wayes, one is used to send strings mostly to specific control, the other is used to send key strokes.

Try

If WinExists ( "[CLASS:CConvWndBase]" ) Then
    If Not WinActive ( "[CLASS:CConvWndBase]" ) Then
        WinActivate ( "[CLASS:CConvWndBase]" )
        WinWaitActive ( "[CLASS:CConvWndBase]" )
    EndIf
    Send ( "^g" )
Else
    MsgBox ( 0 , "" , "You dont have that win" )
EndIf

if its working for you

Edited by bogQ

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 

Share this post


Link to post
Share on other sites

@bogQ

Thanks its working!

Share this post


Link to post
Share on other sites

Dont tank me,

Inconspicuous posted you the link to Send command in his post, dono why you did not try that command it in the first palce. You where one click to solution.


TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

OK Thanks but, one more question how to attach a text file or pic with autoit to yahoo chat window?

Here is my try!

If WinExists ( "[CLASS:CConvWndBase]" ) Then
        WinActivate ( "[CLASS:CConvWndBase]" )
        WinWaitActive ( "[CLASS:CConvWndBase]" )
        Send("D:\AVI-Songs\Akon\AKON-NA-NA-NA.avi")
Else
    MsgBox ( 0 , "" , "You dont have that window" )
EndIf
Edited by RMR

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

Dont know how yahoo chat is working. If ctrl+c +v is working on files in yahoo chat then

_ClipPutFile to load file

and ctrl+v to send it to win shud work

If yahoo chat dont have that option and have button or hotkey that activate that process then controlclick to click that option or send to activate it from meny or WinMenuSelectItem. then use send or control send for file path on win that request file path.

Edited by bogQ

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 

Share this post


Link to post
Share on other sites

Thanks a lot again!

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  
Followers 0