I'm sure you've seen plenty of questions regarding this topic, and I have read many solutions, but I still have a problem. I have set the 'FormStyle' property in my form to 'fsStayOnTop', and in addition to that added the following code to my constructor to make sure my main window stays on top
SetWindowPos(handle, hwnd_TopMost,0,0,0,0, swp_NoMove or swp_NoSize);
But, apparently there is an uncaught exception in my application that doesn't stop my program from executing, but causes my app. to lose the 'stay on top' capability. Has anyone seen anything like this before? Is there a solution, other than 'make sure you catch all exceptions'? I am looking for the bug in my program so I can catch it, but I would like to prevent this from happening again.