Sunday, June 3, 2018

How to embed window content in a WPF application and manipulate how the content is drawn

I'd love for my program to be able to be cross platform, but I think it is going to have to be limited to a single platform (or have a separate codebase for each OS).

I want to write a program with a UI and hotkeys that I can use to manage other programs. Specifically I want to be able to use my program to: 1) launch a particular program - I would put the path to the exe in a config file and somehow my program would launch an instance of the application. For clarification, I'll refer to the program that I launch as program B and the program I'm writing to launch it as program A. 2) manipulate how the window of program B is drawn. Ideally, I'd like to be able to draw just the main content of program B (so not drawing the title bar of the window, for example) and have B's content be drawn within program A's window - kind of like a frame on a webpage, except in a WPF application in this case (doesn't have to be WPF but that's probably the easiest option). I'd also like to be able to draw just parts of the window (e.g. drawing just the top-left 100x100 pixels).

I'm having trouble finding a way to mess with how the window is drawn (drawing just the main content, or drawing specific regions only, and embedding that within a WPF window). Is what I'm asking even possible? If so, how would I approach this? Something tells me that I'm going to have to rely on the Win32 API instead of .NET, but I really don't know the best way to make this happen, and Google isn't of much help (or I'm Googling the wrong thing).

How to embed window content in a WPF application and manipulate how the content is drawn Click here
  • Blogger Comment
  • Facebook Comment

0 comments:

Post a Comment

The webdev Team