'what's the proper way to show exe within my application?

Currently I'm using SetParent() to do that. It this "hacky"? is there a better way to do that? if so, how?

here's what I'm using currently:

    void LoadApplication(string path, IntPtr handle)
    {
        var p = Process.Start(path);
        p.WaitForInputIdle();
        Thread.Sleep(1000);
        SetParent(p.MainWindowHandle, handle);
        SetWindowPos(p.MainWindowHandle, 0, 0, 0, 0, 0, 0x0001 | 0x0040);
    } 


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source