how to find a window's SW_SHOW/SW_HIDE status

前端 未结 6 1846
野趣味
野趣味 2021-01-01 22:44

I am trying to determine a window control\'s visibility that has been hidden or enabled with CWnd::ShowWindow(). (or ::ShowWindow(hWnd,nCmdShow))

I cannot simply use

6条回答
  •  误落风尘
    2021-01-01 23:05

    GetWindowPlacement() function will work only if the window is maximized or minimized. Otherwise, showCmd member will return SW_SHOWNORMAL also when window is hidden, as pointed out in this StackOverflow answer: WINDOWPLACEMENT's showCmd... always 1?

    You can use the more straightforward boolean function IsWindowVisible() to get if the specified Window is in a visible state or not.

提交回复
热议问题