I'm looking for the cleanest 开发者_如何学Cway to get all open windows and have access to moving/resizing them. I'd like to be able to get their current locations and move them where I'd like.
I want access to all windows, not just top level ones.
Thanks
One way to get the list of processes running is shown on this tutorial: Win32 APIs for Process Retrieval. Another way is through EnumDesktopWindows.
If at this point you have access to the window's handle then you can move it with SetWindowPos(). But if you only have access to it's title, then you'll need to use FindWindow() first and obtain a handle to that window.
Here is an example that shows how to do several different operations on a specific window, including how to move it to another location.
精彩评论