Jump to content

Recommended Posts

Posted

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]
Posted

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.

Posted

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]
Posted (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 by Achilles
My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]

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