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.

93 lines
2.4 KiB

  1. #include "precomp.h"
  2. #pragma hdrstop
  3. /***************************************************************************/
  4. /****************** Basic Class Dialog Handlers ****************************/
  5. /***************************************************************************/
  6. /*
  7. ** Purpose:
  8. ** Quit Dialog procedure.
  9. ** Control IDs:
  10. ** Pushbuttons recognized are IDC_O, IDC_C, IDC_M, IDC_H, IDC_X, and IDC_B.
  11. ** Initialization:
  12. ** none.
  13. ** Termination:
  14. ** The id of the Pushbutton (eg IDC_C) which caused termination is
  15. ** converted to a string and stored in the symbol $(ButtonPressed).
  16. **
  17. *****************************************************************************/
  18. INT_PTR APIENTRY FGstQuitDlgProc(HWND hdlg,
  19. UINT wMsg,
  20. WPARAM wParam,
  21. LPARAM lParam)
  22. {
  23. CHP rgchNum[10];
  24. Unused(lParam);
  25. switch (wMsg)
  26. {
  27. case WM_INITDIALOG:
  28. AssertDataSeg();
  29. if( wMsg == WM_INITDIALOG ) {
  30. FCenterDialogOnDesktop(hdlg);
  31. }
  32. return(fTrue);
  33. case STF_REINITDIALOG:
  34. return(fTrue);
  35. case WM_CLOSE:
  36. PostMessage(
  37. hdlg,
  38. WM_COMMAND,
  39. MAKELONG(IDC_X, BN_CLICKED),
  40. 0L
  41. );
  42. return(fTrue);
  43. case WM_COMMAND:
  44. switch(LOWORD(wParam))
  45. {
  46. case IDCANCEL:
  47. if (LOWORD(wParam) == IDCANCEL) {
  48. if (!GetDlgItem(hdlg, IDC_B) || HIWORD(GetKeyState(VK_CONTROL)) || HIWORD(GetKeyState(VK_SHIFT)) || HIWORD(GetKeyState(VK_MENU)))
  49. {
  50. break;
  51. }
  52. wParam = IDC_B;
  53. }
  54. case IDC_O:
  55. case IDC_C:
  56. case IDC_M:
  57. case IDC_B:
  58. case IDC_X:
  59. case IDC_BTN0:
  60. case IDC_BTN1: case IDC_BTN2: case IDC_BTN3:
  61. case IDC_BTN4: case IDC_BTN5: case IDC_BTN6:
  62. case IDC_BTN7: case IDC_BTN8: case IDC_BTN9:
  63. _itoa((INT)wParam, rgchNum, 10);
  64. while (!FAddSymbolValueToSymTab("ButtonPressed", rgchNum))
  65. if (!FHandleOOM(hdlg))
  66. {
  67. DestroyWindow(GetParent(hdlg));
  68. return(fTrue);
  69. }
  70. PostMessage(GetParent(hdlg), (WORD)STF_UI_EVENT, 0, 0L);
  71. break;
  72. }
  73. break;
  74. case STF_DESTROY_DLG:
  75. PostMessage(GetParent(hdlg), (WORD)STF_QUIT_DLG_DESTROYED, 0, 0L);
  76. DestroyWindow(hdlg);
  77. return(fTrue);
  78. }
  79. return(fFalse);
  80. }