如何检测窗口大小的调整用的Windows7 [英] How to detect window was resized by Windows7

查看:191
本文介绍了如何检测窗口大小的调整用的Windows7的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

[问题]

1 。如何检测的窗口(WPF)的大小由 Aero对齐?那么我可以忽略新的大小和位置。

1. How to detect the window (WPF) was resized by Aero Snap? then i can ignore the new size and position.

谢谢您的回答和评论的进步。

Thanks for your answer and comments in advance.

推荐答案

在出口处,呼叫的 GetWindowPlacement 。这将返回当前窗口的大小和位置,以及是否最小化,最大化或restord,它也会给你最新的恢复窗口的大小和位置。

On exit, Call GetWindowPlacement. This will return the current window size and position, and whether you are minimized, maximized or restord, it will also give you the latest 'restored' window size and position.

所以,你不必跟踪更改您的窗口位置,只问当你需要它。

So you don't have to track changes to your window position, just ask when you need it.

typedef struct _WINDOWPLACEMENT {
    UINT length;
    UINT flags;
    UINT showCmd;
    POINT ptMinPosition;
    POINT ptMaxPosition;
    RECT rcNormalPosition;
} WINDOWPLACEMENT;

这篇关于如何检测窗口大小的调整用的Windows7的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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