Jump to content

Recommended Posts

Posted

When I use ShellExecute to run a program hidden, it always takes focus away from the current application. Is there anyway around this? Thank you very much.

Posted (edited)

You could run:

$windows = WinList() ;Get list of windows

ShellExecute(...)

WinActivate([$windows[1][0]) ;Activate the first window in the list

May or may not work, but worth a shot anyway...

Edited by MrMitchell
Posted
Posted

Actually, take a look here: http://msdn.microsoft.com/en-us/library/bb762153(VS.85).aspx

I guess the AutoIt ShellExecute simply calls the underlying Windows API. In which case, you can use 7 as the last parameter for SW_SHOWMINNOACTIVE. Then I guess you'd need to find the window and hide it. Try it:

ShellExecute("notepad.exe", "", "", "", 7)

WBD

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
×
×
  • Create New...