Jump to content

error when call cursortool.dll to much


Recommended Posts

func _run()
$size = WinGetPos("")
$tam_x= $size[0]+470
$tam_y= $size[1]+380

    $r = 20
    $alpha = 0
    $n = $n +1
    Do
        $r = $r +1
        $alpha =$alpha + 0.2

        $x = $r*sin($alpha)
        $y = 3/4*$r*cos($alpha)


        MouseMove($x+$tam_x, $y+$tam_y, 0)
        $ReturnArray = DllCall("CursorTool.dll", "int", "GetCursorId")
        
        If $ReturnArray[0]= 8760 then
            mouseclick($click, $x+$tam_x, $y+$tam_y, 1, 0)
            $cursorId = return[0]
            $r = 20
            $alpha = 0
            sleep(GUICtrlRead($input)*1000)
        EndIf
    until $r > 400
return
endfunc

Working nice about 5mins. After that, mouse still moving without click ( seem dllcall not working, cant check Mouse ID)

Maybe cause I use DllCall("Cursortoll.dll") to much. And make window error. Cant do it any more.

http://www.geocities.com/subnetjet/CursorTool.zip

( cursortool.dll made by Kageroo use VB)

Edited by hoang anh
Link to comment
Share on other sites

i dun know how explain it. Very hard. Not Win32 error. Seem like autoit error or code error.

In my code, I used dllcall. But Func " If - return " make dllcall repeat too much. After running about 10mins, dllcall stop working while my func still working well.

Link to comment
Share on other sites

  • 2 weeks later...
  • 1 month later...

Yeah I get that same problem, I think maybe there is a memory leak or something. I can't explain it, but there is probably a bug in the C code somewhere. Even when you leave the DLL open and just make calls to the function the same problem happens eventually.

It works perfectly for about 5 minutes like you said, and then it's like my whole script becomes semi-unresponsive. If I recall correctly no events would get fired at all.

I originally just built the DLL directly from source code which was posted on this forum somewhere, fact is I don't fully understand how it works and haven't revisited it since I built it into a DLL. You'll need to get some C skills to fix this one. Let me know if you have any luck. I gave up on this one months ago. It's a shame it's not working because being able to identify unknown cursor types would be a really handy feature.

Link to comment
Share on other sites

  • 5 months later...

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...