Rob A Posted September 13, 2006 Share Posted September 13, 2006 Hi Peeps,If WinExists("Check Point VPN-1 SecuRemote Connection") ThenWinActivate("Check Point VPN-1 SecuRemote Connection", "")Send("!c")EndIfwendI 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 cheersRob Link to comment Share on other sites More sharing options...
schlitzy Posted September 13, 2006 Share Posted September 13, 2006 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... Link to comment Share on other sites More sharing options...
Bert Posted September 13, 2006 Share Posted September 13, 2006 I had the same problem with a script doing what you are describing. The sleep statement did the trick nicely in correcting it. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Rob A Posted September 14, 2006 Author Share Posted September 14, 2006 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 nowRob. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now