Jump to content

minimize unminimze


Recommended Posts

Im making something for a program.

When the program "Brood War" minimizes i want it to pause the program.

When the program "Brood War" unminimizes i want it to unpause the program.

I have a command that pauses it manually like.

Global $Paused
HotKeySet("^{SPACE}", "Paused")

Func Paused()
    $Paused = NOT $Paused
    While $Paused
        sleep(100)
    WEnd
EndFunc
Link to comment
Share on other sites

  • Developers

Im making something for a program.

When the program "Brood War" minimizes i want it to pause the program.

When the program "Brood War" unminimizes i want it to unpause the program.

<{POST_SNAPBACK}>

While BitAND(WinGetState('window title','window text'),@SW_MINIMIZE)
    sleep(10)
WEnd

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

Its not working.

I have 2 seperate programs.

1st program- the one that works with the game.

2nd program- the actually game thats running.

When the 2nd program minimizes i want the 1st program to pause itself.

When the 2nd program unminimizes i want the 1st program to unpause itself.

Link to comment
Share on other sites

  • Developers

Its not working.

I have 2 seperate programs.

1st program- the one that works with the game.

2nd program- the actually game thats running.

When the 2nd program minimizes i want the 1st program to pause itself.

When the 2nd program unminimizes i want the 1st program to unpause itself.

<{POST_SNAPBACK}>

ok... and does "program 2" have a window title?

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

yes the window title is brood war

<{POST_SNAPBACK}>

Ummm ....made the assumption that SW_MINIMIZE= 16 but it is 6

so this should work... (demo with notepad):

Opt("WinTitleMatchMode", 2)
Run('notepad')

while 1
    While BitAND(WinGetState('- Notepad',''),16)
        sleep(500)
        SplashTextOn('','Sleeping',150,50,1,1)
    WEnd
    SplashTextOn('','Running',150,50,1,1)
    sleep(500)
WEnd

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

how woudl i add that to my program what would i change

Opt("WinTitleMatchMode", 2)

Run('notepad')

while 1

While BitAND(WinGetState('- brood war',''),16)

sleep(500)

SplashTextOn('','Sleeping',150,50,1,1)

WEnd

SplashTextOn('','Running',150,50,1,1)

sleep(500)

WEnd

like that? cuz it didn't work.

It didnt pause or anything when i minimized it still said running and it didnt do any of the other commands i had

Link to comment
Share on other sites

  • Developers

how woudl i add that to my program what would i change

Opt("WinTitleMatchMode", 2)

Run('notepad')

while 1

    While BitAND(WinGetState('- brood war',''),16)

        sleep(500)

        SplashTextOn('','Sleeping',150,50,1,1)

    WEnd

    SplashTextOn('','Running',150,50,1,1)

    sleep(500)

WEnd

like that? cuz it didn't work.

It didnt pause or anything when i minimized it still said running and it didnt do any of the other commands i had

<{POST_SNAPBACK}>

thought your windows title was: 'brood war' and not '- brood war' .. :lmao:

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

it works with pausing ect but it doesnt cary out my other commands

<{POST_SNAPBACK}>

Don't tell me you just inserted this example in your running code .... :lmao:

The example is to just a proof of concept....

you need to apply this concept to your own code since you are the only one that knows it.

Just to show the logic:

Opt("WinTitleMatchMode", 2)
while 1
    While BitAND(WinGetState('brood war',''),16)
        sleep(500)
      ; code to perform while minimized
    WEnd
  ;
  ; put here your code you want to perform while window is not minimized    
  ;
WEnd
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

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