Unable to click on button in window using autohotkey -


i new ahk, , tried simulate clicking of button on window. want click on "accept" button of splash window. not work. below winspy of window. window :- enter image description here

the control "tcxbutton2" highlighted in classnn.

i tried following

^j:: ;run, kbdiag.exe , c:\program files\knorr-bremse\kb diag if winexist "ahk_class tformsplash" {     ;winactivate     ;postmessage not work     ;postmessage, 0x201, , , tcxbutton2, accept ; 0x201 wm_lbuttondown     ;postmessage, 0x202, , , tcxbutton2, accept ; 0x202 wm_lbuttonup     ;     winactivate     controlfocus , tcxbutton2, knorr-bremse sfn,, ,      controlclick , tcxbutton2, knorr-bremse sfn,, ,      msgbox %errorlevel%  ; errorlevel '1' , hence not okay   }  return 

see screenshot of splash window below enter image description here

i dont know doing wrong. appreciated !

ok managed solve this. property settitlematchmode must set '2' if string matched can present anywhere in window.

as seen in ahk file :-

  settitlematchmode, matchmode    2: window's title can contain wintitle anywhere inside match.  

working code here :-

    settitlematchmode, 2     controlsendbutton = tcxbutton2     controlfocus , %controlsendbutton%, ,knorr-bremse sfn, ,     ; string not present in wintitle, hence string matched against wintext     controlclick , %controlsendbutton%, ,knorr-bremse sfn, , 

Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -