We will continue on from a previous post to show how to use SetWindowPos.
In our app, we are embedding a console app into WPF. However, we are not setting the window position, so it defaults to where the window is:

To set the position, use SetWindowPos. We will set the coordinates to 0, 0 and use Win32API.SWP_NOSIZE to ensure the window isn’t resized:
Win32API.SetWindowPos(cmdProcess.MainWindowHandle, Win32API.HWND_TOP, 0, 0, -1, -1, Win32API.SWP_NOSIZE);
Running this, we can see the window has been positioned correctly:


Keep learning. Keep building.
Explore AI, agents & Microsoft technology.
I share practical ideas, tutorials, and videos about AI, AI agents, Microsoft technologies, and the Power Platform.
Subscribe on YouTube →Carl de Souza Enterprise Architect at Microsoft · AI Technology Expert