int delta_y = new_h - (lprcOldPos->bottom - lprcOldPos->top);\r
\r
/* Adjust size & placement */\r
- if(pwpChild->x + pwpChild->width >= lprcOldPos->right )\r
+ if(pwpChild->x + pwpChild->width >= lprcOldPos->right &&\r
+ (pwpChild->x + pwpChild->width < screenWidth - 5 || delta_x > 0) ) // keep right edge glued to display edge if touching\r
pwpChild->width += delta_x;\r
- if(pwpChild->y + pwpChild->height >= lprcOldPos->bottom )\r
+ if(pwpChild->x + pwpChild->width >= screenWidth ) // don't move right edge off screen\r
+ pwpChild->width = screenWidth - pwpChild->x;\r
+ if(pwpChild->y + pwpChild->height >= lprcOldPos->bottom &&\r
+ (pwpChild->y + pwpChild->height < screenHeight - 35 || delta_y > 0) ) // keep bottom edge glued to display edge if touching\r
pwpChild->height += delta_y;\r
+ if(pwpChild->y + pwpChild->height >= screenHeight - 30 ) // don't move bottom edge off screen\r
+ pwpChild->height = screenHeight - 30 - pwpChild->y;\r
if(pwpChild->x >= lprcOldPos->right) pwpChild->width -= delta_x, pwpChild->x += delta_x;\r
if(pwpChild->y >= lprcOldPos->bottom) pwpChild->height -= delta_y, pwpChild->y += delta_y;\r
+ if(pwpChild->width < 30) pwpChild->width = 30; // force minimum width\r
+ if(pwpChild->height < 50) pwpChild->height = 50; // force minimum height\r
/* Move window */\r
if( hWndChild != NULL ) {\r
SetWindowPos( hWndChild, HWND_TOP,\r