Skip to content

autopilot

Forum Replies Created

Viewing 15 posts - 1 through 15 (of 338 total)
  • Author
    Posts
  • #186436
    autopilot
    Member

    The easiest way is to create and format the text in a RichTextBox in your application and then sending the .RTF string instead of the .Text string.

    #190595
    autopilot
    Member
    #190597
    autopilot
    Member

    Make sure that on Windows Vista and newer that you are running with elevated permissions.  This means to debug in the VS environment, you must start VS “As Administrator” and you need to make your program run “As Administrator” once compiled by editing the manifest.

    #186785
    autopilot
    Member

    @Admin wrote:

    cleaning would take for ever and i don’t remember what texbox goes for what

    that is why you rename as you go, giving them meaningful names

    #186094
    autopilot
    Member

    @ManicMike wrote:

    The one thing that sticks out about my two functions are they do not return value on all code paths. It suggests I am missing a Return statement. however since it was only a warning I ignored it lol

    As long as you are not trying to use the return value in any way, the warning can be ignored without causing any crash issues. I know the code is based on some of my old code and I had some functions that did not return on all code paths, but while it will not crash the app, it is not good code practice to do it. If you do not need a return value, you may want to change the function into a sub.

    My guess is the more likely issue is that the allocated memory probably is not always being freed. This would leave the allocated memory injected into the pal app and cause the kinds of issues you are reporting.

    #190229
    autopilot
    Member

    Nice job on the video’s! Thanks for taking the time and putting forth the effort to help others learn.

    #190630
    autopilot
    Member

    The GUID is what the IHTMLDocument interface is registered as. I found it in sample code, but if you open Regedit and search for the GUID, you will find it is registered with the IHTMLDocument interface.
    IHTMLDocument

    #190635
    autopilot
    Member

    Ok, here is what I have at this point. But using these calls, the program must be run as administrator.

    Add reference to Microsoft HTML Object Library
    [attachment=0:20gd9lvy]Ref_MS_HTML_Object.png[/attachment:20gd9lvy]

    Here is my import section

    Imports System.Runtime.InteropServices
    Imports mshtml

    Here are the API def’s and a function to get text from internet explorer_server

    #Region "API CALLS"
    
    _
    Public Shared Function RegisterWindowMessage(lpString As String) As Integer
    End Function
    _
    Public Shared Function SendMessageTimeout(hwnd As IntPtr, msg As Integer, wParam As IntPtr, lParam As IntPtr, fuFlags As Integer, uTimeout As Integer, ByRef lpdwResult As IntPtr) As IntPtr
    End Function
    _
    Public Shared Function ObjectFromLresult(lResult As IntPtr, ByRef riid As Guid, wParam As IntPtr, ByRef ppvObject As IHTMLDocument2) As Integer
    End Function
    Public Const SMTO_ABORTIFHUNG As Integer = &H2
    Public IID_IHTMLDocument As New Guid("626FC520-A41E-11CF-A731-00A0C9082637")
    
    #End Region
    
    ' Provide Handle of Internet Explorer_Server object
    Private Function DocFromDOM(ByVal hWnd As IntPtr) As String
    ' Create IHTMLDocument2 object
    Dim Doc As IHTMLDocument2 = Nothing
    Try
    ' Get Registered Windows message
    Dim nMsg As Integer = RegisterWindowMessage("WM_HTML_GETOBJECT")
    ' Create IntPtr object to pass as ref to SendMessageTimeout
    Dim ipRes As IntPtr
    ' Call SendMessageTimeout
    If (SendMessageTimeout(hWnd, nMsg, IntPtr.Zero, IntPtr.Zero, SMTO_ABORTIFHUNG, 1000, ipRes) = IntPtr.Zero) Then
    ' SendMessageTimeout returned nothing, make sure IHTMLDocument2 is nothing
    Doc = Nothing
    Else
    ' Call ObjectFromLresult to fill IHTMLDocument2 object
    ObjectFromLresult(ipRes, IID_IHTMLDocument, IntPtr.Zero, Doc)
    End If
    Catch ex As Exception
    ' Make sure IHTMLDocument2 is nothing
    Doc = Nothing
    End Try
    ' Process Doc for return
    If Doc Is Nothing Then
    Return Nothing
    Else
    ' Return the innertext
    Return Doc.activeElement.innerText
    End If
    End Function

     

    Once you get the text, you will still have to parse it to find out what if anything is new.

    #190637
    autopilot
    Member

    Thanks for taking the time and the willingness to donate your hard earned money. Very few people do so it does mean a lot when someone takes that step.

    I saw in your screenshot you had it labeled as “Internet Explorer_Server”.

    I started working on trying to develop code to read the text from the Internet Explorer_Server and basically, I can copy the Internet Explorer_Server into an IHTMLDocument2 object. From there, I can get the whole chat text into a string object. I currently am playing with loading the string into a richtextbox, but there are other ways we can go about parsing the incoming chat too.

    I will post some code once I get a better handle on the process and clean up my code.

    #190640
    autopilot
    Member

    @ChiNa-Man wrote:

    Now How come I cant get the Content of Child Windows when I can get Content of the Main Windows and everything else in Crown IM.

    The issue with getting text is the type of control the text is in. Going by your Screenshot above, you are trying to pull text from a “Internet Explorer_Server” control using the techniques used for an edit control. That is like trying to unlock your car door with your house key (it just won’t work).

    I have not looked at Crown, but it may be possible to read the xml from the “Internet Explorer_Server” control and parse the incoming text that way.

    See read browser “in memory HTML” from EXE

    #187308
    autopilot
    Member

    We all started as novices at one point. I remember well trying to learn not only VB, but how to use the win32 API. It takes a lot of reading and then trial and error. I made (and still make) a lot of test applications to learn how to perform tasks I wanted done. Once I had it working in a test app, then it is easy to add to another larger application.

    Just start at the beginning and take your time to learn what the code is doing. If all you do is copy and paste code, then you will have a hard time creating what you want or trouble shooting code from someone else that you don’t understand.

    Over on im-integrations you can find a lot of small sample projects to show how I do a lot of the things with pal…

    #187313
    autopilot
    Member

    Break the task of updating the list box with the nics from the room into smaller tasks. Then focus on each task 1 by 1. Start by learning how to read a single nic from the room. Once you have that, you can repeat that to get all nics. Then learn how to write an item to a listbox. There are several ways to handle keeping the nic lists in sync, but the easiest may be to clear the list box before you start and then just add each nic as you read it. As you learn, you may do something like reading the nic from pal, and only add it if it is not already present. But then you have to also handle removing nics that have left.

    Once you can read nics and add them to your own listbox, then worry about how to use it in a timer.

    #191059
    autopilot
    Member

    every time you post you show the whole world so I’m not gonna repost all your posts… just read up instead of continuing to beg to be spoon feed…

    #191061
    autopilot
    Member

    @antigeek wrote:

    I had some kiddie try to comment on my post.. To make me look stupid… I should had just left it be..

    yep you should have. first i’m not a kiddie and your own post makes you look stupid all on its own. no one else needed to post to make you look stupid.

    #175100
    autopilot
    Member

    @deeva2 wrote:

    Autopilot said i need to create a breakpoint. Have no idea what the hell that is but I’ve got to figure it out so Im using google like my life depends on it

    check out Breakpoints and Debugging Tools

Viewing 15 posts - 1 through 15 (of 338 total)