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

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

问题描述

我试图确定一个窗口控件的可见性已被隐藏或启用与CWnd :: ShowWindow()。 (或:: ShowWindow(hWnd,nCmdShow))



我不能简单地使用:: IsWindowVisible(hWnd)作为控件是在选项卡上, out,导致IsWindowVisible返回FALSE。



有一种方法可以获得SW_SHOW / HIDE(或其他)窗口状态或者需要使用ShowWindow ()并相应地重置?



编辑:
,因为控件已启用(或禁用)显示,但可能不是当前可见,切换ot,我认为它的SW_SHOW状态将保持不变,即使窗口本身没有实际切换。如果我不切实际的期望,这是罚款。



所以我真的在寻找'可以显示这个窗口/控件'

解决方案

http://msdn.microsoft.com/en-us/library/ms633518%28v=vs.85%29.aspx\"> GetWindowPlacement 。它填充 WINDOWPLACEMENT 结构,其中包含字段 showCmd


showCmd

指定当前节目窗口的状态。此成员可以是以下值之一。



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 ::IsWindowVisible(hWnd) as the control is on a tab sheet, which may itself be switched out, causing IsWindowVisible to return FALSE.

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?

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'

解决方案

Use GetWindowPlacement. It fills WINDOWPLACEMENT structure, which has field 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天全站免登陆