什么意思?试试这个registerserviceprocess函数
解决方案 »
- 数据库远程连接怎样读取远程地址及密码CnNew.ConnectionString = "?
- microsoft common dialog control 6.0控件在那里?
- ActiveReprot小问
- 想要用ASC码实现一个回车,该怎么写啊?
- 如何判断事务处理已经开始?
- 关于附件的下载,100分在线等待!!!!!!!!!
- 如何给菜单添加菜单编辑器中没有的快捷键?
- 一个关于日期的显示问题
- 关于acmStreamOpen的错误,恳请高手指教。
- !!help!!怎样在程序中添加快速显示窗体?
- jinesc兄弟,只有你能帮我了!
- 如何在VB中实现SQL SERVER 中的Backup Database操作
API声明
Public Declare Function GetCurrentProcessId Lib "kernel32" () As Long
Public Declare Function RegisterServiceProcess Lib "kernel32" (ByVal dwProcessID As Long, ByVal dwType As Long) As Long
在form_load中加入
Dim pid As Long
Dim reserv As Long
pid = GetCurrentProcessId()
reserv = RegisterServiceProcess(pid, 1)
注册服务器程序实现隐藏
在Form_QueryUnload中加入
Dim pid As Long
Dim reserv As Long
pid = GetCurrentProcessId()
reserv = RegisterServiceProcess(pid, 0)
注销服务器程序
搞定!!