Hmm, it turns out that the difference is not what Code::Blocks does at program start, but how PATH has been set.
I used to be using SDL 1.2.9 and upgraded to 1.2.12 recently. But the SDL.dll of both versions are on disk somewhere and depending on the situation either one or the other was found first.
And apparently with 1.2.12 you still get an SDL window, even if you say you don't want one, whereas 1.2.9 simply obeys :-)
So, on to the next hurdle. Anyone any suggestions as to why 1.2.12 insists on creating a window?