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.

115 lines
2.1 KiB

  1. /* File: C:\WACKER\TDLL\PRE_DLG.C (Created: 12-Jan-1994)
  2. * created from:
  3. * File: C:\WACKER\TDLL\genrcdlg.c (Created: 16-Dec-1993)
  4. * created from:
  5. * File: C:\HA5G\ha5g\genrcdlg.c (Created: 12-Sep-1990)
  6. *
  7. * Copyright 1990,1993,1994 by Hilgraeve Inc. -- Monroe, MI
  8. * All rights reserved
  9. *
  10. * $Revision: 3 $
  11. * $Date: 7/12/02 8:03a $
  12. */
  13. #include <windows.h>
  14. #include "stdtyp.h"
  15. #include "mc.h"
  16. #if !defined(DlgParseCmd)
  17. #define DlgParseCmd(i,n,c,w,l) i=LOWORD(w);n=HIWORD(w);c=(HWND)l;
  18. #endif
  19. struct stSaveDlgStuff
  20. {
  21. int nOldHelpId;
  22. /*
  23. * Put in whatever else you might need to access later
  24. */
  25. };
  26. typedef struct stSaveDlgStuff SDS;
  27. /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  28. * FUNCTION:
  29. * PrintEchoDlg
  30. *
  31. * DESCRIPTION:
  32. * This function is the dialog proc for the Print Echo dialog box. No real
  33. * suprises here.
  34. *
  35. * ARGUMENTS: Standard Windows dialog manager
  36. *
  37. * RETURNS: Standard Windows dialog manager
  38. *
  39. */
  40. BOOL CALLBACK PrintEchoDlg(HWND hDlg, UINT wMsg, WPARAM wPar, LPARAM lPar)
  41. {
  42. HWND hwndChild;
  43. INT nId;
  44. INT nNtfy;
  45. SDS *pS;
  46. switch (wMsg)
  47. {
  48. case WM_INITDIALOG:
  49. pS = (SDS *)malloc(sizeof(SDS));
  50. if (pS == (SDS *)0)
  51. {
  52. /* TODO: decide if we need to display an error here */
  53. EndDialog(hDlg, FALSE);
  54. }
  55. else
  56. {
  57. pS->nOldHelpId = 0;
  58. }
  59. SetWindowLongPtr(hDlg, DWLP_USER, (LONG_PTR)pS);
  60. break;
  61. case WM_DESTROY:
  62. break;
  63. case WM_COMMAND:
  64. /*
  65. * Did we plan to put a macro in here to do the parsing ?
  66. */
  67. DlgParseCmd(nId, nNtfy, hwndChild, wPar, lPar);
  68. switch (nId)
  69. {
  70. case IDHELP:
  71. break;
  72. case IDOK:
  73. pS = (SDS *)GetWindowLongPtr(hDlg, DWLP_USER);
  74. /*
  75. * Do whatever saving is necessary
  76. */
  77. /* Free the storeage */
  78. free(pS);
  79. pS = (SDS *)0;
  80. EndDialog(hDlg, TRUE);
  81. break;
  82. case IDCANCEL:
  83. pS = (SDS *)GetWindowLongPtr(hDlg, DWLP_USER);
  84. /* Free the storeage */
  85. free(pS);
  86. pS = (SDS *)0;
  87. EndDialog(hDlg, FALSE);
  88. break;
  89. default:
  90. return FALSE;
  91. }
  92. break;
  93. default:
  94. return FALSE;
  95. }
  96. return TRUE;
  97. }