home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: Graphics / Graphics.zip / os2apipm.zip / PMEXAM / HELLO / HELPHELL.ADS < prev    next >
Text File  |  1996-08-12  |  4KB  |  103 lines

  1. with os2; use os2;
  2.  
  3. package helphell is
  4.  
  5.  MSGBOXID     : CONSTANT ULONG:= 1001 ;
  6.  ID_WINDOW    : CONSTANT ULONG:=  256 ;
  7.  ID_OPTIONS   : CONSTANT ULONG:=  257 ;
  8.  ID_OPTION1   : CONSTANT ULONG:=  258 ;
  9.  ID_OPTION2   : CONSTANT ULONG:=  259 ;
  10.  ID_OPTION3   : CONSTANT ULONG:=  260 ;
  11.  ID_EXITPROG  : CONSTANT ULONG:=  261 ;
  12.  
  13.  IDS_HELLO    : CONSTANT ULONG:=  262 ;
  14.  IDS_1        : CONSTANT ULONG:=  263 ;
  15.  IDS_2        : CONSTANT ULONG:=  264 ;
  16.  IDS_3        : CONSTANT ULONG:=  265 ;
  17.  
  18.  mq        :     HMQ              ;        -- Message queue handle
  19. hwndClient : aliased     HWND:= 0 ;        -- Client area window handle
  20. hwndFrame  : aliased     HWND:= 0 ;        -- Frame window handle  ULONG
  21.  msg       : aliased     QMSG     ;        -- Message from message queue
  22. flCreate   : aliased     ULONG    ;        -- Window creation control flags
  23. -- return codes
  24. rcb   :BOOL;
  25. rcb32 :BOOL32;
  26. rcl   :LONG;
  27. rcul  :ULONG;
  28. rcmr  :Mresult;
  29. zero  :constant Ulong :=0;
  30. one   :constant Ulong :=1;
  31. nul_char:character:=character'val(0);
  32. hello_txt  : string(1..13):= "HELLO ADA-95 " ;
  33.  
  34. win  :astring(1..9):="MyWindow" & nul_char;  -- Window class name
  35. pwin :PSZ:=win'address;
  36. str  :string(1..80):=(others => nul_char);
  37. STRINGLENGTH :constant long:=20;        -- Length of string
  38. subtype str20  is string(1..integer(STRINGLENGTH));
  39. ha :HAB ;                               -- PM anchor block handle
  40. szHello:str20 ;       -- String parameters, set in
  41. sz1:str20     ;       -- the processing of WM_CREATE,
  42. sz2:str20     ;       -- and used in the processing
  43. sz3:str20     ;       -- of WM_COMMAND, in window
  44. szString:str20;       -- procedure.
  45. pszErrMsg:PSZ;
  46. --  --*************************************************************************
  47. --   *
  48. --   *  Name       : GoOut
  49. --   *
  50. --   *  Description: Report an error returned from an API service
  51. --   *
  52. --   *  Concepts   :  use of message box to display information
  53. --   *
  54. --   *  API's      :  DosBeep                 OS2.Bse
  55. --   *                WinGetErrorInfo         OS2.PMcp
  56. --   *                WinMessageBox           OS2.PMwd
  57. --   *                WinFreeErrorInfo        OS2.PMcp
  58. --   *                WinPostMsg              OS2.PMwb
  59. --   *
  60. --   *  Parameters :      Frame:= frame window handle
  61. --   *                    Client:= client window handle
  62. --   *
  63. --   ************************************************************************
  64. function  GoOut(Frame ,Client:HWND) return BOOL32;
  65.  
  66. --  --*************************************************************************
  67. --   *
  68. --   *  Name       : MyWindowProc
  69. --   *
  70. --   *  Description: The window procedure associated with the client area in
  71. --   *               the standard frame window. It processes all messages
  72. --   *               either sent or posted to the client area, depending on
  73. --   *               the message command and parameters.
  74. --   *
  75. --   *  Concepts   :
  76. --   *
  77. --   *  API's      :   WinLoadString          OS2.PMwb
  78. --   *                 WinInvalidateRegion    OS2.PMwb
  79. --   *                 WinPostMsg             OS2.PMwb
  80. --   *                 WinDefWindowProc       OS2.PMwb
  81. --   *                 WinBeginPaint          OS2.PMwb
  82. --   *                 GpiSetColor            OS2.Gpi
  83. --   *                 GpiSetBackColor        OS2.Gpi
  84. --   *                 GpiSetBackMix          OS2.Gpi
  85. --   *                 GpiCharStringAt        OS2.Gpi
  86. --   *                 WinEndPaint            OS2.PMwb
  87. --   *
  88. --   *  Parameters :  hwnd:= window handle
  89. --   *                msg:= message code
  90. --   *                mp1:= first message parameter
  91. --   *                mp2:= second message parameter
  92. --   *
  93. --   *  Return     :  depends on message sent
  94. --   *
  95. --   ************************************************************************
  96.  
  97. function MyWindowProc(hwn:HWND   ;
  98.                       msg:ULONG  ;
  99.                       mp1:Mparam ;
  100.                       mp2:Mparam )return Ulong ;
  101. pproc:PFNWP   ;   -- Address of window procedure
  102. end helphell;
  103.