Brining a window to the foreground

Hi !
I would like it whenever the mouse hovers over a window that isn't in the foreground to bring that window to the foreground. It has to be for any window not just the program's.
What are some functions I should be looking at to do this ?

Thanks !
Last edited on
My first thought is to use SetWindowsHookEx to install a WH_GETMESSAGE hook. From there you can determine which window the mouse is over and then call SetWindowPos to bring it to the foreground.


Last edited on
Thanks knn9.
Do you know of a simple example showing how a global hook works ?
The MSDN explanation is a little heavy for me.

Would SetWindowPos be better than ShowWindow for the purpose I mentioned ?
Topic archived. No new replies allowed.