Jump to content

ControlSend not working with this title


Recommended Posts

>>>> Window <<<<
Title: BlueStacks App Player for Windows (beta-1)
Class: WindowsForms10.window.8.app.0.33c0d9d
Position: 101, 38
Size: 1030, 652
Style: 0x16CA0000
ExStyle: 0x00050100
Handle: 0x0000000000060894
>>>> Control <<<<
Class: BlueStacksApp
Instance: 1
ClassnameNN: BlueStacksApp1
Name:
Advanced (Class): [CLASS:BlueStacksApp; INSTANCE:1]
ID:
Text: _ctl.Window
Position: 0, 0
Size: 1024, 576
ControlClick Coords: 529, 104
Style: 0x58000000
ExStyle: 0x00000000
Handle: 0x0000000000050864

And i write a ControlSend like this:

ControlSend("BlueStacks App Player for Windows (beta-1)","","[CLASS:BlueStacksApp; INSTANCE:1]","{BACKSPACE}")

But he is not working. When i delete the title of above code, he work well.

I think the problem is in the title with string "(beta-1)", i dont know how to fix it.

I have tried to change the title match mode by this code

Opt("WinTitleMatchMode", 1) ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=Nocase

but the same, nothing work. Please help me!!

Edited by drquochoai
Link to comment
Share on other sites

From what I believe, WinTitleMatchMode is deprecated and makes no difference anymore, in any event, you should use mode 4 for the advanced. That being said, can you activate the window with WinActivate()? If you can, use this structure:

$hwnd_Blue = WinActivate("BlueStacks App Player")
if not $hwnd_Blue then
   ConsoleWrite("Something bombed with activating the window." & @CRLF)
   Exit
endif
ControlSend($hwnd_Blue,"","[CLASS:BlueStacksApp; INSTANCE:1]","{BACKSPACE}")

If you're not wishing to activate the window, then get the window handle with

$hwnd_Blue = WinGetHandle("BlueStacks App Player")
if @error then
   ConsoleWrite("Something bombed with grabbing the handle." & @CRLF)
   Exit
endif
ControlSend($hwnd_Blue,"","[CLASS:BlueStacksApp; INSTANCE:1]","{BACKSPACE}")

Edit: Sheesh ... there's an inconsistency in return values between WinGetHandle and WinActivate. :/ WinActivate doesn't set @error. *facepalm* Fixed.

Edited by Blue_Drache

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

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...