Sign in to follow this  
Followers 0
wickyd

How to start Google Chrome minimized

7 posts in this topic

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

Share this post


Link to post
Share on other sites



ShellExecute?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

use the class info

chrome's class is "Chrome_XPFrame" but I guess that if you have vista you will get something like "Chrome_VistaFrame" but I don't know

maybe 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

Share this post


Link to post
Share on other sites

@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.

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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)

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0