Let us see how this works.
The API function BringWindowToTop accepts the hwnd (Handle to the Window, a unique id that all windows have) of the window that is to be brought on top. It brings the specified window to the top of the Z order. If the window is a top-level window, it is activated. If the window is a child window, the top-level parent window associated with the child window is activated.
While adequate for the purpose of explaining the function, the above example
is rather trivial in nature. I.e. it doesn't achieve anything practical. So
what would be a practical application for this? Hmmm... Say, you've got a long
process running in a window. Naturally you can expect your users to switch to
other windows during this period. However, once the process is complete you
may want to put this window on top. In such a case this code can be put to use.
Comments