xna 游戏窗口 在最小化,或者标题栏,被选中的情况下·游戏停止运行 ~~~求好的解决方案···
窗体最小化可以通过这个办法监听: http://blogs.msdn.com/b/jfoscoding/archive/2006/06/23/644336.aspx
关键代码是:
protected override void WndProc(ref Message m) { if (m.Msg == /*WM_SIZE*/ 0x0005) { this.Text = this.WindowState.ToString(); } base.WndProc(ref m); }
当判断标题栏选中时,你可以用这个消息: http://msdn.microsoft.com/en-us/library/windows/desktop/ms645620(v=vs.85).aspx
然后做这样的判断: http://social.msdn.microsoft.com/Forums/en-SG/winforms/thread/bdfe1f04-62a4-420c-8714-1c765612de38
希望有用.
Mike Feng MSDN Community Support | Feedback to us Please remember to mark the replies as answers if they help and unmark them if they provide no help.