只能用这种比较笨的办法来禁止.利用定时器,来检测窗口的状态
struct TargetWinInfo
{
public Window TagertWin;
public Double Height;
public Double Width;
}
public class PreventMaxInWin7
{
private DispatcherTimer dt;
private const int TickTime = 120;
private List<TargetWinInfo> PreventTarget;
private TargetWinInfo _TargetWinInfo;
public PreventMaxInWin7()
{
PreventTarget = new List<TargetWinInfo>();
dt = new DispatcherTimer();
dt.Interval = TimeSpan.FromMilliseconds(TickTime);
dt.Tick += new EventHandler(dt_Tick);
dt.Start();
}
public PreventMaxInWin7(Window Win)
{
PreventTarget = new List<TargetWinInfo>();
dt = new DispatcherTimer();
dt.Interval = TimeSpan.FromMilliseconds(TickTime);
dt.Tick += new EventHandler(dt_Tick);