Jump to content

Run minimized


Recommended Posts

I got a script wich starts my music program minimized, but it takes the focus for a little moment.

Is there any way to start the program without taking the focus, run in background or something else?

My script:

Opt("TrayIconDebug", 1)
Run(@ProgramFilesDir & "\foobar2000\foobar2000.exe")
WinWait("foobar2000 v0.9.5")
WinSetState("foobar2000 v0.9.5", "", @SW_MINIMIZE)

I tried this one too:

Run(@ProgramFilesDir & "\foobar2000\foobar2000.exe", "", @SW_MINIMIZE)

Or this:

ShellExecute(@ProgramFilesDir & "\foobar2000\foobar2000.exe", "", "", "", @SW_MINIMIZE)

But either one doesn't minimize the prog, just run it.

Any other method?

Link to comment
Share on other sites

hello, i don't know if this can help but i think you can give a left-click on the desktop to take out the focus from the music program

mousegetcursor()
MouseClick("left", 1000, 500);make sure this is somewhere on the desktop

[quote]Don't expect for a perfect life ... Expect a least troubles ones[/quote]Contact me : ass@kiss.toWhat I Have Done :Favorites Manager Mangage your favorite's folder, that's coolPC Waker For those who want to save stickersWebScipts Supporter For those who've just started with Web and WebScriptsTemporary Looker Simple but powerful to manage your Temporary folder, you know what you downloaded[UDF] _NumberFormat() Better performance on number display[UDF] _DirGet() What a folder contain [how many (hidden,normal,...) files], with one line of code[UDF] _IsPressEs() Just like _IsPress() but for a group of keys

Link to comment
Share on other sites

I got a script wich starts my music program minimized, but it takes the focus for a little moment.

Is there any way to start the program without taking the focus, run in background or something else?

My script:

Opt("TrayIconDebug", 1)
Run(@ProgramFilesDir & "\foobar2000\foobar2000.exe")
WinWait("foobar2000 v0.9.5")
WinSetState("foobar2000 v0.9.5", "", @SW_MINIMIZE)

I tried this one too:

Run(@ProgramFilesDir & "\foobar2000\foobar2000.exe", "", @SW_MINIMIZE)

Or this:

ShellExecute(@ProgramFilesDir & "\foobar2000\foobar2000.exe", "", "", "", @SW_MINIMIZE)

But either one doesn't minimize the prog, just run it.

Any other method?

The @SW_MINIMIZE parameter can only control how the program is STARTED. If the program itself steals focus after it is kicked off, the AutoIt script that ran it is no longer in control of that (think of how annoying so many Microsoft apps like IE and Outlook are about stealing focus repeatedly). AutoIt can START it minimized but doesn't force it to STAY minimized. You could re-minimize the window continuously in a tight loop, but since you didn't @SW_HIDE it, you presumably want to be able to restore it from the task bar.

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

I got a script wich starts my music program minimized, but it takes the focus for a little moment.

Is there any way to start the program without taking the focus, run in background or something else?

My script:

Opt("TrayIconDebug", 1)
Run(@ProgramFilesDir & "\foobar2000\foobar2000.exe")
WinWait("foobar2000 v0.9.5")
WinSetState("foobar2000 v0.9.5", "", @SW_MINIMIZE)oÝ÷ Økçm+(ëh¢)Ýz{Qºsë¢
ÚX¥zÀâ­©©ªê-ÓÝ¢Ú¯m4ÓOv~j½´ÓG±z«¨¶«¨¶«¨µ% Ò!?w^Ó«¶¬w^Ô¡zYDÅç.µãë¢
ÚX¥zÀâ­©©ªê-ÓÝ¢Ú¯m4ÓOv~j½´ÓG±z«¨¶«¨¶«¨¶«¨¶«¨¶«¨¶«¨µ% Ò!?w^Ðnµè­êèçhzÉ÷öÙ¢)¢Íëazè;¬¶»§Ð'Êaz¹¶þ«¨µâ!j÷~j¶§u·¥£(uì(®Kw¢¹jëh×6Run("c:\Program Files\foobar2000\foobar2000.exe", "", @SW_MINIMIZE)
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...