Click here to Skip to main content
15,894,539 members
Articles / Programming Languages / C++

How to Bring Window to Top with SetForegroundWindow()

Rate me:
Please Sign up or sign in to vote.
4.90/5 (27 votes)
27 Apr 2010CPOL2 min read 177.8K   38  
Use SetForegroundWindow() to bring window to the top
In this tip, you will learn how to bypass the limitation of using ::SetForegroundWindow() function.

Alternatives

Members may post updates or alternatives to this current article in order to show different approaches or add new features.

Please Sign up or sign in to vote.
19 Dec 2010Siarhei Boika
At first site, you can use BOOL WINAPI ShowWindow(__in HWND hWnd,__in int nCmdShow); with SW_RESTORE in nCmdShow (msd link) and maybe it needs to activate window before (not tested :))

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Engineer
Belarus Belarus
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions