24 |
#include <windows.h> |
#include <windows.h> |
25 |
#include <windows.h> |
#include <windows.h> |
26 |
|
|
27 |
#include "../resource.h" |
#include "resource.h" |
28 |
#include "wptTypes.h" |
#include "wptTypes.h" |
29 |
#include "wptW32API.h" |
#include "wptW32API.h" |
30 |
#include "wptVersion.h" |
#include "wptVersion.h" |
238 |
|
|
239 |
char* multi_gnupg_path (void); |
char* multi_gnupg_path (void); |
240 |
|
|
241 |
|
const char * fm_get_file_type (const char *fname, int *r_type); |
242 |
|
|
243 |
/* Main entry point. */ |
/* Main entry point. */ |
244 |
int WINAPI |
int WINAPI |
245 |
WinMain (HINSTANCE hinst, HINSTANCE hprev, LPSTR cmdline, int showcmd) |
WinMain (HINSTANCE hinst, HINSTANCE hprev, LPSTR cmdline, int showcmd) |
246 |
{ |
{ |
247 |
WNDCLASS wc = {0, winpt_main_proc, 0, 0, hinst, 0, 0, 0, 0, PGM_NAME}; |
WNDCLASS wc = {0, winpt_main_proc, 0, 0, hinst, 0, 0, 0, 0, PGM_NAME}; |
248 |
HACCEL accel_tab; |
HACCEL accel_tab; |
249 |
int rc, ec, created = 0, use_cwd = 0, nfiles = 0; |
int rc, ec, created = 0, nfiles = 0; |
250 |
int first_start = 0, start_gpgprefs = 0; |
int first_start = 0, start_gpgprefs = 0; |
251 |
int winpt_inst_found = 0; |
int winpt_inst_found = 0; |
252 |
const char *s; |
const char *s; |
310 |
get_reg_winpt_prefs (®_prefs); |
get_reg_winpt_prefs (®_prefs); |
311 |
if (!reg_prefs.no_hotkeys) |
if (!reg_prefs.no_hotkeys) |
312 |
hotkeys_modify (); |
hotkeys_modify (); |
313 |
|
gnupg_load_config (); |
314 |
} |
} |
315 |
|
|
316 |
rc = gnupg_check_homedir (); |
rc = gnupg_check_homedir (); |
481 |
char *ring; |
char *ring; |
482 |
size_t size = 0; |
size_t size = 0; |
483 |
DialogBoxParam (glob_hinst, (LPCTSTR)IDD_WINPT_GPGPREFS, hwnd, |
DialogBoxParam (glob_hinst, (LPCTSTR)IDD_WINPT_GPGPREFS, hwnd, |
484 |
gpgprefs_dlg_proc, NULL); |
gpgprefs_dlg_proc, 0); |
485 |
ring = get_gnupg_keyring (0, !NO_STRICT); |
ring = get_gnupg_keyring (0, !NO_STRICT); |
486 |
if (gnupg_access_keyring (0) == -1 && get_file_size (ring) == 0) |
if (gnupg_access_keyring (0) == -1 && get_file_size (ring) == 0) |
487 |
first_start = 1; /* The keyring is empty! */ |
first_start = 1; /* The keyring is empty! */ |
495 |
start: |
start: |
496 |
h = GetDesktopWindow (); |
h = GetDesktopWindow (); |
497 |
DialogBoxParam (glob_hinst, (LPCTSTR)IDD_WINPT_GPGPREFS, h, |
DialogBoxParam (glob_hinst, (LPCTSTR)IDD_WINPT_GPGPREFS, h, |
498 |
gpgprefs_dlg_proc, NULL); |
gpgprefs_dlg_proc, 0); |
499 |
DialogBoxParam (glob_hinst, (LPCSTR)IDD_WINPT_FIRST, h, |
DialogBoxParam (glob_hinst, (LPCSTR)IDD_WINPT_FIRST, h, |
500 |
first_run_dlg_proc, (LPARAM)&fs); |
first_run_dlg_proc, (LPARAM)&fs); |
501 |
switch (fs.choice) { |
switch (fs.choice) { |
538 |
"WinPT", MB_INFO|MB_YESNO); |
"WinPT", MB_INFO|MB_YESNO); |
539 |
if (ec == IDYES) { |
if (ec == IDYES) { |
540 |
DialogBoxParam (glob_hinst, (LPCTSTR)IDD_WINPT_GPGPREFS, hwnd, |
DialogBoxParam (glob_hinst, (LPCTSTR)IDD_WINPT_GPGPREFS, hwnd, |
541 |
gpgprefs_dlg_proc, NULL); |
gpgprefs_dlg_proc, 0); |
542 |
update_keycache (hwnd); |
update_keycache (hwnd); |
543 |
} |
} |
544 |
else { |
else { |
560 |
} |
} |
561 |
if (count_insecure_elgkeys ()) |
if (count_insecure_elgkeys ()) |
562 |
DialogBoxParam (glob_hinst, (LPCTSTR)IDD_WINPT_ELGWARN, glob_hwnd, |
DialogBoxParam (glob_hinst, (LPCTSTR)IDD_WINPT_ELGWARN, glob_hwnd, |
563 |
elgamal_warn_dlg_proc, NULL); |
elgamal_warn_dlg_proc, 0); |
564 |
} |
} |
565 |
|
|
566 |
accel_tab = LoadAccelerators (glob_hinst, (LPCTSTR)IDR_WINPT_ACCELERATOR); |
accel_tab = LoadAccelerators (glob_hinst, (LPCTSTR)IDR_WINPT_ACCELERATOR); |