Jump to content

How to "lock" scite window, so script can't write to it?


xuzo
 Share

Recommended Posts

Sometimes I have some scripts that are running, for example, some send Keys on a notepad++ window, like {alt} and keystrokes.

If the notepad++ window closes for a variety of reasons...

The script keeps running on the the Scite window and destroys all the code ;(

Is there a way to "Lock" the scite window during F5 , so that no code can be written to it?

Link to comment
Share on other sites

  • Developers

To answer the base question: When you have the full SciTE4AutoIt3 version installed you could also use:

#AutoIt3Wrapper_Run_SciTE_Minimized=            ;(Y/N) Minimize SciTE while script is running. Default=N

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

This solution works pretty good:

#AutoIt3Wrapper_Run_SciTE_Minimized=Y

Is it 100% safe? Absolutely NO keystroke can re-maximize and cause havoc?

The read only option works pretty good, but it's tedious to click it on and off all the time.

"Alt+O+R" works , but not efficient, is there a way to toggle read only? A macro? Can I create a shortcut for that?

 

Link to comment
Share on other sites

The script is so save as you worked accurate. When you using MouseClick's in your Script with false coordinates maybe the Scite-window get's keystrokes. When using ControlSend with a wrong the Handle of the Scitewindow or when using Title to identify Window and the Scitewindow has the same title maybe something is going wrong.

Everything what happens is initiated by your code and when he is bugy then find the bugs and fix them.

A little Tip, send only KeyStroke, Museclicks when the Application you want to automate is the active Window.

If WinActive($hwndGame) Then ...

 

Edited by AutoBert
Link to comment
Share on other sites

I'd avoid using Send unless there's absolutely no other way to do something. Send is an extremely unreliable method of automating a program, ControlSend, ControlCommand, and ControlClick are much more reliable.

As you've described, your problem is showing how unreliable Send is, don't use it if you don't have to.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

My script example has no "send" commands at all.

The script is NOT stopping with "Ctrl+break", regardless what I try.

I need to be able to stop the script when something goes wrong, I don't want it to run like a fully compiled .exe on every run.

I want it to stop, force stop, like CTRL+Alt+DEL

Stop on the Scite window, stop everywhere, just STOP ;)

Edited by xuzo
Link to comment
Share on other sites

My script example has no "send" commands at all.

In this thread there ins't a example script! But did you know what you postet Tuesday?

Sometimes I have some scripts that are running, for example, some send Keys on a notepad++ window, like {alt} and keystrokes.

If the notepad++ window closes for a variety of reasons...

The script keeps running on the the Scite window and destroys all the code ;(

and the answer to stop your nonsence script in:is given in this thread.

Btw.: it can't be a real reproducer from your problem script.

So it's  wasted time to try to help you until you show a real reproducer or your original script.

Also possible solution's are already given:

 

A little Tip, send only KeyStroke, Museclicks when the Application you want to automate is the active Window.

If WinActive($hwndGame) Then ...

 

I'd avoid using Send unless there's absolutely no other way to do something. Send is an extremely unreliable method of automating a program, ControlSend, ControlCommand, and ControlClick are much more reliable.

As you've described, your problem is showing how unreliable Send is, don't use it if you don't have to.

you just have to do what your are advised!

 

Link to comment
Share on other sites

  • Developers

This solution works pretty good:

#AutoIt3Wrapper_Run_SciTE_Minimized=Y

Is it 100% safe? Absolutely NO keystroke can re-maximize and cause havoc?

The read only option works pretty good, but it's tedious to click it on and off all the time.

"Alt+O+R" works , but not efficient, is there a way to toggle read only? A macro? Can I create a shortcut for that?

 

NO ... you need to take care of that by writing a smart script. ;)

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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