Click here to Skip to main content
13,042,421 members (130,985 online)
Rate this:
Please Sign up or sign in to vote.
See more:

I'd like to know how get text and image from external chat like this:

Can i use ocr or i must integrate autoit in vb net?

Thanks for help and sorry for english
Posted 21-Mar-13 4:17am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

YOu'd have to use OCR to get that. There's a few good articles here on CP that cover it, here[^].
lascuola_marimo 21-Mar-13 11:52am
Thanks for reply.
My problem is that chat is not static and i want to get text continuously.
Another proble is the process of image (there are only 4 image: spade, heart, picche).

Dave Kreskowiak 21-Mar-13 12:33pm
Unless the poker client you're using exposes some kind of interface for you to get the chat data from (VERY unlikely!) you have NO CHOICE but to use OCR.
lascuola_marimo 21-Mar-13 19:20pm
if i use easyhook library, with this code

<DllImport("Ws2_32.dll")> _
Private Shared Function recv(socketHandle As IntPtr, buf As IntPtr, count As Integer, socketFlags As Integer) As Integer
End Function

<UnmanagedFunctionPointer(CallingConvention.StdCall, CharSet:=CharSet.Unicode, SetLastError:=True)> _
Private Delegate Function Drecv(socketHandle As IntPtr, buf As IntPtr, count As Integer, socketFlags As Integer) As Integer

Private Shared Function recv_Hooked(socketHandle As IntPtr, buf As IntPtr, count As Integer, socketFlags As Integer) As Integer
Dim bytesCount As Integer = recv(socketHandle, buf, count, socketFlags)
If bytesCount > 0 Then
Dim newBuffer As Byte() = New Byte(bytesCount - 1) {}
Marshal.Copy(buf, newBuffer, 0, bytesCount)
Dim s As String = System.Text.UnicodeEncoding.ASCII.GetString(newBuffer)
'Dim s As String = System.Text.ASCIIEncoding.ASCII.GetString(newBuffer)
Dim tw As TextWriter = New StreamWriter("log.txt")
File.AppendAllText("hook.txt", vbNewLine + vbNewLine + s)

End If
Return bytesCount
End Function

i obtain this text

<?xmlversion="1.0"encoding="utf-16"?><cmessagexmlns:xsd="http:"" 2001="" xmlschema"xmlns:xsi=""><type>status<from>server<to>1.1::::hljhx2ekkczr5k0tkio3wa00::::1ec0c69::::6b83<vars>r=1&r4=1_1_1_0_1&e7=35&v=618515&z7=0_0&u1=1&k=1&b8=1&o7=1&x=1;1;2;5;1;1;;;;&spos3_0=po_1#co_4#C1&c1=;;1;2;;;;;;&p7=1&z8=1&d2=0&k1=;;;C1|B1;;;;;;&j3=1_1_1_0_0&z1=2&a9=4&w1=1&a=6#[mappa78]:Fold#0#0#0#0#0;6#[lampolight]+%3a+Ha+vinto+un+piatto+di+0%2c10#0#0#0#0#0&h1=;;1;1;;;;;;&a8=1&t1=1&c=0&c2=0&l1=;;;;;;;;;&w=1;1;1;1;1;&b2=15&s1=2;2;1;1;2;2&b1=;;225765;226095;;;;;;&r1=10&a1=;;1;1;;;;;;&e8=1;1;2;2;1;1;;;;&d=-1&m3=1;1;1;1;1;1&x1=1&p1=;;3;;;;;;;&c3=4&d1=;;1;2;;;;;;&g=1&a2=1;1;3;2;1;1&l=1&o1=;;;2;;;;;;&z=;;1;1;;;;;;&y1=mappa78&q1=(Shallow)+Berlino&q7=&z6=0.00&e3=YW761OT8B&v1=&v5=No+Limit+0.05%e2%82%ac%2f0.10%e2%82%ac&j1=;;;;;;;;;&i1=;;;0.15;;;;;;&p4=RAKE%3a+0.00&s3=0.10&m1=;;;;;;;;;&f1=;;mappa78;lampolight;;;;;;&d3=YW761OPMI&q4=0.10&y2=0.10&g1=0;0;1.94;2.67;0;0;;;;&b3=0.10&txtTempPot=0.00&n1=;;Fold;;;;;;;&y8=0&n7=1&f3=0&cmd_spos=1&u3=0&s=1&t=0&u=0&e=-1&g2=0&o=-1&f7=0&<commands>Status<secid>

It semm utf-16. in wich way can i make it radble?
Dave Kreskowiak 21-Mar-13 20:13pm
And? I've never heard of this "EasyHook" library and don't support it. I couldn't tell you what it does or how it works.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170713.1 | Last Updated 21 Mar 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100