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.

106 lines
2.4 KiB

  1. /*-----------------------------------------------------------------------------
  2. dialcan.cpp
  3. This function handle the stern warning given when the user cancels
  4. setting up their Internet software
  5. Copyright (C) 1996 Microsoft Corporation
  6. All rights reserved
  7. Authors:
  8. ChrisK Chris Kauffman
  9. Histroy:
  10. 7/22/96 ChrisK Cleaned and formatted
  11. -----------------------------------------------------------------------------*/
  12. #include "pch.hpp"
  13. #include "globals.h"
  14. HRESULT ShowDialReallyCancelDialog(HINSTANCE hInst, HWND hwnd, LPTSTR pszHomePhone)
  15. {
  16. INT iRC = 0;
  17. #if defined(WIN16)
  18. #define DLGPROC16 DLGPROC // Identify as only cast for Win16
  19. DLGPROC dlgprc;
  20. dlgprc = (DLGPROC16) MakeProcInstance((FARPROC)DialReallyCancelDlgProc, hInst);
  21. iRC = DialogBoxParam(hInst,
  22. MAKEINTRESOURCE(IDD_DIALREALLYCANCEL),
  23. hwnd, dlgprc, (LPARAM)pszHomePhone);
  24. FreeProcInstance((FARPROC) dlgprc);
  25. #else
  26. iRC = (HRESULT)DialogBoxParam(hInst,
  27. MAKEINTRESOURCE(IDD_DIALREALLYCANCEL),
  28. hwnd, DialReallyCancelDlgProc,
  29. (LPARAM)pszHomePhone);
  30. #endif
  31. return iRC;
  32. }
  33. extern "C" INT_PTR CALLBACK FAR PASCAL DialReallyCancelDlgProc(HWND hwnd,
  34. UINT uMsg,
  35. WPARAM wparam,
  36. LPARAM lparam)
  37. {
  38. BOOL bRes = TRUE;
  39. #if defined(WIN16)
  40. RECT MyRect;
  41. RECT DTRect;
  42. #endif
  43. switch (uMsg)
  44. {
  45. case WM_INITDIALOG:
  46. #if defined(WIN16)
  47. //
  48. // Move the window to the center of the screen
  49. //
  50. GetWindowRect(hwnd, &MyRect);
  51. GetWindowRect(GetDesktopWindow(), &DTRect);
  52. MoveWindow(hwnd, (DTRect.right - MyRect.right) / 2, (DTRect.bottom - MyRect.bottom) /2,
  53. MyRect.right, MyRect.bottom, FALSE);
  54. SetNonBoldDlg(hwnd);
  55. #endif
  56. MakeBold(GetDlgItem(hwnd,IDC_LBLTITLE),TRUE,FW_BOLD);
  57. if (lparam)
  58. SetDlgItemText(hwnd,IDC_LBLCALLHOME,(LPCTSTR)lparam);
  59. bRes = TRUE;
  60. break;
  61. #if defined(WIN16)
  62. case WM_SYSCOLORCHANGE:
  63. Ctl3dColorChange();
  64. break;
  65. #endif
  66. case WM_DESTROY:
  67. ReleaseBold(GetDlgItem(hwnd,IDC_LBLTITLE));
  68. #ifdef WIN16
  69. DeleteDlgFont(hwnd);
  70. #endif
  71. bRes=FALSE;
  72. break;
  73. case WM_CLOSE:
  74. EndDialog(hwnd,ERROR_USERCANCEL);
  75. break;
  76. case WM_COMMAND:
  77. switch(LOWORD(wparam))
  78. {
  79. case IDC_CMDCANCEL:
  80. EndDialog(hwnd,ERROR_USERCANCEL);
  81. break;
  82. case IDC_CMDNEXT:
  83. EndDialog(hwnd,ERROR_USERNEXT);
  84. break;
  85. }
  86. break;
  87. default:
  88. bRes = FALSE;
  89. break;
  90. }
  91. return bRes;
  92. }