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.

127 lines
2.4 KiB

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