45 |
INT_PTR CALLBACK WndProcFile(HWND, UINT, WPARAM, LPARAM); |
INT_PTR CALLBACK WndProcFile(HWND, UINT, WPARAM, LPARAM); |
46 |
INT_PTR CALLBACK WndProcCrypto(HWND, UINT, WPARAM, LPARAM); |
INT_PTR CALLBACK WndProcCrypto(HWND, UINT, WPARAM, LPARAM); |
47 |
INT_PTR CALLBACK WndProcCryptoApi(HWND, UINT, WPARAM, LPARAM); |
INT_PTR CALLBACK WndProcCryptoApi(HWND, UINT, WPARAM, LPARAM); |
48 |
|
INT_PTR CALLBACK WndProcEnroll(HWND, UINT, WPARAM, LPARAM); |
49 |
|
|
50 |
int APIENTRY _tWinMain(HINSTANCE hInstance, |
int APIENTRY _tWinMain(HINSTANCE hInstance, |
51 |
HINSTANCE hPrevInstance, |
HINSTANCE hPrevInstance, |
55 |
UNREFERENCED_PARAMETER(hPrevInstance); |
UNREFERENCED_PARAMETER(hPrevInstance); |
56 |
UNREFERENCED_PARAMETER(lpCmdLine); |
UNREFERENCED_PARAMETER(lpCmdLine); |
57 |
g_hinst = hInstance; |
g_hinst = hInstance; |
58 |
PROPSHEETPAGE psp[5]; |
PROPSHEETPAGE psp[6]; |
59 |
PROPSHEETHEADER psh; |
PROPSHEETHEADER psh; |
60 |
psp[0].dwSize = sizeof(PROPSHEETPAGE); |
psp[0].dwSize = sizeof(PROPSHEETPAGE); |
61 |
psp[0].dwFlags = PSP_USETITLE; |
psp[0].dwFlags = PSP_USETITLE; |
102 |
psp[4].pszTitle = TEXT("CryptoApi"); |
psp[4].pszTitle = TEXT("CryptoApi"); |
103 |
psp[4].lParam = 0; |
psp[4].lParam = 0; |
104 |
psp[4].pfnCallback = NULL; |
psp[4].pfnCallback = NULL; |
105 |
|
psp[5].dwSize = sizeof(PROPSHEETPAGE); |
106 |
|
psp[5].dwFlags = PSP_USETITLE; |
107 |
|
psp[5].hInstance = g_hinst; |
108 |
|
psp[5].pszTemplate = MAKEINTRESOURCE(IDD_ENROLL); |
109 |
|
psp[5].pszIcon = NULL; |
110 |
|
psp[5].pfnDlgProc = WndProcEnroll; |
111 |
|
psp[5].pszTitle = TEXT("Enroll"); |
112 |
|
psp[5].lParam = 0; |
113 |
|
psp[5].pfnCallback = NULL; |
114 |
psh.dwSize = sizeof(PROPSHEETHEADER); |
psh.dwSize = sizeof(PROPSHEETHEADER); |
115 |
psh.dwFlags = PSH_USEICONID | PSH_PROPSHEETPAGE; |
psh.dwFlags = PSH_USEICONID | PSH_PROPSHEETPAGE; |
116 |
psh.hwndParent = NULL; |
psh.hwndParent = NULL; |
307 |
dwReturn = SetPuk(szPin, szPin2, &dwRemaining); |
dwReturn = SetPuk(szPin, szPin2, &dwRemaining); |
308 |
MessageBoxWin32(dwReturn); |
MessageBoxWin32(dwReturn); |
309 |
break; |
break; |
310 |
|
case IDC_SETSM: |
311 |
|
GetDlgItemTextA(hWnd,IDC_TXTPIN,szPin,ARRAYSIZE(szPin)); |
312 |
|
GetDlgItemTextA(hWnd,IDC_TXTPIN2,szPin2,ARRAYSIZE(szPin2)); |
313 |
|
dwReturn = SetSM(szPin, szPin2, &dwRemaining); |
314 |
|
MessageBoxWin32(dwReturn); |
315 |
|
break; |
316 |
case IDC_PERSONNALIZE: |
case IDC_PERSONNALIZE: |
317 |
dwReturn = Personnalize(); |
dwReturn = Personnalize(); |
318 |
MessageBoxWin32(dwReturn); |
MessageBoxWin32(dwReturn); |
464 |
return FALSE; |
return FALSE; |
465 |
} |
} |
466 |
|
|
467 |
|
INT_PTR CALLBACK WndProcEnroll(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) |
468 |
|
{ |
469 |
|
int wmId, wmEvent; |
470 |
|
DWORD dwReturn; |
471 |
|
switch (message) |
472 |
|
{ |
473 |
|
case WM_INITDIALOG: |
474 |
|
break; |
475 |
|
case WM_COMMAND: |
476 |
|
wmId = LOWORD(wParam); |
477 |
|
wmEvent = HIWORD(wParam); |
478 |
|
|
479 |
|
switch (wmId) |
480 |
|
{ |
481 |
|
case IDC_ENROLL: |
482 |
|
dwReturn = Enroll(); |
483 |
|
MessageBoxWin32(dwReturn); |
484 |
|
break; |
485 |
|
} |
486 |
|
} |
487 |
|
return FALSE; |
488 |
|
} |