How to tail text from a specific control from an external program? - c#

I have tried inspecting this window using Inspect.exe provided on Windows' 8.1 Software Development Kit Testing Tools. I couldn't seem to identify the control handle for this huge rich textbox like control. I could however get the control handle of the edit box below the textbox. I was hoping I could talk directly to the control and use a library such as WindowScrape to get the text.
I believe the external program is created in VC++ . If that helps.
This is the window. I am trying to get text from that is boxed in red color. This is a chat window , messages come in every 5 to 10 seconds. This box scrolls automatically. I want to tail through the text and get the latest message.
Is there any other way to accomplish this?
Tesseract maybe, but I do not know where to start to monitor a specific position relative to the window. So that when I move the window it will still be able to monitor that window.

Can you provide a screenshot of Inspect results showing both the tree and details panes while selecting the chat box?

Related

Microsoft Office UI Element Coordinates

This isn't my area of programming, but I have one of my junior programmers working on a Windows application that needs to reference the UI elements of a Microsoft Office application, namely to get the coordinates of a button or menu item, such as the coordinates of the compose email button in Outlook or the edit menu item label frame in Excel, for example.
Specifically, is there a way of programatically obtaining the exact coordinates of a UI element from an Office application that is running with a visible window? Is there some kind of API Microsoft provides to programmers to allow determining object metrics.
So far, this is all I could find:
https://msdn.microsoft.com/en-
us/library/system.windows.controls.frame(v=vs.110).aspx
Thanks for any help!
You can extract the coordinate in developer mode of where the mouse is. So by hovering over a button you can see where the coordinate is but any change in resolution or screen size will throw this off.
Many UI options have hotkeys. Have you thought about using those? e.g if you wanna code it to click on file, fire a "alt+f" event and it will

WPF / C# Display of Acrobat Toolbar

I'm creating a WPF application that has viewing of PFDs built into it. I use WindowsFormsHost method to view the PDF:
<WindowsFormsHost x:Name="PDFViwer"/>
var pdfViwer = new AdobePDFViewer(#"E:\temp\test\testFile1C.pdf");
this.PDFViwer.Child = pdfViwer;
I've noticed that when I view some files (such as electronic version of books), the Acrobat Toolbar will display automatically, such as this:
However, some other files that are.. let's say created from a Word Document or sent to print to PDF, will display the document in Read Mode, which brings up a menu bar at the bottom if you hover towards that area, such as this:
I like the second better than the first; however, due to the fact that some users might not know that hovering towards the bottom will display those options, I want to be able to force those options to display.
If I click the Acrobat symbol on the popup menu that has a caption of Show Acrobat Toolbar, it'll go into the mode where the Toolbar will display at the top... but once again, the user has to know of the popup menu existence in the Read Mode.
Is there a way to force the Toolbar to display by default or a way to make a custom button force mode switch?
Adobe doesn't have the greatest developer documentation in the world... why can't everyone be like Oracle. They'll provide a list of methods, but don't provide a clear list of possible parameters or a very clear description of those methods.. So I've been playing with this.axAcroPDF1 methods and one of them does something halfway to what I'm trying to accomplish: this.axAcroPDF1.setShowToolBar(true). However, what that does is displays the Adobe Reader Toolbar at the top of the document while still in Read Mode. So, I have a toolbar on top and the dynamic toolbar on bottom, which is a bit messy in my opinion. I can't figure out how to switch modes... there are more methods, but I can't find the list of available enumeration parameters for them.
I don't believe how ridiculously hard it is to find information on Adobe products if you're a developer... I guess I was spoiled by Oracle's incredible documentation of Java. Anyways, I've even read through this "lovely" document, and I still can't figure it out: http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/iac_api_reference.pdf
Try to customize current view as described in link

Windows application and Spy++

I am unable to figure out why I can use Spy++ to get handle, window class etc of some windows application. For example, iexplore.exe, it just doesn't work on url text box or any text, edit box area if any in the page loaded; there are also windows application I get only the outer layer's properties whereas its internal buttons, textbox or combox are inaccessible. In these applications what should I do to reach them ? Thank you :)
These programs use windowless controls.
Instead of using standard Windows controls, they draw and process everything themselves within one giant container.

Right click, text capture

I have a c# application that runs in the bottom right corner of the page, i was wondering how i could go about making my application appear when the user selects some text anywhere (say a pdf, browser etc) and then right clicks, goes to my custome selection bit say and it pastes that text in to my running application.
If anyone made any sense of that could you advise me in to what i need to be researching to get it done.
Thanks
I've got this dictionary which does something similar.
Here's its mode of operation (or at least what I think it does)
When there is a double click, it sends a key command (probably Ctrl+C) to copy the selected text. It then reads the text from the clipboard.
For your purpose, you could implement the mouse listening and sending keystrokes with this article I found on CodeProject: InputManager library.
You then retrieve the copied text from the clipboard and do whatever you want with it.
Have a look at a Clipboard monitor
You can hook into the windows messaging api, probably there is a Text-selected event.

Non intrusive 'live' help system

I'm searching a C# component or code snipped that does something like that:
I want to inform new users about the most important program functions if he opens a new window for example.
It should be a box showing text (formated if possible) that is of course not modal and has some mechanism to 'go out of the way' if the user enters the textbox area. So that he can access what's underneath it. Alternativly the window could also stick to the border of the window, but there needs to be a way that this also works if the window is maximized.
So I want to present him with a short introduction of what he can do in every corner of my app most painlessly.
Thank you!
I use a "bar" at the top of every window to display some information about the current window/dialog.
Use tooltips. They can be programmatically controlled, and you can have them appear at will. You'll need to add the functionality to your app to keep track of what tooltips have been shown to the user already.
You can add a "balloon" style by setting the IsBalloon property to true.
You can also replace them with smaller descriptions for when the user wants to hover over the control and have them displayed again.
I'm already using tooltips heavily. However, they aren't very practical when displaying bigger amounts of data and they are bound to specific user actions.
Have you considered having a contextual menu for each form / page which contains links to Adobe Captivate style presentations for each available task? That way the user can investigate an example of how to achieve a task relating to what they are trying to achieve from within the application / site.
This approach would require a good deal of maintenance and management if your code changes regularly but coordinating it with a training department can provide rich help features in your application.
See http://www.adobe.com/products/captivate/ for more information.

Categories