37 |
{ |
{ |
38 |
switch (msg) { |
switch (msg) { |
39 |
case WM_INITDIALOG: |
case WM_INITDIALOG: |
40 |
SetDlgItemText( dlg, IDC_KEYPROG_CB, "" ); |
SetDlgItemText (dlg, IDC_KEYPROG_CB, ""); |
41 |
SetForegroundWindow( dlg ); |
SetForegroundWindow (dlg); |
42 |
center_window( dlg, NULL ); |
center_window (dlg, NULL); |
43 |
dlg_hwnd = dlg; |
dlg_hwnd = dlg; |
44 |
return TRUE; |
return TRUE; |
45 |
|
|
46 |
case WM_DESTROY: |
case WM_DESTROY: |
47 |
dlg_hwnd = NULL; |
dlg_hwnd = NULL; |
48 |
|
break; |
49 |
} |
} |
50 |
|
|
51 |
return FALSE; |
return FALSE; |
56 |
static DWORD WINAPI |
static DWORD WINAPI |
57 |
keygen_cb_thread (void *opaque) |
keygen_cb_thread (void *opaque) |
58 |
{ |
{ |
59 |
DialogBoxParam (glob_hinst, (LPCSTR)IDD_WINPT_KEYPROG, GetActiveWindow (), |
DialogBoxParam (glob_hinst, (LPCSTR)IDD_WINPT_KEYPROG, |
60 |
keygen_cb_dlg_proc, NULL); |
GetActiveWindow (), keygen_cb_dlg_proc, NULL); |
61 |
ExitThread (0); |
ExitThread (0); |
62 |
return 0; |
return 0; |
63 |
} |
} |
77 |
sec_attr.nLength = sizeof sec_attr; |
sec_attr.nLength = sizeof sec_attr; |
78 |
thread_hd = CreateThread (&sec_attr, 0, keygen_cb_thread, NULL, 0, &tid); |
thread_hd = CreateThread (&sec_attr, 0, keygen_cb_thread, NULL, 0, &tid); |
79 |
if (!thread_hd) { |
if (!thread_hd) { |
80 |
msg_box (NULL, _("Could not create key generation thread"), _("Key Generation"), MB_ERR); |
msg_box (NULL, "Could not create key generation thread", |
81 |
|
_("Key Generation"), MB_ERR); |
82 |
return WPTERR_GENERAL; |
return WPTERR_GENERAL; |
83 |
} |
} |
84 |
|
|
85 |
return 0; |
return 0; |
86 |
} |
} |
87 |
|
|
88 |
|
|
89 |
/* Destroy the progress dialog and cleanup. */ |
/* Destroy the progress dialog and cleanup. */ |
90 |
void |
void |
91 |
keygen_cb_dlg_destroy (void) |
keygen_cb_dlg_destroy (void) |