如何查找窗口的 SW_SHOW/SW_HIDE 状态 [英] how to find a window's SW_SHOW/SW_HIDE status

查看:27
本文介绍了如何查找窗口的 SW_SHOW/SW_HIDE 状态的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试确定已使用 CWnd::ShowWindow() 隐藏或启用的窗口控件的可见性.(或::ShowWindow(hWnd,nCmdShow))

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

我不能简单地使用 ::IsWindowVisible(hWnd),因为控件位于选项卡上,它本身可能会被切换,导致 IsWindowVisible 返回 FALSE.

I cannot simply use ::IsWindowVisible(hWnd) as the control is on a tab sheet, which may itself be switched out, causing IsWindowVisible to return FALSE.

有没有办法获得 SW_SHOW/HIDE(或其他)窗口状态,还是我需要使用 ShowWindow() 的 retun 值并相应地重置?

Is there a way to get the SW_SHOW/HIDE (or others) window status or do I need to use the retun value of ShowWindow() and reset accordingly?

由于控件已启用(或禁用)以显示,但当前可能不可见,因为选项卡已切换,我认为它的 SW_SHOW 状态将保持不变,即使窗口本身实际上并未打开.如果我的期望是不现实的.

edit: as the control is enabled (or disabled) to show, but may not be currently visible, as the tab is switched ot, I would think that it's SW_SHOW status would remain the same, even if the window itself is not actually switched in. If I'm unrealistic in my expectations that that's fine.

所以我真的在寻找可以显示此窗口/控件吗"

So really I'm looking for 'can this window/control be shown'

推荐答案

使用GetWindowPlacement.它填充 WINDOWPLACEMENT 结构,其中有字段 <代码>showCmd.

Use GetWindowPlacement. It fills WINDOWPLACEMENT structure, which has field showCmd.

showCmd
指定窗口的当前显示状态.此成员可以是以下值之一.

showCmd
Specifies the current show state of the window. This member can be one of the following values.

这篇关于如何查找窗口的 SW_SHOW/SW_HIDE 状态的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆