- This topic has 6 replies, 4 voices, and was last updated 19 years ago by Johnny5.
-
AuthorPosts
-
March 24, 2005 at 6:59 am #189666Johnny5Member
Hello all,
I’m new here, just need some help on how to get text from the chatbox (RichEdit20A) window “#32770” old paltalk version. How to get a command trigger like “!” ?
Thank Adavance,
March 24, 2005 at 7:43 pm #189672Johnny5MemberWill This Works? I’ve try it but no sign 🙄
Function LastChatLineWithSN() On Error Resume Next Dim LastLine Dim lastlen Dim TheChatText As String Dim TheChars As String Dim TheChar As String Dim FindChar Dim ChatText As String ChatText$ = GetChatText For FindChar = 1 To Len(ChatText$) TheChar$ = Mid(ChatText$, FindChar, 1) TheChars$ = TheChars$ & TheChar$ If TheChar$ = Chr(13) Then TheChatText$ = Mid(TheChars$, 1, Len(TheChars$) - 1) Form1.Text1.text = TheChatText$ TheChars$ = "" End If Next FindChar lastlen = Val(FindChar) - Len(TheChars$) LastLine = Mid(ChatText$, lastlen, Len(TheChars$)) LastChatLineWithSN = LastLine End Function Function LastChatLine() On Error Resume Next Dim ChatTrim As String Dim ChatTrimNum Dim ChatText ChatText = LastChatLineWithSN ChatTrimNum = Len(SNFromLastChatLine) ChatTrim$ = Mid$(ChatText, ChatTrimNum + 4, Len(ChatText) - Len(SNFromLastChatLine)) LastChatLine = ChatTrim$ End Function Public Function GetText(WinHandle As Long) As String Dim abc As String, TxtLength As Long TxtLength& = SendMessage(WinHandle&, WM_GETTEXTLENGTH, 0&, 0&) abc$ = String(TxtLength&, 0&) Call SendMessageByString(WinHandle&, WM_GETTEXT, TxtLength& + 1, abc$) GetText$ = abc$ End Function Function GetChatText() On Error Resume Next Dim ChatText Dim AORich As Long Dim Room As Long Call GetPalWindow Dim sp1 As Long Dim sp2 As Long sp1 = FindWindow("#32770", strWindowTitle) sp1 = FindWindowEx(sp1, 0, "#32770", vbNullString) sp2 = FindWindowEx(sp1, 0, "RichEdit20A", vbNullString) sp2 = FindWindowEx(sp1, sp2, "RichEdit20A", vbNullString) sp2 = FindWindowEx(sp1, sp2, "RichEdit20A", vbNullString) sp2 = FindWindowEx(sp1, sp2, "RichEdit20A", vbNullString) ChatText = GetText(sp2) GetChatText = ChatText End Function Public Function GetText1(Get_hWnd As Long) As String On Error Resume Next Dim retVal As Long, lenTxt As Integer, retText As String lenTxt = SendMessageLong(Get_hWnd, WM_GETTEXTLENGTH, 0&, 0&) retText = String(lenTxt + 1, " ") Call SendMessageByString(Get_hWnd, WM_GETTEXT, lenTxt + 1, retText) GetText1 = Left(retText, lenTxt) End Function
April 2, 2005 at 5:47 am #189671UDG_Sk8erboi4490Membertell yah what, ill find the coding from me age checker from 553, gets room anme if thats what uw ant
April 3, 2005 at 12:56 pm #189670DepartureMemberhmm notice how so many people use the window handel #32770, i am sure everyone is aware that alot of programs also have this window handel, so in other words if you have an app runing the same time as your paltalk and say for example it uses the same window handel #32770 and is on top of paltalk you are going to run into some trouble…. But the good news is there is a way to fix this and should be used at all times (in my option)… and that is by using a wild card, for example we all know that paltalk room all end with “Voice Conference” so the wild card would be *Voice Conference, as as that and now the code to help find that wild card :O(
BTW this is for older version paltalk and you will have to subclass it to suit the newer version, wich is easy using a good API spy like PAT and JK’s API spy.. anyway the code
Public Function Palsend(Sendit As String) Dim PaltalkHwnd As Long Dim PaltalkEdit As Long Dim SendKey As Long Dim Palb As Long PaltalkHwnd = FindWindowWild("*Voice Conference", False) PaltalkEdit = FindWindowEx(PaltalkHwnd, 0&, "RichEdit20A", vbNullString) PaltalkEdit = FindWindowEx(PaltalkHwnd, PaltalkEdit, "RichEdit20A", vbNullString) Call SendMessageByString(PaltalkEdit, WM_SETTEXT, 0, Sendit$) If PaltalkEdit = 0 Then MsgBox (".::Paltalk Room is not open::.") End Exit Function End If Do DoEvents PaltalkHwnd = FindWindowWild("Voice Confrence", False) Palb = FindWindowEx(PaltalkHwnd, 0&, "PALBUTTON", vbNullString) Palb = FindWindowEx(PaltalkHwnd, Palb, "PALBUTTON", vbNullString) Palb = FindWindowEx(PaltalkHwnd, Palb, "PALBUTTON", vbNullString) Call SendMessageLong(Palb, WM_LBUTTONDOWN, 0&, 0&) Call SendMessageLong(Palb, WM_LBUTTONUP, 0&, 0&) If Palb = 0 Then MsgBox ".::Palbutton error::." End Exit Function End If Loop Until Palb 0 End Function Function EnumWinProc(ByVal hwnd As Long, ByVal lParam As Long) As Long Dim k As Long, sName As String If IsWindowVisible(hwnd) And GetParent(hwnd) = 0 Then sName = Space$(128) k = GetWindowText(hwnd, sName, 128) If k > 0 Then sName = Left$(sName, k) If lParam = 0 Then sName = UCase(sName) If sName Like sPattern Then hFind = hwnd EnumWinProc = 0 Exit Function End If End If End If EnumWinProc = 1 End Function Public Function FindWindowWild(sWild As String, Optional bMatchCase As Boolean = True) As Long sPattern = sWild If Not bMatchCase Then sPattern = UCase(sPattern) EnumWindows AddressOf EnumWinProc, bMatchCase FindWindowWild = hFind End Function
Ofcause you have to also Publicl declare funtions,
Hope this method helps someone, it has worked great for me and i have never ran into
trouble finding the correct object handelApril 3, 2005 at 6:43 pm #189669AdminAdministratorThanks Departure this should work with paltalk 8 too after little tweaking, I was looking for this type of code to connect to the paltalk room, since the old method paltalk disable it somehow 🙁
April 4, 2005 at 6:44 am #189668DepartureMemberYeap it does work with paltalk 8 as i have already subclassed it, and it works with out a problem :O)
April 4, 2005 at 2:05 pm #189667AdminAdministratorThas great 🙂
-
AuthorPosts
Related
- You must be logged in to reply to this topic.