
No se si me explico?

| |||
Cargar programa en servicios VB Tengo hecho un programilla en visual con sockets para comunicarse entre pc´s y me gustaria que este programilla se pudiese cargar en los servicios, o sea, que no quede en la barra cargado como siempre, sino que este donde el reloj y la fecha y eso. ![]() No se si me explico? ![]() |
| |||
Nunca he hecho un servicio en Visual Basic, (sólo en Delphi), así que con eso no te puedo ayudar. De todas formas, aquí tienes un ejemplo de cómo poner un "Tray Icon": Option Explicit Const MAX_TOOLTIP As Integer = 64 Const NIF_ICON = &H2 Const NIF_MESSAGE = &H1 Const NIF_TIP = &H4 Const NIM_ADD = &H0 Const NIM_DELETE = &H2 Const WM_MOUSEMOVE = &H200 Const WM_LBUTTONDOWN = &H201 Const WM_LBUTTONUP = &H202 Const WM_LBUTTONDBLCLK = &H203 Const WM_RBUTTONDOWN = &H204 Const WM_RBUTTONUP = &H205 Const WM_RBUTTONDBLCLK = &H206 Private Type NOTIFYICONDATA cbSize As Long hwnd As Long uID As Long uFlags As Long uCallbackMessage As Long hIcon As Long szTip As String * MAX_TOOLTIP End Type Private MiIcono As NOTIFYICONDATA Private Declare Function Shell_NotifyIcon Lib "shell32.dll" Alias "Shell_NotifyIconA" (ByVal dwMessage As Long, lpData As NOTIFYICONDATA) As Long Private Sub PoneIcono() With MiIcono .hwnd = Me.hwnd .uID = Me.Icon .uFlags = NIF_ICON Or NIF_MESSAGE Or NIF_TIP .uCallbackMessage = WM_MOUSEMOVE .hIcon = Me.Icon.Handle .szTip = "Mi icono" & vbNullChar .cbSize = Len(MiIcono ) End With Call Shell_NotifyIcon(NIM_ADD, MiIcono) End Sub Private Sub QuitaIcono() Call Shell_NotifyIcon(NIM_DELETE, MiIcono) End Sub |
| ||||
aca un ejemplo que encontre en www.allapi.net aqui la informacion que da: The RegisterServiceProcess function registers or unregisters a service process. A service process continues to run after the user logs off. el codigo: 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() 'KPD-Team 1999 'URL: http://www.allapi.net/ 'E-Mail: [email protected] 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 |