wickyd Posted January 18, 2009 Posted January 18, 2009 Hi folx I m running a program called TrayIt which allows me to send programs to the systray once minimized. I created a script, which runs on startup, to load TrayIt followed by Google Chrome. My problem is, I do not know how to minimize Chrome via the Run command. This loads Chrome, but the window is maximized: Run("C:\Program Files\Google\Chrome\Application\chrome.exe", "C:\Program Files\Google\Chrome\Application", @SW_MINIMIZE) I also tried running a shortcut, but Autoit seems to ignore .lnk files: Run("D:\Startup\Chrome.lnk") The next step is: WinSetState ( "title", "text", flag ) but Chrome doesn't seem to have a "title", nor "text". How do I solve this problem? Thank you. Regards, wickyd
Hawkwing Posted January 18, 2009 Posted January 18, 2009 I just got google chrome and when I use Autoit Window Info, it says that the title is "New Tab - Google Chrome". try this: WinSetState ("New Tab - Google Chrome", "", @SW_MINIMIZE) The Wheel of Time turns, and Ages come and pass, leaving memories that become legend. Legend fades to myth, and even myth is long forgotten when the Age that gave it birth comes again.
torels Posted January 18, 2009 Posted January 18, 2009 use the class infochrome's class is "Chrome_XPFrame" but I guess that if you have vista you will get something like "Chrome_VistaFrame" but I don't knowmaybe using regular expressions the issue can be solved Some Projects:[list][*]ZIP UDF using no external files[*]iPod Music Transfer [*]iTunes UDF - fully integrate iTunes with au3[*]iTunes info (taskbar player hover)[*]Instant Run - run scripts without saving them before :)[*]Get Tube - YouTube Downloader[*]Lyric Finder 2 - Find Lyrics to any of your song[*]DeskBox - A Desktop Extension Tool[/list]indifference will ruin the world, but in the end... WHO CARES :P---------------http://torels.altervista.org
wickyd Posted January 18, 2009 Author Posted January 18, 2009 @Pain: Thank you for pointing me to this. This however did not work: ShellExecute("Chrome.lnk", "", "D:\Startup\", "", @SW_MINIMIZE) @pigeek: Thank you so much! I am new to AutoIt and was not aware of the Window Info tool. Your method has worked. I realise now that I could have just looked at the taskbar to see the title of the window Here is the code that works: Run("C:\Program Files\Google\Chrome\Application\chrome.exe", "C:\Program Files\Google\Chrome\Application") WinWait("New Tab - Google Chrome", "") WinSetState ("New Tab - Google Chrome", "", @SW_MINIMIZE) @torels: Thank you for showing me another possibility.
Hawkwing Posted January 18, 2009 Posted January 18, 2009 Happy to help. The Wheel of Time turns, and Ages come and pass, leaving memories that become legend. Legend fades to myth, and even myth is long forgotten when the Age that gave it birth comes again.
wickyd Posted January 19, 2009 Author Posted January 19, 2009 For completeness, I have been testing this with logging off and on again and I noticed some strange behaviour. This code works consistently: Run("C:\Program Files\TrayIT\TrayIt!.exe") Run("C:\Program Files\Google\Chrome\Application\chrome.exe", "C:\Program Files\Google\Chrome\Application") WinWait("New Tab - Google Chrome", "") WinSetState ("New Tab - Google Chrome", "", @SW_MAXIMIZE) WinSetState ("New Tab - Google Chrome", "", @SW_MINIMIZE)
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