home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: Graphics / Graphics.zip / os2apipm.zip / PMEXAM / DIALOG / HELPDIAL.ADS < prev    next >
Text File  |  1996-08-13  |  6KB  |  155 lines

  1. with Os2; use Os2;
  2. with Os2.Pmsc;
  3. Package helpdial is
  4. --  resurse constant dialog.h
  5. ID_MAINWND     : constant ulong :=  256 ;
  6. ID_MYDIALOG    : constant ulong :=  257 ;
  7. ID_ENTRYFIELD  : constant ulong :=  258 ;
  8. ID_COMMANDS    : constant ulong :=  259 ;
  9. ID_WHERE       : constant ulong :=  260 ;
  10. ID_EXITPROGRAM : constant ulong :=  261 ;
  11. ID_RESPONSE    : constant ulong :=  262 ;
  12. ID_MESSAGEBOX  : constant ulong :=  263 ;
  13. ID_BITMAP      : constant ulong :=  264 ;
  14. ID_PRODINFO    : constant ulong :=  265 ;
  15. ID_NULL        : constant ulong :=  9999;
  16. -- program constants and variables
  17. length_string : constant integer := 33 ;
  18.  ha                           :aliased HAB         ; -- Anchor block handle
  19.  mq                           :aliased HMQ         ; -- Message queue handle
  20.  msg                          :aliased QMSG        ; -- Message from message queue
  21.  hwndClient                   :aliased HWND        ; -- Client window handle
  22.  hwndFrame                    :aliased HWND        ; -- Frame window handle
  23.  
  24.  
  25. --  hwnd_desktop                 :aliased HWND        ; -- Place in desktop
  26.  szLocation:astring(1..length_string):=(others=>' '); -- To hold text entered by user
  27.  szResponse:astring(1..length_string):=(others=>' '); -- To hold "You live in"
  28.  bComplete                     :BOOL := 0           ; -- Switch for first time through
  29.  rcb                           :BOOL                ;
  30.  rcl                           :LONG                ;
  31.  rcul                          :ULONG               ;
  32.  rcb32                         :BOOL32              ;
  33.  rcmr                          :Mresult             ;
  34.  nul_char                      :constant character :=character'val(0) ;
  35.  zero                          :LONG               := 0;
  36.  
  37. --  procedures and functions
  38. --
  39. --  ***************************************************************
  40. --    Name:   MyWndProc
  41. --
  42. --    Description : Window procedure for the main clent window.
  43. --
  44. --    Concepts : Processes the messages sent to the main client
  45. --               window.
  46. --
  47. --    API's : WinLoadString
  48. --            WinDlgBox
  49. --            WinInvalidateRegion
  50. --            WinPostMsg
  51. --            WinDefDlgProc
  52. --            WinBeginPaint
  53. --            WinFillRect
  54. --            GpiCharStringAt
  55. --            GpiSetColor
  56. --            WinEndPaint
  57. --
  58. --   Parameters   : hwn - Window handle to which message is addressed
  59. --                  msg - Message type
  60. --                  mp1 - First message parameter
  61. --                  mp2 - Second message parameter
  62. --
  63. --    Returns:  Return values are determined by each message
  64. --
  65. --  **************************************************************
  66. function  MyWindowProc (hwn:HWND ; msg:ULONG;mp1,mp2:MPARAM)  return ulong;
  67.  
  68. --  ********************************************************************
  69. --    Name : MyDlgProc
  70. --
  71. --    Description : Processes all messages sent to the dialog.
  72. --
  73. --    Concepts : Called for each message sent to the dialog box.
  74. --               A switch statement branches to the routines to be
  75. --               performed for each message processed.  Any messages
  76. --               not specifically process are passed to the default
  77. --               window procedure WinDefDlgProc().
  78. --
  79. --    API's : WinQueryWindowText
  80. --            WinDismissDlg
  81. --
  82. --   Parameters   : hwn - Window handle to which message is addressed
  83. --                  msg - Message type
  84. --                  mp1 - First message parameter
  85. --                  mp2 - Second message parameter
  86. --
  87. --    Returns : Dependent upon message sent
  88. --
  89. --  **************************************************************
  90. function  MyDlgProc (hwndDlg:HWND ; msg:ULONG;mp1,mp2:MPARAM)  return ulong;
  91.  
  92. --  ********************************************************************
  93. --    Name : ProdInfoDlgProc
  94. --
  95. --    Description : Processes all messages sent to the Product
  96. --                  Information dialog box.
  97. --
  98. --    Concepts : Called for each message sent to the Product
  99. --               Information dialog box.  The Product
  100. --               Information box only has a button control so
  101. --               this routine only processes WM_COMMAND
  102. --               messages.  Any WM_COMMAND posted must have come
  103. --               from the Ok button so we dismiss the dialog
  104. --               upon receiving it.
  105. --
  106. --    API's : WinDismissDlg
  107. --            WinDefDlgProc
  108. --
  109. --   Parameters   : hwn - Window handle to which message is addressed
  110. --                  msg - Message type
  111. --                  mp1 - First message parameter
  112. --                  mp2 - Second message parameter
  113. --
  114. --    Returns : Dependent upon message sent
  115. --
  116. --  **************************************************************
  117. function  ProdInfoDlgProc(hwn:HWND ; msg:ULONG;mp1,mp2:MPARAM)  return ulong;
  118. --  ***************************************************************
  119. --    Name:   DisplayMessage
  120. --
  121. --    Description : Displays error messages.
  122. --
  123. --    Concepts : Displays a message box containing an error
  124. --               message each time called.
  125. --
  126. --    API's : WinMessageBoxNon
  127. --
  128. --   Parameters   : str - error message to display
  129. --
  130. --    Returns:  Void
  131. --
  132. --  **************************************************************
  133. procedure DisplayMessage(str:astring);
  134.  
  135. --  **********************************************************
  136. --   Name         : SetSysMenu
  137. --
  138. --   Description  : Procedure to remove unselectable items from
  139. --                  the window system menu.
  140. --
  141. --   Concepts     : This routine determines the number of items
  142. --                  in the system menu, loops through those
  143. --                  items removing disabled menu items and menu
  144. --                  seperators.
  145. --
  146. --   API's        : WinMessageBox
  147. --
  148. --   Parameters   : None
  149. --
  150. --   Return       : None
  151. --
  152. --  ************************************************************
  153. procedure SetSysMenu(hwndDlg:HWND ) ;
  154. end helpdial ;
  155.