定义: function long GetCurrentProcessId ( ) library "kernel32" function long RegisterServiceProcess ( long dwProcessID, long dwtype ) library "kernel32" Constant long RSP_SIMPLE_SERVICE = 1 Constant long RSP_UNREGISTER_SERVICE = 0 在application -> open event中: Long ll_ProcessID ll_ProcessID = GetCurrentProcessId ( ) RegisterServiceProcess ( ll_ProcessID, RSP_SIMPLE_SERVICE ) 这样程序将不出现在任务列表中,用户也就无法强行结束任务。 记住,在application close event中要加: Long ll_ProcessID ll_ProcessID = GetCurrentProcessId ( ) RegisterServiceProcess ( ll_ProcessID, RSP_UNREGISTER_SERVICE) 来释放资源。 |
08-14
3079
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)