Jump to content
syntaxing

ControlSend on Hidden Window (with no control ID)

Recommended Posts

syntaxing

I am trying to automate SAP without GUI scripting enabled by doing everything through MouseClicks. It's not the cleanest solution but it works pretty well so far. I noticed that ControlClick actually has the option to put control coordinates in the parameters. I tried it and this works great since it allows me to run SAP hidden while I run my script. Unfortunately I am only able to click on objects but not send text. Is it possible to do a ControlSend on the object I used ControlClick on? The biggest problem is that there is no control ID on the object since SAP groups everything into one window with weird class IDs (which I cannot find out since I do not have GUI scripting enabled). I've been searching for a solution for a while now and any help would be appreciated!

 

Thanks!

Share this post


Link to post
Share on other sites
Deye

syntaxing,

welcome to the Autoit forum

did you try  it without specifying an id ControlSend($hwnd, "", "", "text", 1)

Deye

Share this post


Link to post
Share on other sites
syntaxing

Thank you for the response!

I have been using the following code with no luck:

$test = WinGetHandle('Change Material')
   ControlClick($test,'',100,'left',1, 184, 171)
   ControlSend($test,'',100,'XX')

image.png.7dfc27f3ba2ec0b40ec308989d01b607.png

 

image.png.898c9808dfd1f713c282114776e07e89.png

Share this post


Link to post
Share on other sites
Deye
Posted (edited)

syntaxing,,

Try with whats for  "Advanced mode" for the ID

ControlClick($test, '', "[Advanced mode]", "left", 1)

Deye

Edited by Deye

Share this post


Link to post
Share on other sites
syntaxing

Hi Deye,

At first I made a silly mistake and literally put in "[AdvancedMode]" into my code... I was super confused why it wasn't working.

Interestingly, your code (and my original code) works but only when the window is active somewhere on the screen. I guess SAP is one of those programs that only listens to keystrokes when onscreen. I run two monitors so it's not a deal breaker but now I know my problem!

Thank you for all your help!

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

×