C# and UI Automation for external exe - wpf

I have a desktop application in wpf than open a new external process (exe).
I can detect this external process window is opened/closed with:
Automation.AddAutomationEventHandler(WindowPattern.WindowOpenedEvent,...
But... how to detect new events inside this window? For example, inside the windows, when a new dialog is shown, like print settings subwindow.
Thank you
Regards

Related

Get thumbnail image of the main page of all the running process in window

In my app I want to enable the user to see a small thumbnail, of the main window, for all the running process (that has window).
My app is a regular window desktop application (written in wpf)
I don't want to bring the other processes to foreground before getting the thumbnails
It will be nice if most of the code will be written in .net with PInvoke (if needed) but native is o.k also
Thanks
using DWM I managed to capture the main window for all running process. I've used two great examples (thank a lot for that).
ByBart De Smet For Windows Form:
http://community.bartdesmet.net/blogs/bart/archive/2006/10/05/4495.aspx
For Wpf:
http://www.11011.net/archives/000653.html

Find Source dialog opens when starting WPF application

I am trying to use a Control made by somebody else and defined in a .dll-file.
I have referenced the dll in my project and imported namespace in the XAML.
I have also set up the control in XAML. At design time I see the control ok.
When launching the app, a dialog window opens with a title "Find Source: MyView.cs"
From Object Browser, I see that this class exists under the dll.
What does this mean?

Creating a multiple WPF application using Catel

I have started a new project using WPF and Catel and I want to be able to have multiple windows without ownership. I have been able to create an application with a standard window and which creates dialogs. I would like to find an example or tutorial on how to create a window and then close the current window.
Example:
Window1 -> Select Open Window2 Button -> Open Window2 -> Close Window1
Thanks
When you call Show on the UIVisualizer, it should show the window non-modal. After calling the UIVisualizer service, just call CloseViewModel on yourself and the current window should close.
It appears that the above answer is correct as long as you are not closing the startup window.
It appears that when you close the ViewModel that is targeted as your startup View\ViewModel when you close it, it closes the whole application.
My question now.. How can I prevent this from happening.

WinAPI Copy System Menu to new Window

I am docking another application's window inside of my WPF window using HwndHost. To do this, I have to set the WS_CHILD style attribute of the window I am docking and I lose the system menu of that window which is not acceptable. Using HwndHost there is no way around this since it will throw exceptions if that attribute is not set.
My question is;
Since my application doesn't use a system menu, is there any way to directly copy the system menu of the docked application to my app's window? The WinAPI menu functions I'm aware of would all require me to build up the menus from scratch and I don't know how I could hook those menu into the hosted application.
I'm not sure if it matters, but the two windows are within the same process. My application is a plugin of the application window I am docking.
Use GetSystemMenu to get an HMENU for the system menu for the given window. You should be able to cross-reference your own window's system menu with the docked application's system menu, copy across any that your own window doesn't have, and forward them on by handling and forwarding the relevant WM_SYSCOMMAND messages. Or maybe just copy the whole system menu and forward all of them on.
This will probably require a bit of trial and error to make it all work (especially if the docked application isn't expecting to be used this way...) but the above might help get things started.

Custom window for CHM help project

We're developing in WPF and are using custom borderless windows like the new Office 2013 windows. Now we are creating CHM help using RoboHelp.
I'd like to know if there's a way to launch a CHM file, but somehow hook into it so that it loads in a custom window that I specify, rather than the default window. Even better would be some kind of CHM display control that could be embedded in a WPF window, analogous to the way you can embed an HTML browser control in a WPF window. That way I could compile the CHM content with RoboHelp, but display it in our own custom borderless window that's part of our application.
CHM is no longer supported by MS since Vista, so you might want to consider using RoboHelp to generate Webhelp instead, and display that in a browser control as you described. Webhelp also supports context sensitivity via the URL, if that is needed.

Resources