Jump to content

Simplest example of using postmessage to click a button with AutoitX?


Recommended Posts

I am trying to find a simple starting point for using postmessage (in JScript but VBscript is ok), for example to click a button in windows Calculator.

Is this possible, can anyone provide an example?!

Thanks,

Alex

------------

PS I think it will go like this, but when I try it I get 'Object doesn't support this property or method'.

var shell = new ActiveXObject("WScript.shell");

oAutoIt = new ActiveXObject("AutoItX3.Control");

shell.Run("calc.exe", 1);

oAutoIt.Sleep(500);

$hwnd = oAutoIt.WinGetHandle("Calculator");

oAutoIt.DllCall("user32.dll", "int", "SendMessage", "hwnd", $hwnd , "int" , 1075 , "int", 2400, "int", 0);

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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...