草庐IT

SetWindowPlacement

全部标签

windows - SetWindowPlacement 不移动某些窗口

我正在编写一个Windows10C#程序来保存和恢复打开的窗口(无论是显示还是最小化)的位置和大小。以下循环适用于几乎所有窗口,但不适用于资源监视器或计算机管理窗口:foreach(KeyValuePairentryinopenWindows){IntPtrhWnd=entry.Key;Rectanglerect=entry.Value.Rect;WINDOWPLACEMENTwpl=newWINDOWPLACEMENT();if(!GetWindowPlacement(hWnd,refwpl))continue;wpl.rcNormalPosition=rect;SetWindowP