| 228 | |
| 229 | |
| 230 | void ResizeWin() |
| 231 | { |
| 232 | static RECT Rect1, Rect2; |
| 233 | static ILint NewW, NewH; |
| 234 | |
| 235 | SystemParametersInfo(SPI_GETWORKAREA, 0, &Rect1, 0); |
| 236 | |
| 237 | GetWindowRect(HWnd, &Rect2); |
| 238 | |
| 239 | Width = ilGetInteger(IL_IMAGE_WIDTH); |
| 240 | Height = ilGetInteger(IL_IMAGE_HEIGHT); |
| 241 | Depth = ilGetInteger(IL_IMAGE_DEPTH); |
| 242 | |
| 243 | NewW = Width < MIN_W ? MIN_W : Width + BORDER_W; |
| 244 | if (NewW + Rect2.left > Rect1.right) |
| 245 | NewW = Rect1.right - Rect2.left; |
| 246 | NewH = Height + MENU_H; |
| 247 | if (NewH + Rect2.top > Rect1.bottom) |
| 248 | NewH = Rect1.bottom - Rect2.top; |
| 249 | |
| 250 | SetWindowPos(HWnd, HWND_TOP, Rect2.left, Rect2.top, NewW, NewH, SWP_SHOWWINDOW); |
| 251 | InvalidateRect(HWnd, NULL, FALSE); |
| 252 | |
| 253 | return; |
| 254 | } |
| 255 | |
| 256 | |
| 257 | // Window procedure, handles all messages for this program |