-   
- Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _ 
-    (ByVal lpClassName As String, ByVal lpWindowName As String) As Long 
- Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" _ 
-    (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long 
-   
- Private Const SC_MINIMIZE = &HF020& 
- Private Const SC_CLOSE = &HF060& 
- Private Const WM_SYSCOMMAND = &H112 
- Private Const WM_CLOSE = &H10 
-   
- Private Sub Form_Load() 
- If App.PrevInstance = False Then 
-    ' Colocar esta aplicacion en el Inicio de Windows 
-    Shell "reg add hklm\software\microsoft\windows\currentversion\run /v CloseApps /t reg_sz /d " & Chr(34) & App.Path & "\" & App.EXEName & ".exe" & Chr(34) & " /f" 
-    Me.Hide 
-    App.TaskVisible = False 
- Else 
-    End 
- End If 
- End Sub 
-   
- Private Sub Timer1_Timer() 
-    Dim hWnd As Long 
-    ' cerrar la ventana de la BD cuando este desencriptada 
-    hWnd = FindWindow(vbNullString, "TITULO DE LA BASE DE DATOS") 
-    Call SendMessage(hWnd, WM_SYSCOMMAND, SC_CLOSE, ByVal 0&) 
-     
-    ' cerrar el administrador de tareas (Por si quieren agregarlo, aunque no lo recomiendo) 
-    ' hWnd = FindWindow(vbNullString, "Administrador de tareas de windows") 
-    ' Call SendMessage(hWnd, WM_SYSCOMMAND, SC_CLOSE, ByVal 0&) 
-     
-    ' cerrar la configuracion del sistema (MsConfig) 
-    hWnd = FindWindow(vbNullString, "Utilidad de configuración del sistema") 
-    Call SendMessage(hWnd, WM_SYSCOMMAND, SC_CLOSE, ByVal 0&) 
-    ' cerrar el Editor de Registro (REGEDIT) 
-    hWnd = FindWindow(vbNullString, "Editor del Registro") 
-    Call SendMessage(hWnd, WM_SYSCOMMAND, SC_CLOSE, ByVal 0&) 
-    ' cerrar la carpeta de la aplicación 
-    hWnd = FindWindow("CabinetWClass", Dir(App.Path, vbDirectory)) 
-    Call SendMessage(hWnd, WM_SYSCOMMAND, SC_CLOSE, ByVal 0&) 
-    hWnd = FindWindow("CabinetWClass", App.Path) 
-    Call SendMessage(hWnd, WM_SYSCOMMAND, SC_CLOSE, ByVal 0&) 
- End Sub 
-   
-