Source code of Windows XP (NT5)
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.

87 lines
1.9 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. dialogs.c
  5. Abstract:
  6. This file implements the common dialog proc and other
  7. common code used by other dialog procs. All global
  8. data used by the dialog procs lives here too.
  9. Environment:
  10. WIN32 User Mode
  11. Author:
  12. Wesley Witt (wesw) 17-Feb-1996
  13. --*/
  14. #include "faxocm.h"
  15. #pragma hdrstop
  16. INT_PTR
  17. CommonDlgProc(
  18. HWND hwnd,
  19. UINT msg,
  20. WPARAM wParam,
  21. LPARAM lParam
  22. )
  23. {
  24. PWIZPAGE WizPage;
  25. WizPage = (PWIZPAGE) GetWindowLongPtr( hwnd, DWLP_USER );
  26. switch( msg ) {
  27. case WM_INITDIALOG:
  28. SetWindowLongPtr( hwnd, DWLP_USER, ((LPPROPSHEETPAGE) lParam)->lParam );
  29. WizPage = (PWIZPAGE) ((LPPROPSHEETPAGE) lParam)->lParam;
  30. break;
  31. case WM_NOTIFY:
  32. switch( ((LPNMHDR)lParam)->code ) {
  33. case PSN_SETACTIVE:
  34. PropSheet_SetWizButtons(
  35. GetParent(hwnd),
  36. WizPage->ButtonState
  37. );
  38. SetWindowLongPtr( hwnd, DWLP_MSGRESULT, 0 );
  39. break;
  40. case PSN_QUERYCANCEL:
  41. {
  42. if (!OkToCancel) {
  43. DWORD Answer;
  44. MessageBeep(0);
  45. Answer = PopUpMsg( hwnd, IDS_QUERY_CANCEL, FALSE, MB_YESNO );
  46. if (Answer == IDNO) {
  47. SetWindowLongPtr( hwnd, DWLP_MSGRESULT, 1 );
  48. return TRUE;
  49. } else {
  50. InstallThreadError = ERROR_CANCELLED;
  51. }
  52. }
  53. }
  54. break;
  55. }
  56. break;
  57. }
  58. if (WizPage && WizPage->DlgProc) {
  59. return WizPage->DlgProc( hwnd, msg, wParam, lParam );
  60. }
  61. return FALSE;
  62. }