0

My code should open a window from taskbar and then click a control from it. The problem is that after it opens the window I get the error : "exception: access violation reading 0x00000083".I am new to Python (and in programing) and I have no ideea what that means or how to solve it.My code looks like this :

    import autoit, time
    autoit.win_activate("KOPLAYER 1.3.1040")
    time.sleep(2)
    autoit.mouse_click(131, 507)

It opens (activates) the window but after that I get that exception error.

  • you could use windows api directly to simulate clicks (which worked for me in the past) instead of using a third party library – kmaork Jun 21 '16 at 07:55
  • Check this: http://stackoverflow.com/questions/1181464/controlling-mouse-with-python There are a lot of answers there with different ways to do this, at least one of them uses `ctypes` – kmaork Jun 22 '16 at 06:33

1 Answers1

0

I don't know if that works but change the 2 to 2000. Because in the normal AutoIt version you enter the time in ms not in s. And the minimal wait time is 10ms. Maybe that's what causes the error!

IkeRoyle
  • 457
  • 4
  • 13
  • I use the sleep function of Python's basic time library not AutoIt's one . – Mihai Barbu Jun 23 '16 at 08:15
  • I also found out that the normal command is MouseClick() without underscore. Also the syntax is diffrent from waht i know. Try following: Mouse_Click("left", 131, 507) from the https://www.autoitscript.com/autoit3/docs/functions/MouseClick.htm – IkeRoyle Jun 23 '16 at 08:23
  • It only works without having my program open , which seems to do all the trouble. Anyway , if I input in my code a command that makes that window active ( autoit.win_activate("KOPLAYER 1.3.1040")) it just doesn't do anything just opens it , and then it says that he finished the execution. – Mihai Barbu Jun 23 '16 at 09:05