Making a Window "Always On Top"

Making a window always visible, even if it's not the active window, is very easy; all you have to do is to enable "system modal" style in the window properties. But making a Dialog, SDI/MDI base application visible always at runtime requires more than just enabling some properties.

I've been working on an application, which can make itself always visible, as desired by the user. I tried to find an article in Codeguru that will solve the problem but I didn't find one, so after an hour of research I came up with this code; I hope you'll find it as useful as I did.

It's very easy to do. For dialog base applications all you have to do is to add this method to your dialog: