2

How to attach my WPF window with Calculator which is a Desktop application?

My requirement is to when i move WPF window, calculator application should come together and vice-versa.

Please guide me the correct way to achieve my objective.

Sathyajith Bhat
  • 21,321
  • 22
  • 95
  • 134
Ramasamy
  • 21
  • 1

1 Answers1

2

First, I would assume that you are using the standard Windows Calculator app started as:

System.Diagnostics.Process.Start("calc.exe");

// or, alternatively

System.Diagnostics.Process.Start("calc");

If so, then you can achieve your goal by using Win32 DLL functions:

[DllImport("user32")]
private static extern bool SetWindowPos(IntPtr hWnd, IntPtr hWndInsertAfter, int X, int Y, int cx, int cy, int uFlags)

as detailed in: Hosting external app in WPF window

Community
  • 1
  • 1
Alexander Bell
  • 7,842
  • 3
  • 26
  • 42