If you really want to get all windows in the Windows session, you can first retrieve the HWMD of desktop and than get all its children. Please see:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms633504%28v=vs.85%29.aspx[
^],
http://msdn.microsoft.com/en-us/library/windows/desktop/ms633515%28v=vs.85%29.aspx[
^].
However, I'm not sure you need exactly that. Instead, you can get all the executing processes and then try to get a main window handle of each (which it may or may not have, and this attempt can throw an exception, so be careful). Here is how:
http://msdn.microsoft.com/en-us/library/1f3ys1f9.aspx[
^],
http://msdn.microsoft.com/en-us/library/x8b2hzk8.aspx[
^],
http://msdn.microsoft.com/en-us/library/z3w4xdc9.aspx[
^],
http://msdn.microsoft.com/en-us/library/system.diagnostics.process.mainwindowhandle.aspx[
^] (here, pay attention for the exceptions which can be thrown).
And finally, I'm not sure the whole idea is very useful. You cannot get 100% guarantee that a process or a window you find is exactly the one you really need. Both process and window title can accidentally be the same for some unrelated applications. Besides, you access to a separate process is quite limited, because the processes are well isolated. Chances are, you would need to use Office automation, or something else.
—SA