1

I have created a simple WPF application within which I open UltraVNC Viewer. The first screen of UlraVNC Viewer opens on button click and I enter the IP of the target system which I want to access. Once I click Connect, control goes out of the WPF window and a child window of UltraVNC Viewer opens externally.

    [DllImport("user32.dll")]
    static extern IntPtr SetParent(IntPtr hwc, IntPtr hwp);
    private void Button_Click(object sender, RoutedEventArgs e)
    {
        Process vncProcess = Process.Start(@"C:\Program Files (x86)\UltraVNC\vncviewer.exe");

        Thread.Sleep(500);

        vncProcess.WaitForInputIdle();

        SetParent(vncProcess.MainWindowHandle, new WindowInteropHelper(this).Handle);
    }

How do I get the complete control of all child windows of UltraVNC within my WPF application? I don't want any child window's handle to go out of the WPF window.

Pratheek
  • 15
  • 1
  • 6

0 Answers0