Once you set your window to be styled WS_TOPMOST, it gets above all other windows, even previous topmost ones.
Fortunately, when the Z-Order of the windows changes, the affected windows get a window message WM_ADJUSTWINDOWPOS, in which you can realize that some other app has gone above your window, and you can set your window to be topmost again then.
It's a bit risky, as when this meets other similar code, they will "fight" being topmost, and probably cause flicker and eat up CPU.
Still, this seems to work in DSSaver, as Dave has pointed out.
For an example, please download the source code of DSSaver, and check one of the modules (preferable the Blank module, as that has the least additional code) on how it's done:
ftp://ftp.netlabs.org/pub/dssaver/dssaver_v20_srcbin.zipOnce unzipped, check the file Modules\Blank\Blank.c, search for lines containing "topmost", and you'll see how it's done in there.
Good luck!