對話框居中

		CRect   rc;
		
		CRect	thisRect;
		GetWindowRect(&thisRect);
		SystemParametersInfo(SPI_GETWORKAREA,0,&rc,0); 

		m_rcClient.left	= ((rc.Width() - thisRect.Width()) >> 1);
		m_rcClient.right	= m_rcClient.left + thisRect.Width();
		m_rcClient.top	= ((rc.Height() - thisRect.Height()) >> 1);
		m_rcClient.bottom= m_rcClient.top + thisRect.Height();

		MoveWindow(&m_rcClient,FALSE);
		ShowWindow(SW_SHOW);


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章