Jump to content

Having Script Pause When Window Is Minimized


Recommended Posts

Alright, I like to know if there are any coding to possible pause a script by minimizing a window. I already have function capabilities to pause the script by button, but i would like another function to pause the script by having a window minimized. Also, i was wondering what function do i use to pop up a titleless small window upon the autoit3 icon in the taskbar that can have text on it. Anyways, thanks for reading this post and consideration of solving this problem.

Link to comment
Share on other sites

  • Developers

do you mean that you want to have a script go into pause when another window is minimized?

something like:

AutoItSetOption("WinTitleMatchMode", 2) 
HotKeySet("{END}","Finish")
While 1
   while BitAnd(WinGetState("- Notepad",""),16) 
      sleep(100)
      SplashTextOn("pausing","pausing",100,50,10,10)
   Wend
   SplashOff()
  ; do your other stuf
Wend

Func Finish()
   exit
Endfunc

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

do you mean that you want to have a script go into pause when another window is minimized?

something like:

AutoItSetOption("WinTitleMatchMode", 2) 
HotKeySet("{END}","Finish")
While 1
   while BitAnd(WinGetState("- Notepad",""),16) 
      sleep(100)
      SplashTextOn("pausing","pausing",100,50,10,10)
   Wend
   SplashOff()
  ; do your other stuf
Wend

Func Finish()
   exit
Endfunc
:whistle: hmm... im not exactly 100% sure what you just said, but from my interpetations i believe your asking if i want the script to pause if another meaning a second window is minimized; is that right? If so no. All i want is some kind of coding that can pause the script if a window is minimized. For example, say that i have notepad running and is maximized/active, and while maximized/active the script is going with different kinds of functions. However, when i minimize notepad the script stops and splashes up a msgbox saying if you want to exit the bot or return back to the script. As for your script u posted it looks quite interesting and may do the job im not sure because i never worked with functions BitAnd or AutoItSetOption. So knowing that i cannot draw up the conclusion of what ur script does. Anyways, thanks for your reply and please respond back B) .
Link to comment
Share on other sites

  • Developers

that's what the example script does.... :whistle:

start Notepad and run the script... you will see that a box pop's up when you minimize Notepad.....

In this case the "END" key will stop the script.

Edited by JdeB

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

  • Developers

all i need help now is how to make a message box with words and etc.. appear above the autoit 3 icon on the taskbar.

This the command to show the balloon above the systemtray icon:

TrayTip ( "title", "text", timeout [, option] )

Edited by JdeB

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

all i need help now is how to make a message box with words and etc.. appear above the autoit 3 icon on the taskbar.

If I understood that correctly, then I think you should check out either

TrayTip or ToolTip...

EDIT :

After writing this, I saw that JdeB had been writing something too..

PS !

If you use TrayTip you have to know that the TrayTip can be disabled

by the Windows-user, but if you use ToolTip then that's not a problem..

I think..

Edited by Helge
Link to comment
Share on other sites

How do u use tooltip? and for tray tip what is [option] and timeout? Can you give an example of something?

edited- Ah one more thing about the window minimize coding that you gave. I have a problem with it because as you know this coding only works if it is ran by at the moment u want it paused, but the thing is the script im using is so big that it will take about a good 2 mins before the script gets the function described above. Anyways, i wanted a script that can be effective for the whole time its running and dont have to be repeated more then once kind of like how the adlib function with hotkey function does with pausing by button. Keep in mind that my script contains over 2000 lines.

Edited by globster2000
Link to comment
Share on other sites

  • Developers

You can do the testing with the AdlibEnable so it will do the test every 250 ms (or the time you set it)

AutoItSetOption("WinTitleMatchMode", 2) 
HotKeySet("{END}","Finish")
AdlibEnable ( "TestMin")

While 1
  ; do your other stuff
Wend

Func Finish()
   exit
Endfunc

Func TestMin()
   while BitAnd(WinGetState("- Notepad",""),16) 
      sleep(100)
      SplashTextOn("pausing","pausing",100,50,10,10)
   Wend
   SplashOff()
Endfunc

Cut&Paste from the helpfile:

ToolTip:

Creates a tooltip anywhere on the screen. ToolTip ( "text" [, x, y] )

TrayTip ( "title", "text", timeout [, option] )

timeout: A rough estimate of the time the balloon tip should be displayed. (Windows has a min and max of about 10-30 seconds but does not always honor a time in that range.)

option: [optional] 0=No icon (default), 1=Info icon, 2=Warning icon, 3=Error icon

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

Ok Thanks very much it seems that its working now =D. Oh yea one more thing is it possible for Autoit 3 to access a website or something and gather info, and how do you have autoit 3 read time from one given point to another? Kind of like a stopwatch.

Edited by globster2000
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...