DllImport("user32.dll")]
static extern long GetWindowLong(IntPtr hWnd, int nIndex)
[DllImport("user32.dll")]
static extern long SetWindowLong(IntPtr hWnd, int nIndex, long value)
private void Form1_Load(object sender, EventArgs e)
{
foreach (Control c in this.Controls)
{
if (c is MdiClient)
{
IntPtr h = c.Handle
SetWindowLong(h, -16, GetWindowLong(h, -16) &~0x00800000L)
SetWindowLong(h, -20, GetWindowLong(h, -20) &~0x00000200L)
break
}
}
}
有一棚闹个方法是自己控制非客户区的大掘基小:void CMainFrame::OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS FAR* lpncsp)
{
void CMainFrame::OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS FAR* lpncsp)
{
CFrameWnd::OnNcCalcSize(bCalcValidRects, lpncsp)
lpncsp->rgrc[0].bottom+=4
lpncsp->rgrc[0].left-=4
lpncsp->rgrc[0].right+=4
}
上链散罩面的这些数值可以用GetSystemMetrics获得以便在用户改变系统窗口边框时你的程序也能正确运行。。。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)