|
-
Sep 23rd, 2000, 04:53 PM
#1
Thread Starter
New Member
Hi anyone!
I've to read out text off the internetexplorer.
its text only (webchat)..
but ANY getmessage functions an methods wont work.
could anyone help me??
(sorry, for my bad english, but i'm german)
greetz,
snooze
-
Sep 25th, 2000, 12:23 AM
#2
Thread Starter
New Member
Yes, if you'll say so ;-)
i want to have the html-source of a frame, which will be actually shown in IE. But i can't request these pages with winsock or inet control, because its cookie-based and i dont want to implement a webbrowser control.
thanx,
marc
-
Sep 25th, 2000, 02:20 AM
#3
Thread Starter
New Member
here my actual module code:
Code:
Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" (ByVal hWnd As Long, ByVal lpString As String, ByVal cch As Long) As Long
Declare Function GetWindow Lib "user32" (ByVal hWnd As Long, ByVal wCmd As Long) As Long
Declare Function GetWindowTextLength Lib "user32" Alias "GetWindowTextLengthA" (ByVal hWnd As Long) As Long
Declare Function sendmessagebynum& Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long)
Declare Function SendMessageByString Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As String) As Long
Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Declare Function GetClassName& Lib "user32" Alias "GetClassNameA" (ByVal hWnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long)
Public Const GW_CHILD = 5
Public Const GW_HWNDFIRST = 0
Public Const GW_HWNDLAST = 1
Public Const GW_HWNDNEXT = 2
Public Const GW_HWNDPREV = 3
Public Const GW_MAX = 5
Public Const GW_OWNER = 4
Public Const WM_CHAR = &H102
Public Const WM_SETTEXT = &HC
Public Const WM_KEYDOWN = &H100
Public Const WM_KEYUP = &H101
Public Const WM_LBUTTONDOWN = &H201
Public Const WM_LBUTTONUP = &H202
Public Const WM_RBUTTONDOWN = &H204
Public Const WM_RBUTTONUP = &H205
Public Const WM_RBUTTONDBLCLK = &H206
Public Const WM_CLOSE = &H10
Public Const WM_COMMAND = &H111
Public Const WM_CLEAR = &H303
Public Const WM_DESTROY = &H2
Public Const WM_GETTEXT = &HD
Public Const WM_GETTEXTLENGTH = &HE
Public Const WM_LBUTTONDBLCLK = &H203
Public Const BM_GETCHECK = &HF0
Public Const BM_GETSTATE = &HF2
Public Const BM_SETCHECK = &HF1
Public Const BM_SETSTATE = &HF3
Function GetCaption(hWnd)
Dim hwndlength%
Dim hWndTitle$
Dim a%
hwndlength% = GetWindowTextLength(hWnd)
hWndTitle$ = String$(hwndlength%, 0)
a% = GetWindowText(hWnd, hWndTitle$, (hwndlength% + 1))
GetCaption = hWndTitle$
End Function
Function GetClass(child)
Dim Buffer$
Dim getclas%
Buffer$ = String$(250, 0)
getclas% = GetClassName(child, Buffer$, 250)
GetClass = Buffer$
End Function
Function FindChildByClass(parentw, childhand)
Dim firs%
Dim firss%
Dim room%
firs% = GetWindow(parentw, 5)
If UCase(Mid(GetClass(firs%), 1, Len(childhand))) Like UCase(childhand) Then GoTo bone
firs% = GetWindow(parentw, GW_CHILD)
If UCase(Mid(GetClass(firs%), 1, Len(childhand))) Like UCase(childhand) Then GoTo bone
While firs%
firss% = GetWindow(parentw, 5)
If UCase(Mid(GetClass(firss%), 1, Len(childhand))) Like UCase(childhand) Then GoTo bone
firs% = GetWindow(firs%, 2)
If UCase(Mid(GetClass(firs%), 1, Len(childhand))) Like UCase(childhand) Then GoTo bone
Wend
FindChildByClass = 0
bone:
room% = firs%
FindChildByClass = room%
End Function
Function FindChildByTitle(parentw, childhand)
firs% = GetWindow(parentw, 5)
If UCase(GetCaption(firs%)) Like UCase(childhand) Then GoTo bone
firs% = GetWindow(parentw, GW_CHILD)
While firs%
firss% = GetWindow(parentw, 5)
If UCase(GetCaption(firss%)) Like UCase(childhand) & "*" Then GoTo bone
firs% = GetWindow(firs%, 2)
If UCase(GetCaption(firs%)) Like UCase(childhand) & "*" Then GoTo bone
Wend
FindChildByTitle = 0
bone:
room% = firs%
FindChildByTitle = room%
End Function
'soll das Chatfenster im iNetExpl. finden
'getestet: findet das Child mit Text..
Function FindChatWin()
MainWin = FindWindow("CabinetWClass", "DIE CHRISTLICHE COMMUNITY FÜR JUGENDLICHE - Microsoft Internet Explorer")
If MainWin = 0 Then MainWin = FindWindow("CabinetWClass", vbNullString)
' child1 = FindChildByTitle (Win_Buff5, "")
child1 = FindChildByClass(MainWin, "Shell DocObject View")
child2 = FindChildByTitle(child1, "")
If child2 = 0 Then child2 = FindChildByClass(child1, "Internet Explorer_Server")
child3 = FindChildByClass(child2, "Shell Embedding")
If child3 = 0 Then child3 = FindChildByTitle(child2, "")
child3 = GetWindow(child2, GW_CHILD)
For sddx = 1 To 1
child3 = GetWindow(child2, GW_HWNDNEXT)
Next sddx
child4 = FindChildByTitle(child3, "")
If child4 = 0 Then child4 = FindChildByClass(child3, "Shell DocObject View")
'child5 = FindChildByTitle(child4, "")
If child5 = 0 Then child5 = FindChildByClass(child4, "Internet Explorer_Server")
'MsgBox child5
FindChatWin = child5
End Function
'Findet die URL Leiste vom INet Expl.
Function FindURL()
Win_Buff5 = FindWindow("CabinetWClass", "DIE CHRISTLICHE COMMUNITY FÜR JUGENDLICHE - Microsoft Internet Explorer") ' First Attempt To Find Main Window
If Win_Buff5 = 0 Then MsgBox "Du bist noch nich im Chat - geh erstma rein!", vbCritical, "TW Chatter": Exit Function 'Win_Buff5 = FindWindow("CabinetWClass", vbNullString)
Win_Buff4 = FindChildByTitle(Win_Buff5, "")
If Win_Buff4 = 0 Then Win_Buff4 = FindChildByClass(Win_Buff5, "Worker")
Win_Buff3 = FindChildByTitle(Win_Buff4, "")
If Win_Buff3 = 0 Then Win_Buff3 = FindChildByClass(Win_Buff4, "ReBarWindow32")
' Win_Buff2 = FindChildByTitle (Win_Buff3, "")
Win_Buff2 = FindChildByClass(Win_Buff3, "ComboBoxEx32")
Win_Buff1 = FindChildByTitle(Win_Buff2, "")
If Win_Buff1 = 0 Then Win_Buff1 = FindChildByClass(Win_Buff2, "ComboBox")
' Win_Buff0 = FindChildByTitle (Win_Buff1, "http://www.teensweb.de:10000/CGI?service=chat&nick=snooze&sessionid=8305767597253551157&nh=0&dummy=969721793673")
win_buff0 = FindChildByClass(Win_Buff1, "Edit")
FindURL = win_buff0
End Function
Function GetURL()
Dim child As Long
child = FindURL
GetTrim = sendmessagebynum(child, WM_GETTEXTLENGTH, 0&, 0&)
TrimSpace$ = Space$(GetTrim)
GetString = SendMessageByString(child, WM_GETTEXT, GetTrim + 1, TrimSpace$)
GetURL = TrimSpace$
End Function
Function GetChat()
Dim child As Long
child = FindChatWin
GetTrim = sendmessagebynum(child, WM_GETTEXTLENGTH, 0&, 0&)
TrimSpace$ = Space$(GetTrim)
GetString = SendMessageByString(child, WM_GETTEXT, GetTrim + 1, TrimSpace$)
GetChat = TrimSpace$
End Function
Function getchat2()
Dim child As Long
child = FindChatWin
getrim = GetWindowTextLength(child)
TrimSpace$ = Space$(GetTrim)
Call GetWindowText(child, TrimSpace$, 0)
GetChat = TrimSpace$
End Function
------------------------------------------------------
But neither getchat2 nor getchat works.
Any suggestions to read out the frame, or to view the source of the frame, i want ?
cya,
snooze alias marc
p.s.: comments are in german, 'cause i'm german ;-)
[Edited by snooze on 09-25-2000 at 03:31 AM]
-
Sep 25th, 2000, 10:31 AM
#4
Member
If you can get a URL then I suppose you can use an ActiveX control (HTML Raw) that will get HTML and headers for you. Here is the URL:
http://download.cnet.com/downloads/0....lst.td_908198
or if you implement inet control in your app, use
inet1.Document.DocumentElement.innerHTML
after Document_Complete Event.
Gut Gluck 
-
Sep 25th, 2000, 02:21 PM
#5
Hyperactive Member
ill try and work something out for you. Do you want the HTML code of the page also?
Matt 
-
Sep 26th, 2000, 09:18 AM
#6
Thread Starter
New Member
i need the source of a specified frame (java generated)
i want to read out a web-chat
thanx,
marc
-
Sep 27th, 2000, 07:42 AM
#7
Addicted Member
Inet control
Hi,
I don't know if this will help but,
Stick a textbox, a command button and th Internet control on a form. Then in the command button sub type:
Text1.Text = Inet1.OpenURL("http://www.somewbesite.com")
And the html source code for the web page yo entered will be displayed in the text box (so you'll probably need to put scroll bars o the text box.
If you use an input box for the URL rather than hard coding one in - probably a goo idea
Hope this helps
Skeen
"It wasn't the booze that made me snooze, It was the Gin that did me in!"
-
Sep 28th, 2000, 12:53 AM
#8
Thread Starter
New Member
I done this, but it wont work, if you want to recieve CGI Data and if the site creates/reads a cookie. Does anyone know, how to work with these ?
thanx.
does anyone know the cassiopeia Chat system
cya
marc
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|