gte Posted September 27, 2009 Posted September 27, 2009 I cannot get controlsend to properly send a command/key combo to a program that is not the active window. It half works.If I put the program in the foreground in my second monitor, but have another window as the active window, I can see controlsend try and send the keystroke "!p" because the menu items flash very quickly, especially if I have it loop, but it does not work properly and expand the menu downward then wait for the next keystroke, like when I have it in the foreground/active. When it is in the active window, the options menu drops down and holds steady like it should (see screen capture), until I hit another key or click somewhere. If I hit the "r" key at this point, it refreshes the softwares screen.Any ideas why this is happening?This is the way that should work#include <GUIConstantsEx.au3> #include <Timers.au3> Opt("WinTitleMatchMode", 1) Opt("SendKeyDelay", 50) While 1 If ProcessExists('scguiw32.exe') Then If _Timer_GetIdleTime () <= "5000" Then Sleep(2000) Else ControlSend("ServiceCenter ", "", "xSC4550child05", "!P") ControlSend("ServiceCenter ", "Incident Queue: ", "xSC4550child05", "r") Sleep(5000) EndIf Else Sleep(15000) EndIfThis way works because I restore/minimize itexpandcollapse popup#include <GUIConstantsEx.au3> #include <Timers.au3> Opt("WinTitleMatchMode", 1) Opt("SendKeyDelay", 50) While 1 If ProcessExists('scguiw32.exe') Then If _Timer_GetIdleTime () <= "5000" Then Sleep(2000) Else WinActivate("ServiceCenter", "Incident Queue:") WinWaitActive("ServiceCenter ") ControlSend("ServiceCenter ", "", "xSC4550child05", "!P") ControlSend("ServiceCenter ", "Incident Queue: ", "xSC4550child05", "r") Sleep(5000) WinSetState("ServiceCenter - ","",@SW_MINIMIZE) Sleep(1000) EndIf Else Sleep(15000) EndIf WEnd HP OpenView ServiceCenter keep alive scriptRemote Desktop Login Script
gte Posted September 28, 2009 Author Posted September 28, 2009 bump HP OpenView ServiceCenter keep alive scriptRemote Desktop Login Script
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