1
0
Эх сурвалжийг харах

take taskbar into account when ensuring entire window is visible

git-svn-id: svn://svn.code.sf.net/p/ditto-cp/code/trunk@616 595ec19a-5cb4-439b-94a8-42fb3063c22c
sabrogden 14 жил өмнө
parent
commit
8b1f82a0d7
1 өөрчлөгдсөн 24 нэмэгдсэн , 0 устгасан
  1. 24 0
      Misc.cpp

+ 24 - 0
Misc.cpp

@@ -655,6 +655,30 @@ void GetMonitorRect(int iMonitor, LPRECT lpDestRect)
 		lpDestRect->right = GetScreenWidth();
 		lpDestRect->bottom = GetScreenHeight();
 	}
+
+	//adjust the rect for the taskbar
+	APPBARDATA appBarData;
+	appBarData.cbSize=sizeof(appBarData);
+	if (SHAppBarMessage(ABM_GETTASKBARPOS, &appBarData))
+	{
+		switch(appBarData.uEdge)
+		{
+		case ABE_LEFT:
+			lpDestRect->left += appBarData.rc.right - appBarData.rc.left;
+			break;
+		case ABE_RIGHT:
+			lpDestRect->right -= appBarData.rc.right - appBarData.rc.left;
+			break;
+		case ABE_TOP:
+			lpDestRect->top += appBarData.rc.bottom - appBarData.rc.top;
+			break;
+		case ABE_BOTTOM:
+			lpDestRect->bottom -= appBarData.rc.bottom - appBarData.rc.top;
+			break;
+		}
+		return;
+	}
+
 }
 
 /*------------------------------------------------------------------*\