For Cocoa, you can set the window level using:
[window setLevel:NSFloatingWindowLevel]
A floating window will appear above all other normal windows, even if your application is inactive.
If you want your application to be active, you can use:
[NSApp activateIgnoringOtherApps:YES]
and
[window makeKeyAndOrderFront:nil]
Ken aspeslagh
source share