110,535
社区成员
发帖
与我相关
我的任务
分享
public static void RemoveFrame(Window window)
{
const long WS_THICKFRAME = 0x00040000L;
const int GWL_STYLE = -16;
const int SWP_FRAMECHANGED = 0x0020;
const int SWP_NOSIZE = 0x1;
const int SWP_NOMOVE = 0x2;
const int SWP_NOZORDER = 0x4;
IntPtr hwnd = new System.Windows.Interop.WindowInteropHelper(window).Handle;
SetWindowLong(hwnd, GWL_STYLE, GetWindowLong(hwnd, GWL_STYLE) ^ WS_THICKFRAME);
SetWindowPos(hwnd, IntPtr.Zero, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER);
}