srikanthsurabhi Posted November 25, 2010 Posted November 25, 2010 Hi All, I designed an application based on AutoIT. Below is the code from Listener that I am using to trigger exe files that perform certain functions. Whenever a user locks his/her system and logs back in, Listener is not responding. However, once they restart listener all functions are working fine. Please suggest me a solution to avoid the step of restarting Listener each time the user locks and unlocks systems Thank you, Srikanth #Include <Array.au3> #Include <String.au3> #Include <Clipboard.au3> #Include<HotKey.au3> #include <Process.au3> #Include <File.au3> #Include <StructureConstants.au3> #Include <WinAPI.au3> #Include <WindowsConstants.au3> #include<GUIConstants.au3> Opt("WinTitleMatchMode",2) Opt("MustDeclareVars", 1) Opt("MouseCoordMode",2) Opt("SendKeyDelay",0) Opt("MouseClickDelay",1) Opt("WinWaitDelay",0) HotKeySet("^!x", "MyExit") Dim $Rajni_Instances,$No_Of_Rajni_Instances Global Const $VK_F10 = 0x79 Global Const $VK_F11 = 0x7A Global Const $VK_F12 = 0x7B Global Const $VK_F9 = 0x78 If No_Of_Rajni_Instances() > 1 Then MsgBox(0,"Rajni Says..","I'm already running on your system..") Exit Else MsgBox(0,"Rajni Says..","I started working .. cool",5) EndIf Func No_Of_Rajni_Instances() $Rajni_Instances = _ArrayFindAll(ProcessList(),"Rajni_Dynamic_Listener.exe",0,0,0,1,0); performing partial search using _ArraySearch ; this gives $Rajni_Instances a zerobased array ;_ArrayDisplay($Rajni_Instances);used this line to see the progress $No_Of_Rajni_Instances = UBound($Rajni_Instances) Return $No_Of_Rajni_Instances EndFunc _HotKeyAssign($VK_F9,'dynamicrajnifunctionlistener') _HotKeyAssign($VK_F10,'routingsensor',0,"PuTTY") _HotKeyAssign($VK_F11,'sendcomment',0,"[CLASS:PuTTY]") _HotKeyAssign($VK_F12,'image',0,"[CLASS:PuTTY]") While 1 Sleep(10) WEnd Func dynamicrajnifunctionlistener() ;MsgBox(0,"Success Function Listener","I'm Listening") Run(@DesktopDir&"\TREnD_Apps_Rajni\Rajni_Setup_Files\Rajni_Dynamic_Function_Listener.exe") EndFunc Func routingsensor() ;MsgBox(0,"Success Routing Sensor","I'm Listening") Run(@DesktopDir&"\TREnD_Apps_Rajni\Rajni_Setup_Files\Rajni_Routing_Sensor.exe") EndFunc Func sendcomment() ;MsgBox(0,"Success Send Comment","I'm Listening") Run(@DesktopDir&"\TREnD_Apps_Rajni\Rajni_Setup_Files\Rajni_Send_Comment.exe") EndFunc Func image() ;MsgBox(0,"Success Image","I'm Listening") Run(@DesktopDir&"\TREnD_Apps_Rajni\Rajni_Setup_Files\Rajni_Copy_ImageID.exe") EndFunc Func MyExit() Exit EndFunc
Zedna Posted November 25, 2010 Posted November 25, 2010 You may look at this FAQ http://www.autoitscript.com/wiki/FAQ#Why_doesn.27t_my_script_work_on_a_locked_workstation.3F But I see no problematic code in your script ... Resources UDF ResourcesEx UDF AutoIt Forum Search
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