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.

90 lines
2.5 KiB

  1. #include "precomp.h"
  2. #pragma hdrstop
  3. /***************************************************************************/
  4. /****************** Basic Class Dialog Handlers ****************************/
  5. /***************************************************************************/
  6. /*
  7. ** Purpose:
  8. ** Information 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 FGstInfoDlgProc(HWND hdlg, UINT wMsg, WPARAM wParam,
  19. LPARAM lParam)
  20. {
  21. CHP rgchNum[10];
  22. Unused(lParam);
  23. switch (wMsg) {
  24. case STF_REINITDIALOG:
  25. return(fTrue);
  26. case WM_INITDIALOG:
  27. AssertDataSeg();
  28. if( wMsg == WM_INITDIALOG ) {
  29. FCenterDialogOnDesktop(hdlg);
  30. }
  31. return(fTrue);
  32. case WM_CLOSE:
  33. PostMessage(
  34. hdlg,
  35. WM_COMMAND,
  36. MAKELONG(IDC_X, BN_CLICKED),
  37. 0L
  38. );
  39. return(fTrue);
  40. case WM_COMMAND:
  41. switch (LOWORD(wParam))
  42. {
  43. case IDCANCEL:
  44. if (LOWORD(wParam) == IDCANCEL) {
  45. if (!GetDlgItem(hdlg, IDC_B) || HIWORD(GetKeyState(VK_CONTROL)) || HIWORD(GetKeyState(VK_SHIFT)) || HIWORD(GetKeyState(VK_MENU)))
  46. {
  47. break;
  48. }
  49. wParam = IDC_B;
  50. }
  51. case IDC_O:
  52. case IDC_C:
  53. case IDC_M:
  54. case IDC_B:
  55. case IDC_X:
  56. case IDC_BTN0:
  57. case IDC_BTN1: case IDC_BTN2: case IDC_BTN3:
  58. case IDC_BTN4: case IDC_BTN5: case IDC_BTN6:
  59. case IDC_BTN7: case IDC_BTN8: case IDC_BTN9:
  60. _itoa((INT)wParam, rgchNum, 10);
  61. while (!FAddSymbolValueToSymTab("ButtonPressed", rgchNum))
  62. if (!FHandleOOM(hdlg))
  63. {
  64. DestroyWindow(GetParent(hdlg));
  65. return(fTrue);
  66. }
  67. PostMessage(GetParent(hdlg), (WORD)STF_UI_EVENT, 0, 0L);
  68. break;
  69. }
  70. break;
  71. case STF_DESTROY_DLG:
  72. PostMessage(GetParent(hdlg), (WORD)STF_INFO_DLG_DESTROYED, 0, 0L);
  73. DestroyWindow(hdlg);
  74. return(fTrue);
  75. }
  76. return(fFalse);
  77. }