Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

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


  • Please log in to reply
7 replies to this topic

#1 proTester

proTester

    Seeker

  • Normal Members
  • 5 posts

Posted 06 July 2012 - 12:43 AM

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);







#2 JohnOne

JohnOne

    John

  • Active Members
  • PipPipPipPipPipPip
  • 12,988 posts

Posted 06 July 2012 - 12:49 PM

DllCall is not in autoitx.

AutoIt Absolute Beginners Require a serial
 
 
OMG! Women are the cows of people.


#3 proTester

proTester

    Seeker

  • Normal Members
  • 5 posts

Posted 06 July 2012 - 01:05 PM

DllCall is not in autoitx.


OK Thanks, maybe there's another ActiveX wrapper to use dll calls from JScript.

#4 JohnOne

JohnOne

    John

  • Active Members
  • PipPipPipPipPipPip
  • 12,988 posts

Posted 06 July 2012 - 01:30 PM

I'm not sure about either, but I'd imaging you will find something in VB.

But It is certainly not an autoitx question. Maybe if you ask a moderator to move your thread to chat or developer chat.

AutoIt Absolute Beginners Require a serial
 
 
OMG! Women are the cows of people.


#5 Zedna

Zedna

    AutoIt rulez!

  • MVPs
  • 8,794 posts

Posted 06 July 2012 - 02:13 PM

There is function ControlClick() in AutoItX which you can use for your calculator buttons.

#6 proTester

proTester

    Seeker

  • Normal Members
  • 5 posts

Posted 07 July 2012 - 05:55 PM

DllCall is not in autoitx.

There is function ControlClick() in AutoItX which you can use for your calculator buttons.


Thanks, just wanted to know if it was supported. ControlClick() looks interesting. (For dll calls from JScript I'm now using DynamicWrapperX )

#7 JohnOne

JohnOne

    John

  • Active Members
  • PipPipPipPipPipPip
  • 12,988 posts

Posted 07 July 2012 - 07:38 PM

Does that give you access to windows API on remote machines from web content?

AutoIt Absolute Beginners Require a serial
 
 
OMG! Women are the cows of people.


#8 proTester

proTester

    Seeker

  • Normal Members
  • 5 posts

Posted 08 July 2012 - 11:00 PM

I think it used to in the early days of ActiveX but now security restrictions would prevent it! I'm looking at building HTAs for testing which run like HTML webpages but locally, without security restrictions.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users