Listening to textChanged from another application - c#

Is it possible to know when a text from another application has changed?
Currently I can capture the Click event using globalhooks and WindowFromPoint()

Related

UI Automation monitoring

I'm trying to monitor an external WPF application(no source-code) from a local app, and see when a button is clicked in c#.
So far i've been exploring UI Automation's options, and i saw that it works similar if not same to the Inspect.exe tool.
The problem i have is, the WPF form i need to monitor does not contain the button i need directly, as a sub-control. Instead, first you need to log in, then click a few buttons and then finally a new window opens, and it contains the button i need to check.
So my question is, is there a way this to be monitored with the UI Automation? I know i can trigger an event when the main form starts a new process, and the button is clicked, but how do i handle all the steps in between?
(Or in other words how can i trigger an event when the final window containing the button i need to check is actually open)

How to keep the keyboard open after completed event fired on a Xamarin entry?

Everyone just want to hide the keyboard, but it closes automatically.
I want to keep the keyboard open and keep the entry focused after the completed event fired on a Xamarin entry control or in other words, I do not want the entry control blurred.

Hook button press event in another application

I’ve to develop an application that has to track the button press event of a button which in another application. After some research I found that Windows Hooks might work for me and I’d develop a sample application that hooks the button press event in another application.
The problem I’m facing with that sample application, gets the control after the button is pressed whereas I need to get the control before the button is pressed i.e., First the sample application should get the control so, that it can grab the information from that dialog and, then after the control goes to the actual event handler of that button in other application.
I’ve already tried WH_CALLWNDPROC, WH_CALLWNDPROCRET, WH_GETMESSAGE, & WH_SYSMSGFILTER. Using WH_CALLWNDPROC hook I’m able to hook the button press but my application gets the control after the button press event handler is executed but my requirement is to get the control before the button press event handler is executed.
I’ve used the Wilson GlobalHooks to hook the application in C#. Here is the link to it.

Converting WPF KeyDown events to a string

I have an application that can receive key strokes from a barcode scanner (which to Windows just looks like a USB keyboard).
My requirement is for the user to be able to use the barcode scanner anywhere in the application (any window, any tab) and have it react accordingly. I already have a version of this working by monitoring for PreviewTextInput events in my App.xaml.cs and firing off my own custom BarcodeArrived event. The problem with this is that if the user has put focus on a control that does not accept Text Input, then PreviewTextInput never fires.
PreviewKeyDown does always fire, but the data it presents is ugly and I can't seem to find anyway of translating KeyDown events to a normalized string. I found a Stack Overflow article at "Convert received keys in PreviewKeyDown to a string" seemed promising, but it does not appear that I can wire this in my App.xaml.cs (no dependency object).
Any thoughts or suggestions would be great. Or, as an alternative, at least a way of detecting which keyboard the input is coming from, at which point using PreviewKeyDown might be a viable option because I can assume a "dumbed down" input stream.

Catch windows shutdown event in a wpf application

I have a c# WPF application that needs to save data when it closes. The Window Closing/Closed events work fine if the user closes the program, but they do not get called if the user logs off/shutdown the computer.
I have found ways to catch this event in winforms programs (here, and here). but i cant figure out how to achieve this in a WPF application.
I'm trying to halt the shutdown until my program is ready to exit
There is a built-in event Application.SessionEnding - this event fires when the user logs off or shuts down the computer... you just need to subscribe to that and put your code to save date etc. in there...

Categories