Manipulating windows of other applications with .NET?
is it somehow possible to manipulate a window of another running application with code in my own with .NET (Windows 7)? I often use PuTTY and would find it very helpful if I could write a program which adds key shortcut which does the same as right clicking the taskbar in Windows 7 and开发者_运维百科 choosing "Show windows side by side" but not for all windows. Just for every open instance of PuTTy, so I have an overview of every open shh connection. I hope this doesn't sound to confusing. Anyway, to achiev this, I need to be able to manipulate other windows (in this case the PuTTY windows), e.g., resizing, moving, showing/hiding, etc., them.
If at all possible, I'd like to stick with C#, not C/C++
Thanks in advance!
This definitely should be possible, but will need a whole arsenal of platform invokes. The relevant WINAPI functions to invoke would be EnumWindows to retrieve all top-level windows, GetWindowInfo to retrieve the location, size and title of each window and finally MoveWindow to move and resize the appropriate windows.
Good luck!
精彩评论