| 65 | #endif |
| 66 | |
| 67 | HWND |
| 68 | mswin_init_message_window(void) |
| 69 | { |
| 70 | static int run_once = 0; |
| 71 | HWND ret; |
| 72 | DWORD style; |
| 73 | RECT rt; |
| 74 | |
| 75 | if (!run_once) { |
| 76 | register_message_window_class(); |
| 77 | run_once = 1; |
| 78 | } |
| 79 | |
| 80 | /* get window position */ |
| 81 | if (GetNHApp()->bAutoLayout) { |
| 82 | SetRect(&rt, 0, 0, 0, 0); |
| 83 | } else { |
| 84 | mswin_get_window_placement(NHW_MESSAGE, &rt); |
| 85 | } |
| 86 | |
| 87 | #ifdef MSG_WRAP_TEXT |
| 88 | style = WS_CHILD | WS_CLIPSIBLINGS | WS_VSCROLL | WS_SIZEBOX; |
| 89 | #else |
| 90 | style = WS_CHILD | WS_CLIPSIBLINGS | WS_VSCROLL | WS_HSCROLL | WS_SIZEBOX; |
| 91 | #endif |
| 92 | |
| 93 | ret = CreateWindowEx( |
| 94 | WS_EX_CLIENTEDGE, szMessageWindowClass, /* registered class name */ |
| 95 | NULL, /* window name */ |
| 96 | style, /* window style */ |
| 97 | rt.left, /* horizontal position of window */ |
| 98 | rt.top, /* vertical position of window */ |
| 99 | rt.right - rt.left, /* window width */ |
| 100 | rt.bottom - rt.top, /* window height */ |
| 101 | GetNHApp()->hMainWnd, /* handle to parent or owner window */ |
| 102 | NULL, /* menu handle or child identifier */ |
| 103 | GetNHApp()->hApp, /* handle to application instance */ |
| 104 | NULL); /* window-creation data */ |
| 105 | |
| 106 | if (!ret) |
| 107 | panic("Cannot create message window"); |
| 108 | |
| 109 | /* Set window caption */ |
| 110 | SetWindowText(ret, "Messages"); |
| 111 | |
| 112 | mswin_apply_window_style(ret); |
| 113 | |
| 114 | return ret; |
| 115 | } |
| 116 | |
| 117 | void |
| 118 | register_message_window_class(void) |
no test coverage detected