http://blog.csdn.net/keyrainie/article/details/8513802 http://www.cnblogs.com/qq4004229/archive/2012/05/28/2521611.html http://www.cnblogs.com/zeroone/p/4176887.html using System; using System.Collections.Generic; using System.ComponentModel; using S
我们也许会有一些奇怪的需求,比如说禁止一个外部程序的窗口大小更改. 如果我们没法修改外部程序的代码,那要怎么做呢? 当然,我们可以通过DLL注入目标程序的方式去Hook或registry一个事件来检测,但这也太麻烦了吧. 如果想做非侵入式的,那就需要用到Windows下的系统函数去完成工作. 查来查去,最好用的是MoveWindow函数 1 MoveWindow(IntPtr hWnd, int X, int Y, int nWidth, int nHeight, bool bRepaint)