I need to enumerate all running applications. In particular, all top windows. And for every window I need to add my custom item to the system menu of that window.
Ho
You can use EnumWindows() to enumerate top level Windows.
I don't have a specific answer for the second part of your question, but if you subclass the window, I imagine you can modify the system menu.
EDIT: or do what Chris said: call GetMenu()