C# 如何用按钮来结束程序运行.

nuliqianjing 2007-12-27 07:12:17
程序界面有两个按钮,当点击按钮run时程序开始运行,但不会停下来.这时需要点击EXIT 按钮来结束程序.但这时的EXIT 是不可用的,有那位高人给指点指点.万分感谢!
...全文
104 点赞 收藏 5
写回复
5 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
shulei521 2007-12-29
顶呀顶呀顶呀顶
回复
TopKernel 2007-12-29
TerminateProcess

The TerminateProcess function terminates the specified process and all of its threads.


BOOL TerminateProcess(
HANDLE hProcess,
UINT uExitCode
);

Parameters
hProcess
[in] Handle to the process to terminate.
Windows NT/2000/XP: The handle must have the PROCESS_TERMINATE access right. For more information, see Process Security and Access Rights.

uExitCode
[in] Exit code to be used by the process and threads terminated as a result of this call. Use the GetExitCodeProcess function to retrieve a process's exit value. Use the GetExitCodeThread function to retrieve a thread's exit value.
回复
csdn5211 2007-12-29
自己加个按钮写个退出函数就得了呗。
回复
vrace 2007-12-29
请使用多线程
回复
Treazy 2007-12-27
发错地方了吧~~~
回复
发动态
发帖子
工具平台和程序库
创建于2007-09-28

2.4w+

社区成员

C/C++ 工具平台和程序库
申请成为版主
社区公告
暂无公告