List all programs without any window and kill them
Interesting problem.
Here's a snippet to help you start listing windows of apps:

tell application "System Events"
    set appProcs to every application process whose background only is false
    set appWins to ""
    repeat with eachProc in appProcs
        set appWinNum to title of every window of eachProc
-- Put "quit..." command into "if...then" :
        if (count of appWinNum) is equal to 0 then display ¬
                alert "No window found for app: \r\r" &amp; name of eachProc
        set appWins to appWins &amp; return &amp; name of eachProc &amp; ¬
                ":\n" &amp; appWinNum &amp; return
    end repeat
    display alert appWins
end tell


I didn't bother to set line feeds for multiple windows -- as there is a TREMENOUS drawback to this approach:

This script does not and will not find windows on each and every "space" set in Mission Control.
It's a pity, but as yet Mission Control is un-scriptable.   

Your best -if ugly- solution would be to have each app put frontmost, then checked, then quit ...