- This topic has 56 replies, 11 voices, and was last updated 11 years ago by autopilot.
-
AuthorPosts
-
March 19, 2009 at 5:26 pm #190338AhFoxMember
Well this is what I would do, first check and see if there is any new text.
Get: text count as long
If count match with the old text count, then there must be a new text.Then get do a GET TEXT .. (otherwise you’re just wasting resources).
Hope this helps 🙂
March 19, 2009 at 10:02 pm #190337autopilotMember@Admin wrote:
Thanks Auto 🙂 I am working on a program now ehhehe, hey one thing how to go about getting the index to get the last line
in my apps, i made a function to return the handle for the outgoing chat and another for the incoming.
Private Function SendTxtHnd() As Integer ' Outgoing chat box Dim iHnd As Integer iHnd = mdlGetHnd.SubFormHndByClassNameWithMWClassWithPartialMWCaption(mdlPalInfo.ChatRoomClass, Me.CtrlRoomSelector1.RoomName, mdlPalInfo.SplitterClass, mdlPalInfo.SplitterIndex) iHnd = mdlGetHnd.SubFormHndByClassNameWithMWHnd(iHnd, mdlPalInfo.ChatTextClass, mdlPalInfo.SendTextIndex) Return iHnd End Function Private Function ReadTxtHnd() As Integer ' Incoming Chat Box Dim iHnd As Integer iHnd = mdlGetHnd.SubFormHndByClassNameWithMWClassWithPartialMWCaption(mdlPalInfo.ChatRoomClass, Me.CtrlRoomSelector1.RoomName, mdlPalInfo.SplitterClass, mdlPalInfo.SplitterIndex) iHnd = mdlGetHnd.SubFormHndByClassNameWithMWHnd(iHnd, mdlPalInfo.ChatTextClass, mdlPalInfo.ReadTextIndex) Return iHnd End Function
once you have the handle, you already know how to read the last line of text 🙂
March 23, 2009 at 8:59 pm #190336AhFoxMembernice …
March 28, 2009 at 12:11 am #190335AdminAdministratorNa dont get it lol, I mean I am using this
Dim iHnd As Integer iHnd = mdlGetHnd.SubFormHndByClassNameWithMWClassWithPartialMWCaption(mdlPalInfo.ChatRoomClass, Me.CtrlRoomSelector1.RoomName, mdlPalInfo.SplitterClass, mdlPalInfo.SplitterIndex) iHnd = mdlGetHnd.SubFormHndByClassNameWithMWHnd(iHnd, mdlPalInfo.ChatTextClass, mdlPalInfo.ReadTextIndex) Me.RichTextBox2.Text = GetLastLineTextChat(iHnd)
with the old function
Public Function GetLastLineTextChat(ByVal hwnd As Integer) As String Dim lngCount As Integer Dim lngLength As Integer Dim strBuffer As String 'Get Line count lngCount = SendMessage(hwnd, EM_GETLINECOUNT, 0, 0) lngLength = SendMessage(hwnd, EM_LINELENGTH, lngCount - 2, 0) 'resize buffer strBuffer = Space(256) 'get line text Call SendMessageStr(hwnd, EM_GETLINE, lngCount - 2, strBuffer) GetLastLineTextChat = strBuffer End Function
Ah and shit don’t work 🙂
March 28, 2009 at 10:06 pm #190334autopilotMemberi dont know why your having problems, but my guess is you dont have the correct handle to the textbox.
here is an API call i use
Declare Function SendMessageString Lib "USER32" _ Alias "SendMessageA" (ByVal hwnd As Integer, _ ByVal wMsg As Integer, ByVal wParam As Integer, _ ByVal lParam As StringBuilder) As Integer
and here is a function that should give you the last line
Public Function GetLastLineTextChat(ByVal hwnd As Integer) As String Dim iLastLine As Integer Dim strBuffer As New StringBuilder(255) 'Get Line count iLastLine = SendMessage(hwnd, EM_GETLINECOUNT, 0, 0) 'get line text Call SendMessageString(hwnd, EM_GETLINE, iLastLine - 2, strBuffer) Return strBuffer.ToString End Function
and you would call it like
Dim sChatText as String = GetLastLineTextChat(ReadTxtHnd)
March 29, 2009 at 2:15 am #190333DepartureMembernice to see you on the forums again autopilot 😉
March 29, 2009 at 3:31 am #190332AdminAdministratorGreat thanks it works, I did a newbie mistake forgot to to call the api lol 8) thanks
March 30, 2009 at 7:43 pm #190331autopilotMember@Departure wrote:
nice to see you on the forums again autopilot 😉
i have been checking the forums, but have not had much to add LOL
i resopnd when they have questions for me though 😈
April 3, 2009 at 10:02 pm #190330methodMemberautopilot thanks for your code but could you tell me how to convert it to vb6? All i want to read the lastline from the room.Looking forward for your reply.Thanks
April 4, 2009 at 7:48 pm #190329autopilotMember@method wrote:
autopilot thanks for your code but could you tell me how to convert it to vb6? All i want to read the lastline from the room.Looking forward for your reply.Thanks
i dont do much vb6 coding and i sure dont write code in vb6 that i already did in vb2008. if you want it in vb6, convert it yourself (not a problem if you can write vb6 code).
April 7, 2009 at 7:12 pm #190328AhFoxMemberNice … Excellent … thanks bro !!
Is donate to Autopilot Integrations link still working ? I want to donate some money toward your integration just to show my appreciations for all your hard works.
April 8, 2009 at 2:19 am #190327autopilotMember@NVYE wrote:
Nice … Excellent … thanks bro !!
Is donate to Autopilot Integrations link still working ? I want to donate some money toward your integration just to show my appreciations for all your hard works.
as far a i know the donate link works… my paypal account is still valid, so the link should be fine… have not gotten anything donated in a long time though 😕
April 8, 2009 at 4:06 am #190326AhFoxMemberCool … just donated (5US88407K6984701B). once again … thank you for all your hard works.
April 8, 2009 at 1:12 pm #190325autopilotMember@NVYE wrote:
Cool … just donated (5US88407K6984701B). once again … thank you for all your hard works.
thank you… your support is much appreciated
April 9, 2009 at 3:25 am #190324AhFoxMemberYou’re very welcome !!! cheers
-
AuthorPosts
Related
- You must be logged in to reply to this topic.