Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
1.8 KiB

  1. //////////////////////////////////////////////////////////////
  2. //
  3. // NewUserConfirmDlg.cpp
  4. //
  5. // Implementation of the "Add Mailbox" dialog
  6. //
  7. //////////////////////////////////////////////////////////////
  8. #include "stdafx.h"
  9. #include "NewUserConfirmDlg.h"
  10. LRESULT CNewUserConfirmDlg::OnCancel( WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled )
  11. {
  12. EndDialog( IDCANCEL );
  13. return 0;
  14. }
  15. LRESULT CNewUserConfirmDlg::OnInitDialog( UINT mMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled )
  16. {
  17. // initialize the checkbox based on the passed in default
  18. ::ShowWindow( GetDlgItem(IDC_optDoNotShow), (m_bHideDoNotShow ? SW_HIDE : SW_SHOW) );
  19. SetDlgItemText( IDC_lblConfirm, m_psDesc );
  20. int x = GetSystemMetrics(SM_CXICON);
  21. int y = GetSystemMetrics(SM_CYICON);
  22. HANDLE hIcon = LoadImage( NULL, MAKEINTRESOURCE(IDI_INFORMATION), IMAGE_ICON, x, y, LR_SHARED );
  23. LONG_PTR lStyle;
  24. if (hIcon)
  25. {
  26. HWND hWndIcon = GetDlgItem( IDC_ICON_INFO );
  27. if (hWndIcon)
  28. {
  29. // Set the style to size the icon according to the size of control
  30. lStyle = ::GetWindowLongPtr(hWndIcon, GWL_STYLE);
  31. if (0 != lStyle)
  32. {
  33. if ( ::SetWindowLongPtr(hWndIcon, GWL_STYLE, lStyle | SS_REALSIZECONTROL))
  34. {
  35. ::SetWindowPos( hWndIcon, 0, 0, 0, x, y, SWP_NOMOVE | SWP_NOZORDER );
  36. ::SendMessage( hWndIcon, STM_SETIMAGE, (WPARAM) IMAGE_ICON, (LPARAM)hIcon );
  37. }
  38. }
  39. }
  40. }
  41. return 0;
  42. }
  43. LRESULT CNewUserConfirmDlg::OnOK( WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled )
  44. {
  45. m_bHideDoNotShow = (IsDlgButtonChecked(IDC_optDoNotShow) == BST_CHECKED);
  46. EndDialog( IDOK );
  47. return 0;
  48. }