ControlSend Not working properly with DeSmuME

Ask gaming related questions (AHK v1.1 and older)
polimthehat
Posts: 1
Joined: 23 Oct 2021, 22:28

ControlSend Not working properly with DeSmuME

Post by polimthehat » 23 Oct 2021, 23:09

So I just started up with ahk a few days ago to try and get something similar to a multiboxing script for the ds emulator DeSmuME, to run multiple instances side-by-side. I tried getting the ControlSend command to work for a while, but ended up having to settle on a Send command, like so: (sorry if this doesnt show up properly, first post :shock: )

Code: Select all

SetTitleMatchMode, 2

global ArrayPid
ArrayPid := []

WinGet, pokeId, List, DeSmuME
Loop, %pokeId% 
{ 
 WinGet, pid%A_Index%, PID, % "ahk_id " pokeId%A_Index%
 ArrayPid.push(pid%A_Index%)
}

GiveInput(keyStroke)
{
 ArraySize := % ArrayPid.MaxIndex()
 Loop, %ArraySize%
 {
  pid :=  % ArrayPid[A_Index]
  WinActivate, ahk_pid %pid%
  
  Send, {%keyStroke% down}
  Sleep 50
  Send, {%keyStroke% up}
  Sleep 75
 }
}

Numpad1::
GiveInput("x")
return

Esc::ExitApp
I kept trying to use controlSend so that i can run all of the windows simultaneously instead of one by one. but it seems like DeSmuME has no way to produce such a result :/

even trying to use ControlGetFocus to use in the ControlSend command doesnt work:

Code: Select all

SetTitleMatchMode, 2

h::
ControlGet, WinControl3, HWND,,, DeSmuME
ControlGetFocus, WinControl4, DeSmuME
MsgBox % WinControl4	;finds no control
MsgBox % WinControl3	;finds a control, but neither works when in ControlSend
ControlSend, WinControl4, x, ahk_id %WinControl3%
return

Esc::ExitApp
Even something simple like this doesnt send any input to either window:

Code: Select all

SetTitleMatchMode, 2

WinGet list, List, DeSmuME

h::
ControlSend,, x, ahk_id %list1%
ControlSend,, x, ahk_id %list2%
return

Esc::ExitApp
does anyone know a possible way that I'd be able to use ControlSend with it? or if theres any way to use controlSend with a window that has no control?
or even maybe if theres another emulator that I could swap to that would allow me to use ControlSend?

I've also attached an image of me using WindowSpy on DeSmuME.

Thank you for any help,
Polimthehat
Attachments
Desmume_windowSpy.PNG
Desmume_windowSpy.PNG (34.13 KiB) Viewed 570 times

User avatar
mikeyww
Posts: 26877
Joined: 09 Sep 2014, 18:38

Re: ControlSend Not working properly with DeSmuME

Post by mikeyww » 24 Oct 2021, 05:00

Things to try:
1. ahk_parent as the control name
2. Run script as admin

Unfortunately, some windows do not respond to ControlSend.

Post Reply

Return to “Gaming Help (v1)”