真のボーダレス・ウィンドウを達成するために、特殊効果の問題は消え復元/最小化win10でDuiLibボーダレス窓

私は、コードの上に直接、長ったらしい愛していません

int ProcNCCalcSize(UINT message, WPARAM wParam, LPARAM lParam)
{
	int xFrame = 0; /*左右边框的厚度*/
	int yFrame = 0; /*下边框的厚度*/
	int nTHight = 0; /*标题栏的高度*/
	NCCALCSIZE_PARAMS * p;
	RECT * rc;


	RECT aRect;
	RECT bRect;
	RECT bcRect;

		

	if (wParam == TRUE)
	{
		p = (NCCALCSIZE_PARAMS *)lParam; /*矩形是B A AC,目标是改成BC B A*/


		CopyRect(&aRect, &p->rgrc[1]);
		CopyRect(&bRect, &p->rgrc[0]);


		//修正最大化时无边框窗口客户区的偏移
		if (bRect.left < 0)
		{
			bRect.right += bRect.left;
			bRect.left = 0;
		}

		if (bRect.top < 0)
		{
			bRect.bottom += bRect.top;
			bRect.top = 0;
		}

		/*指定BC的矩形的位置*/
		bcRect.left = bRect.left + xFrame;
		bcRect.top = bRect.top + nTHight;
		bcRect.right = bRect.right - xFrame;
		bcRect.bottom = bRect.bottom - yFrame;


		/*各个矩形归位*/
		CopyRect(&p->rgrc[0], &bcRect);
		CopyRect(&p->rgrc[1], &bRect);
		CopyRect(&p->rgrc[2], &aRect);
	}
	else
	{
		rc = (RECT *)lParam;


		rc->left = rc->left + xFrame;
		rc->top = rc->top + nTHight;
		rc->right = rc->right - xFrame;
		rc->bottom = rc->bottom - yFrame;
	}
	return GetLastError();
}

 

84元記事公開 ウォン称賛15 ビューに14万+を

おすすめ

転載: blog.csdn.net/TDGX2004/article/details/100555508