I have a button in my DialogWindow derived class and I want it to toggle the always on top mode for my window. so I do this:
setAlwaysOnTop( !isAlwaysOnTop() );
First click it becomes on top but on second click he stays on top and I cannot stop making it on top. I looked at the code and debugged it and got here:
void NativeDesktopWindow::setAlwaysOnTop (bool isOnTop)
{
SetWindowPos ((HWND)nativeHandle,
(isOnTop) ? HWND_TOPMOST : HWND_TOP,
0, 0, 0, 0,
SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
}
everything looks ok, first time isOnTop is true, second time its false but the window stays on top
any idea why?
thanks