Achilles Posted May 4, 2010 Share Posted May 4, 2010 I figured out (at least one way) how to open a script in scite by using ShellExecute. Now I just want to make it so that scite doesn't take focus. Any ideas? #include <File.au3> _FileCreate(@DesktopDir & '\test.au3') Run('notepad.exe') ; activate another window Sleep(1000) ShellExecute(@DesktopDir & '\test.au3', '', @DesktopDir, 'edit', @SW_SHOWNA) My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
somdcomputerguy Posted May 4, 2010 Share Posted May 4, 2010 I don't know if one can prevent an app from taking focus when it's started, but focus can be 'given back' to what had it first. Like this maybe? #include <File.au3> _FileCreate(@DesktopDir & '\test.au3') Run('notepad.exe') ; activate another window Sleep(1000) $title = WinGetTitle("[active]") ShellExecute(@DesktopDir & '\test.au3', '', @DesktopDir, 'edit', @SW_SHOWNA) WinActivate($title) - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
Achilles Posted May 4, 2010 Author Share Posted May 4, 2010 I don't know if one can prevent an app from taking focus when it's started, but focus can be 'given back' to what had it first. Like this maybe? #include <File.au3> _FileCreate(@DesktopDir & '\test.au3') Run('notepad.exe') ; activate another window Sleep(1000) $title = WinGetTitle("[active]") ShellExecute(@DesktopDir & '\test.au3', '', @DesktopDir, 'edit', @SW_SHOWNA) WinActivate($title) That was my less preferred second option... I wonder if there's some scite command line parameter... I'll try searching that My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
somdcomputerguy Posted May 4, 2010 Share Posted May 4, 2010 Perhaps if an app is started hidden or minimized it doesn't take focus? - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change. Link to comment Share on other sites More sharing options...
Achilles Posted May 4, 2010 Author Share Posted May 4, 2010 Perhaps if an app is started hidden or minimized it doesn't take focus?Hmm, that doesn't help me much because the program I'm writing is designed to run when scite is already up and running...I found this... I don't understand the part about "Command Subsystem".. but it looks like something in there might help. My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
Achilles Posted May 4, 2010 Author Share Posted May 4, 2010 (edited) Here's a try using run instead of shell execute... Still no luck though. Maybe one you will see what I'm missing here... #include <File.au3> Global Const $SCITE_PATH = RegRead('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\SciTE.exe', '') _FileCreate(@DesktopDir & '\test.au3') Run('notepad.exe') ; activate another window Sleep(1000) Run($SCITE_PATH & ' -open:test.au3', @DesktopDir, @SW_SHOWNOACTIVATE) Edited May 4, 2010 by Achilles My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] 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