Rev 21 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 21 | Rev 124 | ||
---|---|---|---|
Line 150... | Line 150... | ||
150 | return (0); // as MSDN says |
150 | return (0); // as MSDN says |
151 | } |
151 | } |
152 | 152 | ||
153 | // else did we click the close button on the title bar ? |
153 | // else did we click the close button on the title bar ? |
154 | else if (message == WM_CLOSE) |
154 | else if (message == WM_CLOSE) |
- | 155 | { |
|
155 | DestroyWindow (hWnd); // close the window |
156 | DestroyWindow (hWnd); // close the window |
- | 157 | return (0); // as MSDN says |
|
- | 158 | } |
|
156 | 159 | ||
157 | // else are we destroying this window ? |
160 | // else are we destroying this window ? |
158 | else if (message == WM_DESTROY) |
161 | else if (message == WM_DESTROY) |
159 | { |
162 | { |
160 | hThisWnd = NULL; // window is closed |
163 | hThisWnd = NULL; // window is closed |
161 | SetForegroundWindow (hMainWnd); // restore focus on the main window |
164 | SetForegroundWindow (hMainWnd); // restore focus on the main window |
162 | is_window_motd_validated = true; // remember we closed this window |
165 | is_window_motd_validated = true; // remember we closed this window |
- | 166 | the_board.reevaluate = true; // refresh the GUI buttons if needed |
|
- | 167 | return (0); // as MSDN says |
|
163 | } |
168 | } |
164 | 169 | ||
165 | // else are we resizing the window ? |
170 | // else are we resizing the window ? |
166 | else if (message == WM_SIZE) |
171 | else if (message == WM_SIZE) |
167 | { |
172 | { |
168 | // get the new window size |
173 | // get the new window size |
169 | GetClientRect (hWnd, &client_rect); |
174 | GetClientRect (hWnd, &client_rect); |
170 | 175 | ||
171 | // position the window elements |
176 | // position the window elements |
172 | SetWindowPos (GetDlgItem (hWnd, WINDOW_EDITBOX_MOTD), NULL, 16, 16, client_rect.right - 32, client_rect.bottom - 64, SWP_NOZORDER); |
177 | SetWindowPos (GetDlgItem (hWnd, WINDOW_EDITBOX_MOTD), NULL, 16, 16, client_rect.right - 32, client_rect.bottom - 64, SWP_NOZORDER); |
173 | SetWindowPos (GetDlgItem (hWnd, WINDOW_CHECKBOX_SHOWMOTD), NULL, 16, client_rect.bottom - 32, client_rect.right - 32, 16, SWP_NOZORDER); |
178 | SetWindowPos (GetDlgItem (hWnd, WINDOW_CHECKBOX_SHOWMOTD), NULL, 16, client_rect.bottom - 32, client_rect.right - 32, 16, SWP_NOZORDER); |
174 | SetWindowPos (GetDlgItem (hWnd, WINDOW_TEXT_STATUSBAR), NULL, 0, client_rect.bottom - 16, client_rect.right, 16, SWP_NOZORDER); |
179 | SetWindowPos (GetDlgItem (hWnd, WINDOW_TEXT_STATUSBAR), NULL, 0, client_rect.bottom - 16, client_rect.right, 16, SWP_NOZORDER); |
- | 180 | ||
- | 181 | return (0); // as MSDN says |
|
175 | } |
182 | } |
176 | 183 | ||
177 | // else are we asking how big/small we can resize ? |
184 | // else are we asking how big/small we can resize ? |
178 | else if (message == WM_GETMINMAXINFO) |
185 | else if (message == WM_GETMINMAXINFO) |
179 | { |
186 | { |
180 | minmax = (MINMAXINFO *) lParam; // get a pointer to the min/max info structure |
187 | minmax = (MINMAXINFO *) lParam; // get a pointer to the min/max info structure |
181 | 188 | ||
182 | minmax->ptMinTrackSize.x = WINDOW_MIN_WIDTH; |
189 | minmax->ptMinTrackSize.x = WINDOW_MIN_WIDTH; |
183 | minmax->ptMinTrackSize.y = WINDOW_MIN_HEIGHT; |
190 | minmax->ptMinTrackSize.y = WINDOW_MIN_HEIGHT; |
- | 191 | ||
- | 192 | return (0); // as MSDN says |
|
184 | } |
193 | } |
185 | 194 | ||
186 | // else did we take action on one of the controls ? |
195 | // else did we take action on one of the controls ? |
187 | else if (message == WM_COMMAND) |
196 | else if (message == WM_COMMAND) |
188 | { |
197 | { |
189 | // was it the show MOTD checkbox ? |
198 | // was it the show MOTD checkbox ? |
Line 191... | Line 200... | ||
191 | options.network.want_motdonconnect = (Button_GetCheck (GetDlgItem (hWnd, WINDOW_CHECKBOX_SHOWMOTD)) != 0); // if so, update settings |
200 | options.network.want_motdonconnect = (Button_GetCheck (GetDlgItem (hWnd, WINDOW_CHECKBOX_SHOWMOTD)) != 0); // if so, update settings |
192 | 201 | ||
193 | // else was it the status bar hyperlink ? |
202 | // else was it the status bar hyperlink ? |
194 | else if (wParam_loword == WINDOW_TEXT_STATUSBAR) |
203 | else if (wParam_loword == WINDOW_TEXT_STATUSBAR) |
195 | ShellExecute (NULL, L"open", PROGRAM_URL, NULL, NULL, SW_MAXIMIZE); // open the donation page in the default browser, maximized |
204 | ShellExecute (NULL, L"open", PROGRAM_URL, NULL, NULL, SW_MAXIMIZE); // open the donation page in the default browser, maximized |
- | 205 | ||
- | 206 | return (0); // as MSDN says |
|
196 | } |
207 | } |
197 | 208 | ||
198 | // call the default window message processing function to keep things going |
209 | // call the default window message processing function to keep things going |
199 | return (DefWindowProc (hWnd, message, wParam, lParam)); |
210 | return (DefWindowProc (hWnd, message, wParam, lParam)); |
200 | } |
211 | } |