Yes, it is possible using the Windows API.
This post contains information on how to get all window handlers from active processes: http://www.c-sharpcorner.com/Forums/ShowMessages.aspx?ThreadID=35545
using System; using System.Diagnostics; class Program { static void Main() { Process[] procs = Process.GetProcesses(); IntPtr hWnd; foreach(Process proc in procs) { if ((hWnd = proc.MainWindowHandle) != IntPtr.Zero) { Console.WriteLine("{0} : {1}", proc.ProcessName, hWnd); } } } }
And then you can move the window using the Windows API: http://www.devasp.net/net/articles/display/689.html
[DllImport("User32.dll", ExactSpelling = true, CharSet = System.Runtime.InteropServices.CharSet.Auto)] private static extern bool MoveWindow(IntPtr hWnd, int x, int y, int cx, int cy, bool repaint); ... MoveWindow((IntPtr)handle, (trackBar1.Value*80), 20 , (trackBar1.Value*80)-800, 120, true);
The following are the parameters of the MoveWindow function:
To move the window, we use the MoveWindow function, which takes the handle of the window, the coordinates for the top corner, as well as the desired width and height of the window, based on the coordinate screen. The MoveWindow function is defined as:
MoveWindow (HWND hWnd, int nX, int nY, int nWidth, int nHeight, BOOL bRepaint);
The bRepaint flag determines whether the client area should be invalidated. A WM_PAINT message to send, allowing the client area to be repainted. As an aside, screen coordinates can be obtained using a call similar to GetClientRect (GetDesktopWindow (), & rcDesktop), where rcDesktop is a variable of type RECT, the accepted link.
( http://windows-programming.suite101.com/article.cfm/client_area_size_with_movewindow )