Ok, if I am understanding you you want your program to be able to close/modify another window even though the window is not your program. eg. Your program will close all open browsers. If this is the case then there might be something you can do.
You need to go trough each open window and decide if you want to do anything with it.
In the example, in the function EnumWindowsProc the hwnd is the handle to the currently being processed window. EnumWindows goes through each top-level window. So, in the example every window you would see on the taskbar is processed
Now that you have the hwnd you can just cal functions like DestroyWindow()/MoveWindow() or whatever.