How to check if window is “Always on top”?

I think you can do this:

DWORD dwExStyle = ::GetWindowLong(m_hWnd, GWL_EXSTYLE);

if ((dwExStyle & WS_EX_TOPMOST) != 0)
{
    // do stuff
}

Here’s the MSDN link – http://msdn.microsoft.com/en-us/library/ms633584(VS.85).aspx

And here’s the MSDN link to the extended styles – http://msdn.microsoft.com/en-us/library/ff700543(v=VS.85).aspx – topmost is currently listed as “TBD” 🙂

Leave a Comment