Jump to content

ControlSend to untitled window


Recommended Posts

Hello
 
i already did some research but i can't find anything to help me any further.
I'm trying to send commands to a untitled window. Neither its working with handle nor with the title i was able to change the window to. Also the windowtitle is being reset when i activate the window.

What i got so far:

#Include <Array.au3>
#Include <WinAPIEx.au3>

AutoItSetOption("WinTitleMatchMode", 4)

Global $handle = _WinAPI_EnumProcessWindows(ProcessExists("notepad.exe")) ; testing script with notepad

If IsArray($handle) Then
 WinSetTitle($handle[1][0], "", "New Window")
 ControlFocus("New Window", "", "Edit1")
 ControlSend("New Window", "", "Edit1", "test")
EndIf
Link to comment
Share on other sites

  • Developers

Your posted script works fine for me so am not sure what your are asking?

Also not sure why you rename the title as you can do the Control command with the found handle:

#include <Array.au3>
#include <WinAPIEx.au3>

AutoItSetOption("WinTitleMatchMode", 4)

Global $handle = _WinAPI_EnumProcessWindows(ProcessExists("notepad.exe")) ; testing script with notepad

If IsArray($handle) Then
;~  WinSetTitle($handle[1][0], "", "New Window")
;~  ControlFocus("New Window", "", "Edit1")
    ControlSend($handle[1][0], "", "Edit1", "test")
EndIf

Jos

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Yes, it works for notepad.

I used notepad to test the script, but its not working for the window i want it to work for.

I tried it with the handle but nothing happens -> Thats why i tried to rename it and send the command to the new windowtitle

It seems like the required window is not accessible :/

Link to comment
Share on other sites

Its a game called Killing Floor.

I just checked and it does not work for other games either.

PS

I'm not trying to create a bot. It's just that the next round starts automatically after about 30 secs if you tab out of the game and leave it be -> Dead before you can react :thumbsup:

Link to comment
Share on other sites

  • Developers

Its a game called Killing Floor.

I just checked and it does not work for other games either.

PS

I'm not trying to create a bot. It's just that the next round starts automatically after about 30 secs if you tab out of the game and leave it be -> Dead before you can react :thumbsup:

Not sure if you actually did read our forum rules since you made this comment, but please reread then and let's stick to them ..ok?

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...