Jump to content

Recommended Posts

Posted

Hi Peeps,

If WinExists("Check Point VPN-1 SecuRemote Connection") Then

WinActivate("Check Point VPN-1 SecuRemote Connection", "")

Send("!c")

EndIf

wend

I am using the above script to check if a window is open and if it is then it sends the "c" key to click Connect button, this all works fine but the only issue is that after a few days the process starts to takes up 50% cpu cycles.

I need some advise please :)

cheers

Rob

Posted

The CPU usage is probably so high, because the function operate a couple of 100 times per second.

Try putting

Sleep(100)

before the "Wend" statement. That way, the loop only checks on the window 10 times per second, but that should be enough, i guess...

Posted

I had the same problem with a script doing what you are describing. The sleep statement did the trick nicely in correcting it.

Thanks you two, so far so good it appears to be working perfectly now :)

Bye 4 now

Rob.

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...