| 24 | static void LayoutText(HWND hwnd); |
| 25 | |
| 26 | HWND |
| 27 | mswin_init_text_window(void) |
| 28 | { |
| 29 | HWND ret; |
| 30 | RECT rt; |
| 31 | |
| 32 | /* get window position */ |
| 33 | if (GetNHApp()->bAutoLayout) { |
| 34 | SetRect(&rt, 0, 0, 0, 0); |
| 35 | } else { |
| 36 | mswin_get_window_placement(NHW_TEXT, &rt); |
| 37 | } |
| 38 | |
| 39 | /* create text window object */ |
| 40 | ret = CreateDialog(GetNHApp()->hApp, MAKEINTRESOURCE(IDD_NHTEXT), |
| 41 | GetNHApp()->hMainWnd, NHTextWndProc); |
| 42 | if (!ret) |
| 43 | panic("Cannot create text window"); |
| 44 | |
| 45 | /* move it in the predefined position */ |
| 46 | if (!GetNHApp()->bAutoLayout) { |
| 47 | MoveWindow(ret, rt.left, rt.top, rt.right - rt.left, |
| 48 | rt.bottom - rt.top, TRUE); |
| 49 | } |
| 50 | |
| 51 | /* Set window caption */ |
| 52 | SetWindowText(ret, "Text"); |
| 53 | |
| 54 | mswin_apply_window_style(ret); |
| 55 | |
| 56 | return ret; |
| 57 | } |
| 58 | |
| 59 | void |
| 60 | mswin_display_text_window(HWND hWnd) |
no test coverage detected