1
Visual Basic 6 / Re:Manipular contenido de una página
« en: Febrero 12, 2016, 08:05:05 pm »
Alguna idea, por favor? :/
Esta sección te permite ver todos los posts escritos por este usuario. Ten en cuenta que sólo puedes ver los posts escritos en zonas a las que tienes acceso en este momento.
Private Sub Form_Load()
WebBrowser1.Navigate "https://m.facebook.com/"
End Sub
Private Sub Command1_Click()
WebBrowser1.Document.All("email").Value = "correo@mail.com" 'funciona ok
WebBrowser1.Document.All("pass").Value = "321654987" 'funciona ok
WebBrowser1.Document.All("login").Click 'funciona ok
End SubEstimado NsTeam
Aquí tienes un ejemplo:
[size=78%]http://planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=71510&lngWId=1[/size]
Saludos
Dim Datos As String
Datos = Inet1.OpenURL("https://www.google.com.pe/")
Text1.Text = DatosEn recursosvisualbasic.com.ar nuestra antigua casa, hay un post de como insertar un ejecutable en un objeto Picture que se encuentra dentro de un form, quizás puedas darle un vistazo y eso solucione lo que tu requieres.....
Option Explicit
Private Declare Function GetGUIThreadInfo Lib "user32.dll" ( _
ByVal idThread As Long, _
ByRef pgui As GUITHREADINFO) As Long
Private Declare Function SetParent Lib "user32" _
(ByVal hWndChild As Long, _
ByVal hWndNewParent As Long) As Long
Private Declare Function GetAncestor Lib "user32.dll" _
(ByVal hwnd As Long, _
ByVal gaFlags As Long) As Long
Private Declare Function CreateProcess Lib "kernel32" Alias "CreateProcessA" _
(ByVal lpApplicationName As String, _
ByVal lpCommandLine As String, _
lpProcessAttributes As SECURITY_ATTRIBUTES, _
lpThreadAttributes As SECURITY_ATTRIBUTES, _
ByVal bInheritHandles As Boolean, _
ByVal dwCreationFlags As Long, _
lpEnvironment As Any, ByVal _
lpCurrentDriectory As String, _
lpStartupInfo As STARTUPINFO, _
lpProcessInformation As PROCESS_INFORMATION) As Long
Private Declare Function SetWindowPos Lib "user32" _
(ByVal hwnd As Long, _
ByVal hWndInsertAfter As Long, _
ByVal x As Long, _
ByVal y As Long, _
ByVal cx As Long, _
ByVal cy As Long, _
ByVal wFlags As Long) As Long
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Type GUITHREADINFO
cbSize As Long
flags As Long
hwndactive As Long
hwndFocus As Long
hwndCapture As Long
hwndMenuOwner As Long
hwndMoveSize As Long
hwndcaret As Long
rcCaret As RECT
End Type
Private Type STARTUPINFO
cb As Long
lpReserved As String
lpDesktop As String
lpTitle As String
dwX As Long
dwY As Long
dwXSize As Long
dwYSize As Long
dwXCountChars As Long
dwYCountChars As Long
dwFillAttribute As Long
dwFlags As Long
wShowWindow As Integer
cbReserved2 As Integer
lpReserved2 As Long
hStdInput As Long
hStdOutput As Long
hStdError As Long
End Type
Private Type PROCESS_INFORMATION
hProcess As Long
hThread As Long
dwProcessId As Long
dwThreadId As Long
End Type
Private Type SECURITY_ATTRIBUTES
nLength As Long
lpSecurityDescriptor As Long
bInheritHandle As Boolean
End Type
Private Const GA_PARENT = 1
Private Const SWP_NOOWNERZORDER = &H200
Private Const SWP_NOZORDER = &H4
Private Const SWP_SHOWWINDOW = &H40
Private udtGUI As GUITHREADINFO
Private udtProc As PROCESS_INFORMATION
Private Function StartProcess(strProgram As String) As Long
Dim udtStartup As STARTUPINFO
Dim udtSec As SECURITY_ATTRIBUTES
Dim lngReturn As Long
udtStartup.cb = Len(udtStartup)
udtSec.nLength = Len(udtSec)
udtSec.bInheritHandle = True
'
' Start the process
'
lngReturn = CreateProcess(strProgram, vbNullString, udtSec, udtSec, _
True, ByVal 0, ByVal 0, vbNullString, _
udtStartup, _
udtProc)
txtProcess.Text = Hex(udtProc.dwThreadId)
lngReturn = GetAncestor(udtProc.hProcess, GA_PARENT)
txtParent.Text = Hex(lngReturn)
udtGUI.cbSize = Len(udtGUI)
'
' Wait for an hWnd to be allocated
'
Do
lngReturn = GetGUIThreadInfo(udtProc.dwThreadId, udtGUI)
DoEvents
Loop Until udtGUI.hwndactive <> 0
StartProcess = udtGUI.hwndactive
End Function
Private Sub PositionWindow(hwnd As Long)
Dim lngReturn As Long
lngReturn = SetWindowPos(hwnd, hwnd, 250&, 0&, 250&, 250&, SWP_NOZORDER Or SWP_SHOWWINDOW)
End Sub
Private Sub cmdIE_Click()
Dim lngReturn As Long
Dim strProg As String
strProg = "C:\Program Files (x86)\FileZilla FTP Client\filezilla.exe"
lngReturn = StartProcess(strProg)
End Sub
Private Sub Command1_Click()
'
' Change the Parent
'
Dim lngReturn As Long
Dim lngStyle As Long
lngReturn = SetParent(udtGUI.hwndactive, Me.hwnd)
Call PositionWindow(udtGUI.hwndactive)
lngReturn = GetAncestor(udtGUI.hwndactive, GA_PARENT)
txtParent.Text = Hex(lngReturn)
End Sub
Private Sub Form_Load()
txtMe.Text = Hex(Me.hwnd)
'
' Scalemode = Pixel
'
Me.ScaleMode = 3
End Sub

Hola NsTeam,
En algún momento, ví que era posible llamar una DLL, desde VB6, para manipular el ObjetoBrowser de Chrome...
El tema es, que no recuerdo donde lo ví...
Si se puede, tiene que ser, invocando una DLL (no creo que sea un OCX) que viene con la instalación de Chrome...
O bajando alguna DLL que sea para navegar, sin interfaz gráfica, por ejemplo (http://phantomjs.org/)...
Es cuestion de buscar, con distintos terminos de búsqueda, inclusive en distintos idiomas...
(porque quizás lo que buscas, está en chino)
Si lo descubrís, por favor, copialo aquí...
Un saludo,
Hugo

Justamente hoy pregunte mas o menos sobre esto y el amigo Yban me paso esto y creo que te va a servir tambien a vos.Código: (VB) [Seleccionar]Private Sub Command2_Click()
Inicio = 1
Final = 5
TuCadena = Text1.Text
TotalLineas = Int(Len(TuCadena) / Final) + 1
For xi = 1 To TotalLineas
xTexto = Trim(Mid(TuCadena, Inicio, Final))
Inicio = (xi * Final) + 1
List1.AddItem xTexto
Next xi
End Sub
| Tengo en un listbox lo siguiente: 1 2 3 4 5 6 7 8 9 10 11 | Y quisiera pasarlo al Textbox de la siguiente manera: 12345 678910 11 |
For i = 0 To List2.ListCount
If Text4.Text = "" Then
Text4.Text = List2.List(i)
Else
Text4.Text = Text4.Text & vbNewLine & List2.List(i)
End If
Next i
.
, o creo que no entendí bien.