<p>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.</p>

<p>How can I accomplish that in C++?</p>

<p><strong>Update.</strong></p>

<p>I would be more than happy to have a solution for Windows, MacOS, and Ubuntu (though, I'm not sure if MacOS and Ubuntu have such thing as 'system menu').</p>

Once you have another window's top level handle, you may be able to call
GetMenu()
to retrieve the Window's system menu and then modify it, eg:
```
```
HMENU hMenu = GetMenu(hwndNext);
```
```