]>
Commit | Line | Data |
---|---|---|
46187c8f DD |
1 | /* |
2 | * Copyright (c) 2000, Red Hat, Inc. | |
3 | * | |
4 | * This program is free software; you can redistribute it and/or modify | |
5 | * it under the terms of the GNU General Public License as published by | |
6 | * the Free Software Foundation; either version 2 of the License, or | |
7 | * (at your option) any later version. | |
8 | * | |
9 | * A copy of the GNU General Public License can be found at | |
10 | * http://www.gnu.org/ | |
11 | * | |
12 | * Written by DJ Delorie <dj@cygnus.com> | |
13 | * | |
14 | */ | |
15 | ||
16 | /* The purpose of this file is to display the program name, version, | |
17 | copyright notice, and project URL. */ | |
18 | ||
b24c88b3 RC |
19 | #if 0 |
20 | static const char *cvsid = | |
21 | "\n%%% $Id$\n"; | |
22 | #endif | |
46187c8f DD |
23 | |
24 | #include "win32.h" | |
25 | #include <stdio.h> | |
26 | #include "dialog.h" | |
27 | #include "resource.h" | |
28 | #include "msg.h" | |
13d27274 | 29 | #include "version.h" |
46187c8f DD |
30 | |
31 | static void | |
32 | load_dialog (HWND h) | |
33 | { | |
34 | char buffer[100]; | |
ed96c6da | 35 | HWND v = GetDlgItem (h, IDC_VERSION); |
67bebcb5 DD |
36 | sprintf (buffer, "Setup.exe version %s", |
37 | version[0] ? version : "[unknown]"); | |
46187c8f DD |
38 | SetWindowText (v, buffer); |
39 | } | |
40 | ||
41 | static BOOL | |
42 | dialog_cmd (HWND h, int id, HWND hwndctl, UINT code) | |
43 | { | |
44 | switch (id) | |
45 | { | |
46 | ||
47 | case IDOK: | |
48 | NEXT (IDD_SOURCE); | |
49 | break; | |
50 | ||
51 | case IDCANCEL: | |
52 | NEXT (0); | |
53 | break; | |
54 | } | |
b24c88b3 | 55 | return 0; |
46187c8f DD |
56 | } |
57 | ||
58 | static BOOL CALLBACK | |
59 | dialog_proc (HWND h, UINT message, WPARAM wParam, LPARAM lParam) | |
60 | { | |
61 | switch (message) | |
62 | { | |
63 | case WM_INITDIALOG: | |
64 | load_dialog (h); | |
0b9af00c | 65 | return TRUE; |
46187c8f DD |
66 | case WM_COMMAND: |
67 | return HANDLE_WM_COMMAND (h, wParam, lParam, dialog_cmd); | |
68 | } | |
69 | return FALSE; | |
70 | } | |
71 | ||
72 | void | |
73 | do_splash (HINSTANCE h) | |
74 | { | |
75 | int rv = 0; | |
76 | rv = DialogBox (h, MAKEINTRESOURCE (IDD_SPLASH), 0, dialog_proc); | |
77 | if (rv == -1) | |
78 | fatal (IDS_DIALOG_FAILED); | |
79 | } |