日期:2014-05-18 浏览次数:20793 次
if (m.Msg == WM_NCLBUTTONDOWN) { int isDragFullWindow; // 1,查询当前系统“拖动显示窗口内容”设置 SystemParametersInfo(SPI_GETDRAGFULLWINDOWS,0, out isDragFullWindow,0); // 2,如果需要修改设置,则在每次进入WM_NCLBUTTONDOWN默认处理之前修改 if ( isDragFullWindow == 1) { SystemParametersInfo(SPI_SETDRAGFULLWINDOWS, 0, 0, 0); } // 3,to do something base.WndProc(ref m); // 4,处理完毕后,还原系统设置 if (isDragFullWindow == 1) { SystemParametersInfo(SPI_SETDRAGFULLWINDOWS, 0, 1, 0); } }
[DllImport("user32.dll",CharSet = CharSet.Auto)] public static extern int SystemParametersInfo(int uAction, int uParam,out int lpvParam, intfuWinIni);