adjust windows to fit main window layout --------------------------- | Status | +-------------------------+ | | | | | MAP | | | | | +-------------------------+ | Command pad | +-------------------------+ | Messag
| 548 | --------------------------- |
| 549 | */ |
| 550 | void |
| 551 | mswin_layout_main_window(HWND changed_child) |
| 552 | { |
| 553 | winid i; |
| 554 | RECT client_rt, wnd_rect; |
| 555 | POINT status_org; |
| 556 | SIZE status_size; |
| 557 | POINT msg_org; |
| 558 | SIZE msg_size; |
| 559 | POINT map_org; |
| 560 | SIZE map_size; |
| 561 | POINT cmd_org; |
| 562 | SIZE cmd_size; |
| 563 | HWND wnd_status, wnd_msg; |
| 564 | PNHMainWindow data; |
| 565 | #if defined(WIN_CE_POCKETPC) |
| 566 | SIPINFO sip; |
| 567 | RECT menu_bar; |
| 568 | RECT visible_rt; |
| 569 | POINT pt; |
| 570 | #endif |
| 571 | |
| 572 | GetClientRect(GetNHApp()->hMainWnd, &client_rt); |
| 573 | |
| 574 | #if defined(WIN_CE_POCKETPC) |
| 575 | ZeroMemory(&sip, sizeof(sip)); |
| 576 | sip.cbSize = sizeof(sip); |
| 577 | SHSipInfo(SPI_GETSIPINFO, 0, &sip, 0); |
| 578 | if (GetNHApp()->bFullScreen) |
| 579 | sip.rcVisibleDesktop.top = 0; |
| 580 | |
| 581 | /* adjust client rectangle size */ |
| 582 | GetWindowRect(GetNHApp()->hMenuBar, &menu_bar); |
| 583 | client_rt.bottom -= menu_bar.bottom - menu_bar.top; |
| 584 | |
| 585 | /* calcuate visible rect in client coordinates */ |
| 586 | pt.x = sip.rcVisibleDesktop.left; |
| 587 | pt.y = sip.rcVisibleDesktop.top; |
| 588 | ScreenToClient(GetNHApp()->hMainWnd, &pt); |
| 589 | SetRect(&wnd_rect, pt.x, pt.y, |
| 590 | pt.x + sip.rcVisibleDesktop.right - sip.rcVisibleDesktop.left, |
| 591 | pt.y + sip.rcVisibleDesktop.bottom - sip.rcVisibleDesktop.top); |
| 592 | IntersectRect(&visible_rt, &client_rt, &wnd_rect); |
| 593 | #else |
| 594 | #if !defined(WIN_CE_SMARTPHONE) |
| 595 | client_rt.top += CommandBar_Height(GetNHApp()->hMenuBar); |
| 596 | #else |
| 597 | /* Smartphone only */ |
| 598 | if (GetNHApp()->bFullScreen) { |
| 599 | RECT menu_bar; |
| 600 | GetWindowRect(GetNHApp()->hMenuBar, &menu_bar); |
| 601 | client_rt.bottom -= menu_bar.bottom - menu_bar.top; |
| 602 | } |
| 603 | #endif |
| 604 | #endif |
| 605 | |
| 606 | /* get window data */ |
| 607 | data = (PNHMainWindow) GetWindowLong(GetNHApp()->hMainWnd, GWL_USERDATA); |
no test coverage detected