When you try to add the style WS_EX_TOPMOST to a top-level window to make it always-on-top, this extended style just isn't applied.
The docs to WS_EX_TOPMOST say:
To add or remove this style, use the SetWindowPos function.
So, SetWindowPos() with HWND_TOPMOST or HWND_NOTOPMOST, respectively, should be used, if this extended style is toggled.