| 95 | extern boolean win32_cursorblink; /* from sys\windows\windsys.c */ |
| 96 | |
| 97 | HWND |
| 98 | mswin_init_map_window(void) |
| 99 | { |
| 100 | static int run_once = 0; |
| 101 | HWND hWnd; |
| 102 | RECT rt; |
| 103 | |
| 104 | if (!run_once) { |
| 105 | register_map_window_class(); |
| 106 | run_once = 1; |
| 107 | } |
| 108 | |
| 109 | /* get window position */ |
| 110 | if (GetNHApp()->bAutoLayout) { |
| 111 | SetRect(&rt, 0, 0, 0, 0); |
| 112 | } else { |
| 113 | mswin_get_window_placement(NHW_MAP, &rt); |
| 114 | } |
| 115 | |
| 116 | /* create map window object */ |
| 117 | hWnd = CreateWindow( |
| 118 | szNHMapWindowClass, /* registered class name */ |
| 119 | NULL, /* window name */ |
| 120 | WS_CHILD | WS_HSCROLL | WS_VSCROLL | WS_CLIPSIBLINGS |
| 121 | | WS_SIZEBOX, /* window style */ |
| 122 | rt.left, /* horizontal position of window */ |
| 123 | rt.top, /* vertical position of window */ |
| 124 | rt.right - rt.left, /* window width */ |
| 125 | rt.bottom - rt.top, /* window height */ |
| 126 | GetNHApp()->hMainWnd, /* handle to parent or owner window */ |
| 127 | NULL, /* menu handle or child identifier */ |
| 128 | GetNHApp()->hApp, /* handle to application instance */ |
| 129 | NULL); /* window-creation data */ |
| 130 | if (!hWnd) { |
| 131 | panic("Cannot create map window"); |
| 132 | } |
| 133 | |
| 134 | /* Set window caption */ |
| 135 | SetWindowText(hWnd, "Map"); |
| 136 | |
| 137 | mswin_apply_window_style(hWnd); |
| 138 | |
| 139 | /* set cursor blink timer */ |
| 140 | SetTimer(hWnd, 0, CURSOR_BLINK_INTERVAL, NULL); |
| 141 | |
| 142 | return hWnd; |
| 143 | } |
| 144 | |
| 145 | void |
| 146 | mswin_map_layout(HWND hWnd, LPSIZE map_size) |
no test coverage detected