The program/utility xkill allows you to kill X programs using their windows. It is packaged as a standard part of the X Window System distribution (used on Unix and clones), along with xterm, xclock, xload, twm and xdm. To invoke it, simply type 'xkill' in a terminal or select it from a menu. You will be given a nice 'crosshairs' cursor, and told to click the window you wish to kill.
'xkill' is mainly used in the vanilla cursor form, but can also do some other things, like killing programs with a certain X11 ID or killing all the clients on the screeen (bad idea). You can also select a different mouse button with which to kill, instead of the normal one, allowing you to fish through your windows, if you have to. Note that killing non-GUI processes, such as apache or dhcpd must be done with the 'kill' or 'killall' command instead.
Xkill is still in any modern system running X11, but modern desktop environments have a timeout and "Force quit" option for the window close button (the X) on applications.
Like everything in the base system, xkill is written in C and Xlib.
Why? Because it's there.
Thanks for those softlinks, by the way, especially the T.S. Eliot one.