|
|
|
|
|
Dicas
|
|
Visual Basic (Windows)
|
|
|
Título da Dica: Impedir que o programa seja encerrado com Ctrl+Alt+Del
|
|
|
|
Postada em 14/8/2000 por Webmaster
webmaster@vbweb.com.br
'Declara o seguinte em um Módulo:
Public Declare Function GetCurrentProcessId Lib _ "kernel32" () As Long Public Declare Function GetCurrentProcess Lib _ "kernel32" () As Long Public Declare Function RegisterServiceProcess _ Lib "kernel32" (ByVal dwProcessID As Long, _ ByVal dwType As Long) As Long
Public Const RSP_SIMPLE_SERVICE As Long = 1 Public Const RSP_UNREGISTER_SERVICE As Long = 0
'Crie a seguinte Sub: Public Sub MakeMeService() Dim pid As Long Dim reserv As Long pid = GetCurrentProcessId() reserv = RegisterServiceProcess(pid,RSP_SIMPLE_SERVICE) End Sub
'Depois coloque o seguinte no FORM_LOAD: Private Form_Load() MakeMeService End Sub
|
|
|
|
|