AutoNL Posted January 12, 2016 Share Posted January 12, 2016 Hello,I'm trying to to the following $iPID = Run(@ProgramFilesDir & '\Mozilla Firefox\firefox.exe "http://google.com"', '', @SW_SHOWNOACTIVATE) or even $iPID = Run(@ProgramFilesDir & '\Mozilla Firefox\firefox.exe "http://google.com"', '', @SW_MINIMIZE) But Firefox still takes over the focus. Actually I'd like to open Firefox without changing focus. So if user is typing mail in Outlook he can go on with it Is it a correct approach? Link to comment Share on other sites More sharing options...
MilesAhead Posted January 12, 2016 Share Posted January 12, 2016 (edited) I think adding the url on the command line FF is going to open it and get the keyboard focus. I would try @SW_HIDDEN. If that works then you can figure out how to call show on it later. Perhaps using the Firefox window class name or something similar.Edit: if @SW_HIDDEN does not produce the desired effect you could save the window handle of the active window, run FF and do a wait for the window to exist. As soon as it exists try to hide it, or if that fails as soon as it is active, return the focus to the window that was active. If it happens quick enough you might not see any flicker. Just have to go at it trial and error. Edited January 12, 2016 by MilesAhead My Freeware Page Link to comment Share on other sites More sharing options...
AutoNL Posted January 13, 2016 Author Share Posted January 13, 2016 (edited) Thnak you.I hoped for a better solution. But this is acceptable in my case: $handle = WinGetHandle("") $iPID = Run(@ProgramFilesDir & '\Mozilla Firefox\firefox.exe "http://google.com"', '', @SW_SHOWNOACTIVATE) WinActivate (HWnd($handle)) Edited January 13, 2016 by AutoNL 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