Hi
I have a script/tool that basically sits in the system tray with a bunch of menu options on it for users, that performs various functions. I have a need to kill an annoying error window should it appear using this same tool (if possible). The issue I have is if I deploy this script on a Terminal or remote desktop server the application is constantly processing 1-5% CPU for each user running it. This creates a resource problem when you get a few users running this. I am hoping someone might have a better way to do this, or be able to explain why this is using CPU all the time and suggest a work around.
Basically this code is fixing an issue where an application (Sage ACT!) displays "A generic error occured in GDI+." on a Terminal Server randomly for users. The problem is the vendor has not fixed this in 5 versions on their product. My tool works I am just trying to minimize the resource usage and have not been able to.
This is a section of the code:
AutoItSetOption ( "WinTitleMatchMode", 3 ) While 1 $nMsg = WinGetState ($ACTWindow) Switch $nMsg Case 0 ;do nothing Case Else WinKill($ACTWindow,"A generic error occurred in GDI+.") EndSwitch $msg = TrayGetMsg() Select Case $msg = 0 ;If $GDI Then ;If WinGetState ($ACTWindow,"A generic error occurred in GDI+.") <> 0 Then ; If _IsVisible ( $ACTWindow ) Then ; EndIf ;EndIf ContinueLoop Case $msg = $ITDefaultLoc ResetRegKey(RegRead($RegHKLM & "\SOFTWARE\ActToday","Preference Default Location"),"Preference Default Location") EndSelect