Jump to content

Recommended Posts

Posted

Ok I have multiple exe's that I have created that all work together and I need to pause them all at the same time. I am using the Toggle Pause Function in each exe however they do not all pause at the same time when I hit pause break which I kinda figured would happen. Is it possible for me to perform like a process pause on these exe's. By the way all exe's are created with Autoit. I had all my code in one script but my if statements were taking too much time because I had them nested so I put them in their own exe

Thanks

Posted

Well, I don't see any necessity for it but you can at least consider it. You can create a process to process the pause hot-key and use PostMessage to the entire top-level windows in the system like:

#include <WinAPI.au3>
HotKeySet('{PAUSE}', 'Pause')
Global $fPause = False
$MyMsg = _WinAPI_RegisterWindowMessage('___MyMessage')

.
.
.

Func Pause()
    $fPause = Not $fPause
    If $fPause Then
        _WinAPI_PostMessage(0xFFFF, $MyMsg, True, 0)
    Else
        _WinAPI_PostMessage(0xFFF, $MyMsg, False, 0)
    EndIf
EndFunc

For each process you create, you can create invisible window and then use GUIRegisterMsg using this message string "$MyMsg = _WinAPI_RegisterWindowMessage('___MyMessage')". If $wParam = True then the process pause, otherwise it's resumed.

Posted

Ok yeah awesome thanks very much. I was also thinking about having each exe have a processwaitclose in it to check for another process that I could create from my script that is going to be doing the pausing. Lol, my brain is warped now. Thanks for the help.

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