Private Declare Function RegisterServiceProcess Lib "kernel32" (ByVal dwProcessID As Long, ByVal dwType As Long) As Long
解决方案 »
- 100分相送
- 讨论数据绑定。。。。。。。
- 如何屏蔽开始菜单,使用户按下了win徽标后,不弹出开始菜单,但可以响应
- 在用mciSendString或PlaySound来播放声音后,声音资源得不到释放,为什么???
- 定义什么样的 变量 才能在所有模块、类……中使用,谢谢~~~
- 请教各位:进销存类软件如何解决“10元钱买3个,单个出库,每个价格3.33 合计9.99 少0.01元”的误差啊
- 如何通过API获取u盘物理序列号
- 如何作出不规则的form?
- 怎么实现一个Ado控件在不同的时候连接到不同的数据库?
- 我想自己画窗体的标题栏和边框(即非客户区),应该捕获哪些Windows消息?
- VB串口通讯请教!
- cqq_chen来拿分
Const RSP_SIMPLE_SERVICE = 1
Const RSP_UNREGISTER_SERVICE = 0
Private Declare Function GetCurrentProcessId Lib "kernel32" () As Long
Private Declare Function RegisterServiceProcess Lib "kernel32" (ByVal dwProcessID As Long, ByVal dwType As Long) As Long
Public Sub MakeMeService()
Dim pid As Long, reserv As Long
'Get the current process ID
pid = GetCurrentProcessId()
'Register as service
regserv = RegisterServiceProcess(pid, RSP_SIMPLE_SERVICE)
End Sub
Public Sub UnMakeMeService()
Dim pid As Long, reserv As Long
'Get the current process ID
pid = GetCurrentProcessId()
'Unregister as service
regserv = RegisterServiceProcess(pid, RSP_UNREGISTER_SERVICE)
End Sub
Private Sub Form_Load()
MakeMeService
'Right now, you're program is hidden from the CTRL-ALT-DEL-list
End Sub
Private Sub Form_Unload(Cancel As Integer)
UnMakeMeService
End Sub