1 #include "precomp.h" 2 3 INT_PTR CALLBACK 4 AboutDialogProc(HWND hDlg, 5 UINT message, 6 WPARAM wParam, 7 LPARAM lParam) 8 { 9 HWND hLicenseEditWnd; 10 HICON hIcon = NULL; 11 TCHAR strLicense[700]; 12 13 switch (message) 14 { 15 case WM_INITDIALOG: 16 17 hIcon = LoadImage(hInstance, 18 MAKEINTRESOURCE(IDI_ICON), 19 IMAGE_ICON, 20 16, 21 16, 22 0); 23 24 SendMessage(hDlg, 25 WM_SETICON, 26 ICON_SMALL, 27 (LPARAM)hIcon); 28 29 hLicenseEditWnd = GetDlgItem(hDlg, 30 IDC_LICENSE_EDIT); 31 32 LoadString(hInstance, 33 IDS_LICENSE, 34 strLicense, 35 sizeof(strLicense) / sizeof(TCHAR)); 36 37 SetWindowText(hLicenseEditWnd, 38 strLicense); 39 return TRUE; 40 41 case WM_COMMAND: 42 if ((LOWORD(wParam) == IDOK) || (LOWORD(wParam) == IDCANCEL)) 43 { 44 DestroyIcon(hIcon); 45 EndDialog(hDlg, 46 LOWORD(wParam)); 47 return TRUE; 48 } 49 50 break; 51 } 52 53 return FALSE; 54 } 55