How do I define the window icon used by window managers?

view story

http://askubuntu.com – I would like to change the icons displayed in window title bars: The window icons appear to be unrelated to the icons used by launchers and docks, as they don't follow the ones defined in their respective .desktop files. In the example above the lower window (Recoll) is lacking a proper icon and showing a stock one instead, even though its launcher comes with an icon. So my question is: Where can I find these window icons in my filesystem and how do I define a new one for an application of my choice? (HowTos)