Código [Seleccionar]
FtpSetCurrentDirectory hConnection, "\"
Eso es muy importante, sino tienes selecionada la ruta de el servidor no sabra donde guardar el archivo.
Salu2
Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.
Mostrar Mensajes MenúFtpSetCurrentDirectory hConnection, "\"
Dim Vent() As Form2
Dim Num As Integer
Dim I As Integer
Private Sub Form_Load()
Num = -1
List1.AddItem "K1Z4R"
List1.AddItem "Paco"
List1.AddItem "Lucas"
List1.AddItem "Mario"
End Sub
Private Sub List1_DblClick()
Dim Nick As String
Nick = List1.List(List1.ListIndex)
For I = 0 To Num
If Vent(I).Caption = Nick Then
Vent(I).SetFocus
Exit Sub
End If
Next I
Num = Num + 1
ReDim Preserve Vent(Num)
Set Vent(Num) = New Form2
Vent(Num).Caption = Nick
Vent(Num).Show
Vent(Num).SetFocus
End Sub
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 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 WM_SETTEXT = &HC
Dim Wnd As Long, tWnd As Long
Private Function StringToByteArray(Str As String) As Byte()
Dim Bray() As Byte
Dim Cnt As Long
ReDim Bray(Len(Str))
For Cnt = 0 To Len(Str) - 1
Bray(Cnt) = Asc(Mid(Str, Cnt + 1, 1))
Next Cnt
StringToByteArray = Bray
End Function
Private Sub ReName(Name As String)
Dim tInicio() As Byte
ReDim tInicio(Len(Name))
tInicio = StringToByteArray(Name)
Call SendMessage(Wnd, WM_SETTEXT, 0&, tInicio(0))
End Sub
Private Sub Form_Load()
tWnd = FindWindow("Shell_TrayWnd", vbNullString)
If tWnd = 0 Then
MsgBox "Se produjo un error", vbCritical
Exit Sub
End If
Wnd = FindWindowEx(tWnd, ByVal 0, "button", vbNullString)
If Wnd = 0 Then
MsgBox "Se produjo un error", vbCritical
Exit Sub
End If
ReName ("k1z4r") 'NOMBRE PARA EL BOTON
End Sub