PDA

View Full Version : CL_Win32Window::bring_to_front alternative: BringWindowToTop doesn't always work



rmorison
02-23-2010, 06:38 AM
For the app I'm porting, we learned that the BringWindowToTop(hwnd) used in CL_Win32Window::bring_to_front() doesn't always "bring to front". The use case is when the user has clicked on a window and the dwm has brought that window to top (and I believe the mouse is still down), if another window, via a timer or whatever, tries to go on top of that clicked window, BringWindowToTop doesn't bring the second window above the clicked window.

However


SetWindowPos( hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE )

does the trick. I've changed my local source to such.