Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to stop a execution of one C++ program by clicking on a tk-button?

Status
Not open for further replies.

Boudjema

Programmer
Mar 7, 2002
4
CH
I develop a program linking C++ and Tcl/Tk and i have a problem with a Tk command. My problem is to stop the execution of one program by clicking on a tk_button. I run the program (in C++) by clicking in a button "Run". While the program is running, i can't use the mouse for clicking any where else. Then,i can't stop the execution. I have created a button "CancelExecution" but i couldn't use it . I try to use "Tk_CreateEventHandler", but i don't understand how it works. ( Tk_CreateEventHandler (Tk_Window,unsigned long mask,Tk_EventProc, ClientData)) Maybe there is orthers solutions? Best regards Thanks
 
If you're running on UNIX, you can &quot;exec ps -ef|grep <program name>&quot; and capture the PID. Then &quot;exec kill -9 $PID&quot; or something like that. I don't know what to do on Windows. Bob Rashkin
rrashkin@csc.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top