Okay, gotcha.

I've actually run into similar problems with a couple apps I want AlwaysOnTop, like for instance a WinAmp-style mp3 player. My best guess is that the window may not stay on top if it isn't fully loaded when the SetWindowPos call is made. Doesn't make a ton of sense since you can send a hwnd, but whatever.

My workaround was to set up a short timer to set the form AlwaysOnTop on startup. The timer gets some short delay, like half second or so. It gets Enabled at the end of Form_Load, and when it fires it disables itself and then calls SetWindowPos. End result is that it runs only once, but the form is likely to be fully loaded before it gets called.

This isn't a 100% guaranteed solution. That WinAmp-style program I wrote will occasionally still fail to be always on top if the system is very busy when the program is first run. Despite that, it works correctly the vast majority of the time, so that's the solution I've stuck with.

If anyone has any better ideas, I'm definitely interested.