diff --git a/main.c b/main.c index f2c2ed29..fc0bc3e9 100644 --- a/main.c +++ b/main.c @@ -837,33 +837,35 @@ LRESULT CALLBACK WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) w = GET_X_LPARAM(lParam); h = GET_Y_LPARAM(lParam); - width = w; - height = h; - - int x2 = (MAIN_X + 32 + 600) < (width - 24) ? MAIN_X + 32 + 600 : width - 24; + if(w != 0) + { + width = w; + height = h; - edit_name.right = x2; - edit_status.right = x2; + int x2 = (MAIN_X + 32 + 600) < (width - 24) ? MAIN_X + 32 + 600 : width - 24; - edit_addid.right = x2; - edit_addmsg.right = x2; + edit_name.right = x2; + edit_status.right = x2; - button_addfriend.x = edit_addmsg.right - 50; - button_addfriend.y = MAIN_Y + 222; + edit_addid.right = x2; + edit_addmsg.right = x2; - edit_msg.y = height - 128; - edit_msg.bottom = edit_msg.y + 80; - edit_msg.right = width - 24; + button_addfriend.x = edit_addmsg.right - 50; + button_addfriend.y = MAIN_Y + 222; - if(hdc_bm) - { - DeleteObject(hdc_bm); - } + edit_msg.y = height - 128; + edit_msg.bottom = edit_msg.y + 80; + edit_msg.right = width - 24; - hdc_bm = CreateCompatibleBitmap(main_hdc, width, height); - SelectObject(hdc, hdc_bm); + if(hdc_bm) + { + DeleteObject(hdc_bm); + } - drawall(); + hdc_bm = CreateCompatibleBitmap(main_hdc, width, height); + SelectObject(hdc, hdc_bm); + drawall(); + } //commitdraw(0, 0, width, height); break;