Why is a window not coming to top, inspite using setwindowpos?
<pre><code> m_pMainWnd-&gt;SetForegroundWindow(); 
m_pMainWnd-&gt;SetWindowPos(&amp;CWnd::wndTop, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
</code></pre>

<p>i used the above lines to bring one of my windows to top. But to my disappointment, nothing is happening. 
Although using &lt;&amp;CWnd::wndTopMost> is bringong the window to topmost, but no focus on it.
VS15, mfc</p>