Forum Replies Created
-
AuthorPosts
-
March 22, 2015 at 11:15 am #186436autopilotMember
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.
October 19, 2014 at 4:10 pm #190595autopilotMemberSee instructions in Programming and Requiring Admin Rights [VB2010]
October 19, 2014 at 3:33 pm #190597autopilotMemberMake 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.
August 6, 2013 at 2:39 am #186785autopilotMember@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
July 17, 2013 at 5:07 am #186094autopilotMember@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.
July 12, 2013 at 7:52 pm #190229autopilotMemberNice job on the video’s! Thanks for taking the time and putting forth the effort to help others learn.
July 11, 2013 at 2:37 am #190630autopilotMemberJuly 9, 2013 at 6:24 am #190635autopilotMemberOk, 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.
July 9, 2013 at 12:25 am #190637autopilotMemberThanks 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.
July 8, 2013 at 7:25 pm #190640autopilotMember@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
June 30, 2013 at 3:40 am #187308autopilotMemberWe 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…
June 28, 2013 at 7:13 pm #187313autopilotMemberBreak 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.
June 3, 2013 at 12:34 am #191059autopilotMemberevery 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…
June 2, 2013 at 3:46 pm #191061autopilotMember@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.
May 29, 2013 at 12:42 pm #175100 -
AuthorPosts