C# - Problem moving process window

Started by
1 comment, last by ArthY303 12 years, 8 months ago
Hello! I'm trying to move the window of a process I create in my windows forms application. Here is my code:





[DllImport("user32.dll", SetLastError = true)]
private static extern bool MoveWindow(IntPtr hWnd, int X, int Y, int nWidth, int nHeight, bool bRepaint);

helpProcess = new Process();
helpProcess.StartInfo.FileName = "Help\\help.chm";
helpProcess.StartInfo.WindowStyle = ProcessWindowStyle.Normal;
helpProcess.Start();

MoveWindow(helpProcess.MainWindowHandle, 600, 600, 100, 100, true);






Thank you!

Advertisement
So what exactly is the problem? Compile error? Runtime error?
Hi! Let me explain a little better. I'm trying to open a .chm file through my application. For that I'm creating a new process. I am able to open the process and show the .chm file on the screen, no problems. However, I would like to move the .chm process window to another location than its default one. There is no compile error, or runtime error, the window just does not move.

This topic is closed to new replies.

Advertisement