Jump to content

Simple comands in background window


Hunterr
 Share

Recommended Posts

Hi, I whould like to use this code or something similar but on a window called "talk" while minimized or in the background...

the MouseMove or MouseMclick can be changed to something like " look for word talk and click it" has there is only one word "talk" in the window

Func Talk()
   MouseMove(851,79,3)
   MouseClick("left",851,79,1,3)
   sleep(2000)
   send("{enter}")
   sleep(3000)
   send("Hellow")
   sleep(1000)
   send("{enter}")
   sleep(1000)
EndFunc

I'm not a programer but get a thing or two about it... this code is verry simple but I cant see how to put it to work on the background

other thing... is it possible to detect when a poput window appears on that "talk" window? if so I whould remove the sleeps for it... because everytime I Mouseclick or hit enter a new popup window appears

thanks everyone, I hoppe you all understood what I'm trying to explain

ps: thanks a lot autoit.... you made my mundane day to day repetable tasks a lot easyer xD

Link to comment
Share on other sites

In a "normal fullscreen program window" a word is something you cannot click and have something happen.

What you can click are controls in the "normal fullscreen program window".

Use window info tool (which can be found in the start menu under Autoit3 to find the control.

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

Perhaps ControlClick will work.

Get a handle to the window with something like WinGetHandle()

The use the handle in the ControlClick() function as the title, and use the

Advanced Mode Class in your pic as the ID.

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

well it looks chinease to me what you said xD can you give me an example of some code so I can start with?

I saw ControlClick() func named in other topics I'll do a bit of searching and see what I get

Edit:

after a bit o search I got this:

ControlClick(0x00170512,"talk",9)

being 0x00170512 what I got from

$a=WinGetHandle("talk","")
   MsgBox(0,"Handle",$a)

and 9 the button ID (I think)

this doesnt work.. what am I doing wrong?

Edited by Hunterr
Link to comment
Share on other sites

You say your window is named 'talk', and the Advanced Mode in your pic is '[CLASS:MFCGridCtrl; INSTANCE:1]'

So

ControlClick("talk","","[CLASS:MFCGridCtrl; INSTANCE:1]")

Or

$hWnd = WinGetHandle("talk","")

ControlClick($hWnd,"","[CLASS:MFCGridCtrl; INSTANCE:1]")

Edited by JohnOne

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

hum, looks like something... tested and does not work... with a bit more testing I found when I use autoit Window info, the advanced mode is from a grid where the button I want to click is.... so I think I need to put the position of it...

after studiing a bit on ctrlclick I think it is possible for that to work... the coords from the WindowInfo is 29, 12

I think with that it whould work... after that...

how do I send input with the "keyboard"? after I click talk I whant to write "hello" on the new popup (within the main window) "[CLASS:Edit; INSTANCE:1]" (WindowInfo info) that apears

edit:

I found ControlSend while looking on the forum but cant put it to work... trying like this

ControlSend("talk","","[CLASS:Edit; INSTANCE:1]","39")

(trying to multitask whyle I whait for your response)

thanks for everithing :)

Edited by Hunterr
Link to comment
Share on other sites

thank you for your help :) finaly works even while minimized... the code is this:

Func Talk()
   ControlClick("Talk","","[CLASS:MFCGridCtrl; INSTANCE:1]","left",1,27,13) ;clicks on the button
   While WinExists("Write")=0 ;verryfies if the popup windows exists if not sleeps for half a second
   sleep(500)
   WEnd
   ControlFocus("Write","","Edit1") ;Focus on the spot to write
   ControlSend("Write","","[CLASS:Edit; INSTANCE:1]","Hello") ;actualy writes
   sleep(500)
   ControlClick("Level","","[CLASS:Button; INSTANCE:1]") ;clicks "ok"
   EndFunc

ps: sorry for any grammar mistakes

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