Not sure if this is possible but is there a way to open up another program like notepad within the container of a WPF window? similiar to that of being able to open a web page using the webbrowser control?
Basically I would like to open notepad or other exe but keep it constrained within the WPF window container using xaml/c# code? not sure if possible?
NavigationService is for browser navigation within WPF. What you are trying to do is change to a different window TrainingFrm . To go to a different window, you should do this: private void conditioningBtn_Click(object sender, RoutedEventArgs e) { var newForm = new TrainingFrm(); //create your new form.
Window is the root control that must be used to hold/host other controls (e.g. Button) as container. Page is a control which can be hosted in other container controls like NavigationWindow or Frame. Page control has its own goal to serve like other controls (e.g. Button). Page is to create browser like applications.
Yes it is possible.
All you have to do is:
It is quite straightforward to do all of this. The effect is the entire Notepad window (or whatever application you started) appears and behaves exactly as if it were part of your WPF application.
managed to do this using the SetParent method
[DllImport("user32.dll", SetLastError = true)]
private static extern IntPtr SetParent(IntPtr hwc, IntPtr hwp);
so by getting the handles for wpf window and then the exe window, I was able to set the wpf window as parent so it gave a simulation of being embedded (also closed the title bar etc)
got help from here: http://channel9.msdn.com/forums/TechOff/250417-Hide-window-caption-in-c/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With