Git Product home page Git Product logo

applicationhost's Introduction

ApplicationHost

LGPL License.

Introduction

The ApplicationHost project is a prototype implementation for hosting .NET applications in a user control.

The idea for implementing this functionality came from the roozz hosted LINQPad instance. Roozz provides a mechanism for running .NET applications inside a Google Chrome page. The ApplicationHost project attempts to replicate this functionality, but instead of hosting the application inside a Google Chrome tab, it hosts it in a user control.

Usage

Using the ApplicationHost user control involves two steps:

  1. Place the AppHost control on a form;
  2. Call the StartApplication method with the path to the executable to execute.

These basic steps are enough to get yourself up and running. For a more comprehensive example, see MainForm.cs of the demo application.

The demo application shows how to run a .NET application inside the application host. To use the demo application, download e.g. LINQPad, place it in a location where it can be found by the demo application and uncomment the StartApplication line in the MainForm_Shown method in MainForm.cs.

Customizations

ApplicationHost works by hooking into Windows and watching for newly created windows. When the application host finds a new window, it transforms so that it is hosted in the user control instead of like a normal application. This mechanism is implemented using window filters. A window filter is a class that derives from the WindowFilter class. An implementation provides logic for matching a newly created window against some criteria. When it is matched, the filter will be used to attach the window to the application host, resize it and detach it from the application host.

The current implementation has been tested with Reflector and LINQPad. When you want to host an application which is not properly handled by the default filters, you can implement your own window filter by deriving from the WindowFilter class. Refer to the existing implementations for information on how to implement a custom WindowFilter.

The primary mechanism with which windows are matched is by WindowStyle and WindowStyleEx. The easiest way to discover the styles of a window is to use Spy++. This should be installed automatically with your Visual Studio installation.

To use a custom WindowFilter, add an instance of your custom filter to the WindowFilters collection before starting the application.

License

ApplicationHost is licensed under the LGPL 3.

applicationhost's People

Contributors

pvginkel avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.