Jump to content

interrupt a third party software


ReDFlaG
 Share

Recommended Posts

hello,

i launch a third party software via a button in a form

$pid = Run(@ScriptDir &'\stuff.exe, '', @SW_HIDE, $STDERR_CHILD )
     While 1
        $temp &= StderrRead($pid)
        If @error Then ExitLoop
     Wend
oÝ÷ ÚØb²è+-jH§Ê&zئzÊ"¦ëZaz¶î¶Ú'{h¶¢¹¬¢ØZ¶'é­ë,yØ­²Ú)²Ø^¦º ëb¶ÇÉè¶Ú0¢¹yÆ®±ç¯zx޲ȭÛzk-«b«Þm¶ªºajwjºb¶¼vÚ%£«¶©®*+ܨ~Ø^¦ºz˺Ú"µÍØÙÜÔÙ][Ü]H
    ][ÝÜÝY^I][ÝËJB

but it's not working.

Can someone help?

Thanks. ;)

Link to comment
Share on other sites

My bad, it was bad copy/past. :lmao:

But the issue is still the same: how to kill the processe (via a button in the GUI) while the process is still running and you are executing the loop? (it seems that i can't do anything while the prog is reading the stderr).

By the way, your loop is nicer than the one i was using, i'll use yours now, thanks! ;)

Link to comment
Share on other sites

  • Moderators

Spawn it using /AutoIt3ExecuteScript, keep track of the PID, and if it doesn't do what you want when you want, you can kill it in your GUI as you choose.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

As SmOke_N suggests or use the peek flag of StderrRead.

If StderrRead is called with a third argument other than zero, StderrRead will "peek at" the stream rather than actually reading from it, and return the characters that could be read from the stream. When run as a "peek" StderrRead always returns immediately. Note that any characters are still present on the stream after a peek and will be returned on the next read operation.

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