Rev 140 | Rev 186 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 140 | Rev 147 | ||
---|---|---|---|
Line 6... | Line 6... | ||
6 | // dialog template |
6 | // dialog template |
7 | #define THIS_DIALOG DIALOG_ABOUT |
7 | #define THIS_DIALOG DIALOG_ABOUT |
8 | 8 | ||
9 | 9 | ||
10 | // global variables used in this module only |
10 | // global variables used in this module only |
11 | static bool is_authordisplayed = false; |
- | |
12 | static HFONT hFontBanner; |
11 | static HFONT hFontBanner; |
13 | 12 | ||
14 | 13 | ||
15 | // prototypes of local functions |
14 | // prototypes of local functions |
16 | static void StartThread_ThisDialog (void *thread_parms); |
15 | static void StartThread_ThisDialog (void *thread_parms); |
Line 89... | Line 88... | ||
89 | 88 | ||
90 | // set the banner area font |
89 | // set the banner area font |
91 | SendMessage (GetDlgItem (hWnd, STATICTEXT_BANNER), WM_SETFONT, (WPARAM) hFontBanner, false); |
90 | SendMessage (GetDlgItem (hWnd, STATICTEXT_BANNER), WM_SETFONT, (WPARAM) hFontBanner, false); |
92 | Static_SetText (GetDlgItem (hWnd, STATICTEXT_BANNER), PROGRAM_NAME); |
91 | Static_SetText (GetDlgItem (hWnd, STATICTEXT_BANNER), PROGRAM_NAME); |
93 | 92 | ||
94 | swprintf_s (temp_buffer, WCHAR_SIZEOF (temp_buffer), L"version %c%c%c%c%s%c%c |
93 | swprintf_s (temp_buffer, WCHAR_SIZEOF (temp_buffer), L"version %c%c%c%c%s%c%c © 2010-2016 Pierre-Marie Baty - ", |
95 | __DATE__[7], __DATE__[8], __DATE__[9], __DATE__[10], |
94 | __DATE__[7], __DATE__[8], __DATE__[9], __DATE__[10], |
96 | (strncmp (__DATE__, "Jan", 3) == 0 ? L"01" : |
95 | (strncmp (__DATE__, "Jan", 3) == 0 ? L"01" : |
97 | (strncmp (__DATE__, "Feb", 3) == 0 ? L"02" : |
96 | (strncmp (__DATE__, "Feb", 3) == 0 ? L"02" : |
98 | (strncmp (__DATE__, "Mar", 3) == 0 ? L"03" : |
97 | (strncmp (__DATE__, "Mar", 3) == 0 ? L"03" : |
99 | (strncmp (__DATE__, "Apr", 3) == 0 ? L"04" : |
98 | (strncmp (__DATE__, "Apr", 3) == 0 ? L"04" : |
Line 117... | Line 116... | ||
117 | swprintf_s (temp_buffer, WCHAR_SIZEOF (temp_buffer), LOCALIZE (L"Registration_RegisteredTo"), options.registration.user_email); |
116 | swprintf_s (temp_buffer, WCHAR_SIZEOF (temp_buffer), LOCALIZE (L"Registration_RegisteredTo"), options.registration.user_email); |
118 | else |
117 | else |
119 | wcscpy_s (temp_buffer, WCHAR_SIZEOF (temp_buffer), LOCALIZE (L"Registration_Unregistered")); |
118 | wcscpy_s (temp_buffer, WCHAR_SIZEOF (temp_buffer), LOCALIZE (L"Registration_Unregistered")); |
120 | Static_SetText (GetDlgItem (hWnd, STATICTEXT_REGISTEREDTO), temp_buffer); |
119 | Static_SetText (GetDlgItem (hWnd, STATICTEXT_REGISTEREDTO), temp_buffer); |
121 | 120 | ||
122 | // convert the |
121 | // convert the author's email to something clickable |
123 | ConvertStaticToHyperlink (GetDlgItem (hWnd, BITMAP_ABOUT)); |
- | |
124 | ConvertStaticToHyperlink (GetDlgItem (hWnd, STATICTEXT_AUTHOREMAIL)); |
122 | ConvertStaticToHyperlink (GetDlgItem (hWnd, STATICTEXT_AUTHOREMAIL)); |
125 | } |
123 | } |
126 | 124 | ||
127 | // else did we click the close button on the title bar ? |
125 | // else did we click the close button on the title bar ? |
128 | else if (message == WM_CLOSE) |
126 | else if (message == WM_CLOSE) |
Line 139... | Line 137... | ||
139 | } |
137 | } |
140 | 138 | ||
141 | // else was it the author's email ? |
139 | // else was it the author's email ? |
142 | else if (wParam_loword == STATICTEXT_AUTHOREMAIL) |
140 | else if (wParam_loword == STATICTEXT_AUTHOREMAIL) |
143 | ShellExecute (NULL, L"open", L"mailto:" AUTHOR_EMAIL, NULL, NULL, SW_MAXIMIZE); // fire up the mail client |
141 | ShellExecute (NULL, L"open", L"mailto:" AUTHOR_EMAIL, NULL, NULL, SW_MAXIMIZE); // fire up the mail client |
144 | - | ||
145 | // else was it the picture ? change the picture and display our face instead :p |
- | |
146 | else if (wParam_loword == BITMAP_ABOUT) |
- | |
147 | { |
- | |
148 | is_authordisplayed ^= true; // alternate author display with about display picture |
- | |
149 | SendMessage (GetDlgItem (hWnd, BITMAP_ABOUT), STM_SETIMAGE, IMAGE_BITMAP, (LPARAM) LoadBitmap (hAppInstance, MAKEINTRESOURCE (is_authordisplayed ? BITMAP_AUTHOR : BITMAP_ABOUT))); |
- | |
150 | } |
- | |
151 | 142 | ||
152 | // else did we cancel the dialog box ? (IDCANCEL is a system-wide dialog box handler value, that catches the ESC key) |
143 | // else did we cancel the dialog box ? (IDCANCEL is a system-wide dialog box handler value, that catches the ESC key) |
153 | else if (wParam_loword == IDCANCEL) |
144 | else if (wParam_loword == IDCANCEL) |
154 | EndDialog (hWnd, 0); // close the dialog box |
145 | EndDialog (hWnd, 0); // close the dialog box |
155 | } |
146 | } |