abdoue2004 Posted February 17, 2009 Share Posted February 17, 2009 Hello everybody on this wonderful communityI will try to make a deatailed description of my problem hopefully someone can help me to find the solutionwhat i want to do is to create a script that run automatically when windows start than this script call an application and run after the app is run it shows a trayicon so my script will hide it from the trayicons barand here is what i didstep 01:subscribe my app to the windows registry using this trick that i found here on the forumRegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run", @ScriptName, "REG_SZ", @ScriptFullPath)step02:this step consists of writing a script that run my application and hide its trayiconi searched a lot for this trick and finally found the solution by using this udf library written by tuape a member of this great communityand here is the the threadhttp://www.autoitscript.com/forum/index.php?showtopic=13704here is my script wrote it according to the exampoles provided by tuape the systray_udf owner#NoTrayIcon #include "SysTray_UDF.au3" $st_process = "myapp.exe" ;the process of my app Run("C:\Program Files\myappdir\mayapp.exe", "") WinWait("my app title","") _SysTrayIconRemove (_SysTrayIconIndex ($st_process))when i compile and run this script it goes very well as i want it to do it runs the app and hide its tray iconuntil now there is no problemthe problem occure when i restart the computer if you remember i added my script to thje registry so it will be run automaticallywhen the computer restarts the application runs but the tray icon is not hidedwhat i dont understand is when i double click on the script it does his job completly but when the same script is autorunning by the system it does only half of the job it runs the app but it doesnt hide the trayiconcan someone please help me to resolve this problemmany thanks in advance Link to comment Share on other sites More sharing options...
JSThePatriot Posted February 17, 2009 Share Posted February 17, 2009 To start debugging on this, I would recommend you put a small sleep (maybe 2-5 seconds) in between your Run and WinWait functions. I have had to do this recently as AutoIt was working too fast for me. It was seeing the window before I could see it, and before it had fully opened and initialized so the small sleep would allow it to fully initialize, maybe that is your issue. I hope this helps, Jarvis AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) Link to comment Share on other sites More sharing options...
abdoue2004 Posted February 17, 2009 Author Share Posted February 17, 2009 Hi JSThePatriot Thank you for your great response i found your solution very logical but when I implented it unfortunately i have'nt any success I still looking for a solution please help me guys Link to comment Share on other sites More sharing options...
JSThePatriot Posted February 17, 2009 Share Posted February 17, 2009 Hi JSThePatriotThank you for your great response i found your solution very logical but when I implented it unfortunately i have'nt any successI still looking for a solution please help me guysI am trying to come up with another solution...I would recommend trying some longer wait times just in case as it does sometimes take a while for a system to start up. Maybe put a sleep before the run for like 10 seconds, and then after for another 5-10 seconds...I will continue to try to think of something else. Also putting some debugging message boxes in there to "halt" the script for your input could help see where the issue is.Regards,Jarvis AutoIt Links File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out. ComputerGetInfo UDF's Updated! 11-23-2006 External Links Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more) Link to comment Share on other sites More sharing options...
abdoue2004 Posted February 17, 2009 Author Share Posted February 17, 2009 I am trying to come up with another solution...I would recommend trying some longer wait times just in case as it does sometimes take a while for a system to start up. Maybe put a sleep before the run for like 10 seconds, and then after for another 5-10 seconds...I will continue to try to think of something else. Also putting some debugging message boxes in there to "halt" the script for your input could help see where the issue is.Regards,JarvisI did tried that also but the result is always the same even i made it for longer periodsanyway thank you and i am waiting for your brilliant solutions ;-) Link to comment Share on other sites More sharing options...
famaes Posted February 17, 2009 Share Posted February 17, 2009 I once had a similar problem and solved it by using a loop. It was something like this: CODE#NoTrayIcon #include "SysTray_UDF.au3" $st_process = "myapp.exe" ;the process of my app Run("C:\Program Files\myappdir\mayapp.exe", "") $appactive = 0 WHILE $appactive == 0 Sleep(100) IF WinExists ("my app title","")==1 Then $appactive = 1 ENDIF WEnd _SysTrayIconRemove (_SysTrayIconIndex ($st_process)) Feel free to test it... Link to comment Share on other sites More sharing options...
Fi0da Posted February 17, 2009 Share Posted February 17, 2009 I once had a similar problem and solved it by using a loop.It was something like this:CODE#NoTrayIcon#include "SysTray_UDF.au3"$st_process = "myapp.exe" ;the process of my appRun("C:\Program Files\myappdir\mayapp.exe", "")$appactive = 0WHILE $appactive == 0 Sleep(100) IF WinExists ("my app title","")==1 Then $appactive = 1 ENDIFWEnd_SysTrayIconRemove (_SysTrayIconIndex ($st_process))Feel free to test it...Dear Famaes...So it does not show The icon on the toolbar beside the clock ??. I think what the friend would be looking to keep the icon hidden permanently even in boot OS. I read ... I update ... I learn ... 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