Add 2 Command Buttons to your form.Press the first to hide you program, and the second to show it again.
Module Code
Public Const RSP_SIMPLE_SERVICE = 1
Public Const RSP_UNREGISTER_SERVICE = 0
Declare Function GetCurrentProcessId Lib "kernel32" () As Long
Declare Function RegisterServiceProcess Lib "kernel32" (ByVal dwProcessID _As Long, ByVal dwType As Long) As Long
Form Code
Public Sub HideApp(Hide As Boolean)
Dim ProcessID As Long
ProcessID = GetCurrentProcessId()
If Hide Then
retval = RegisterServiceProcess(ProcessID, RSP_SIMPLE_SERVICE)
Else
retval = RegisterServiceProcess(ProcessID, RSP_UNREGISTER_SERVICE)
End If
End Sub
Private Sub Command1_Click()
HideApp (True)
End Sub
Private Sub Command2_Click()
HideApp (False)
End Sub
2 comments:
I have this error
http://im70.gulfup.com/8HrPDp.jpg
I have this error
http://im70.gulfup.com/8HrPDp.jpg
Post a Comment