home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / adapm_15.zip / win_bak.ads < prev    next >
Text File  |  1994-03-14  |  51KB  |  1,166 lines

  1. ------------------------------------------------------------------------------
  2. --                                                                          --
  3. --                               PM Bindings                                --
  4. --                                                                          --
  5. --                                  WIN                                     --
  6. --                                                                          --
  7. --                                 S p e c                                  --
  8. --                                                                          --
  9. --                            $Revision: .14 $                              --
  10. --   .14
  11. --     Point_Pointer_Type for the GPI Query_Current_Position function.
  12. --     Command_Info_is for decoding Wm_Command messages, 
  13. --     Check_Menu_Item
  14. --     Window_From_Id
  15. --
  16. --                                                                          --
  17. --     Copyright (c) 1994 Dimensional Media Systems, All Rights Reserved    --
  18. --                                                                          --
  19. --   The PM bindings are free software; you can redistribute them and/or    --
  20. --   modify them under terms of the GNU General Public License as published --
  21. --   by the Free Software Foundation; either version 2, or (at your         --
  22. --   option) any later version.  The PM bindings are distributed in the     --
  23. --   hope that they will be useful, but WITH OUT ANY WARRANTY; without even --
  24. --   the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR    --
  25. --   PURPOSE.  See the GNU General Public License for more details.  You    --
  26. --   should have received a copy of the GNU General Public License          --
  27. --   distributed with The PM bindings; see file COPYING.  If not, write to  --
  28. --   the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  --
  29. --                                                                          --
  30. ------------------------------------------------------------------------------
  31. --                                                                          --
  32. --   For more information about these PM bindings and their usage with GNAT --
  33. --   you can contact Bill Yow at                                            --
  34. --                                                                          --  
  35. --      Dimensional Media Systems (DMS)                                     --
  36. --      1522 Festival Dr.                                                   --
  37. --      Houston TX, 77062                                                   --
  38. --      Phone - (713) 488-7050                                              --
  39. --      Email - Byow@mci.com                                                --
  40. --                                                                          --
  41. ------------------------------------------------------------------------------
  42.  
  43. with Pm_Types;
  44.  
  45. package Win is
  46.  
  47.   System_Default : constant := 0;
  48.  
  49.   type PULong is access Pm_Types.U_Long;
  50.  
  51.  ---------------------------------------------------------------
  52.  
  53.  --Window Handle type
  54.  
  55.   type Handle_Type is private;                     --PM's HWND
  56.  
  57.   type Handle_Pointer_Type is access Handle_Type;  --PM's PHWND
  58.  
  59.   Null_Window           : constant Handle_Type;
  60.   Null_HWND             : constant Handle_Type;  
  61.   Desktop_Window        : constant Handle_Type;  --PM's HWND_DESKTOP
  62.   Top_Window            : constant Handle_Type;  --PM's HWND_TOP
  63.   Bottom_Windw          : constant Handle_Type;  --PM's HWND_BOTTOM
  64.   Object_Handle         : constant Handle_Type;  --PM's HWND_OBJECT
  65.   Thread_Capture_Handle : constant Handle_Type;  --PM's HWND_THREADCAPTURE 
  66.  
  67.   type Id_Type is new Pm_Types.U_Long;
  68.  
  69.  ------------------------------------------------------------
  70.  
  71.   type Void_Type is new PM_Types.U_Long;
  72.  
  73.   function To_Boolean   (Void : Void_Type) return Boolean;
  74.   function To_Short     (Void : Void_Type) return Pm_Types.Short;
  75.   function To_U_Short   (Void : Void_Type) return Pm_Types.U_Short;
  76.  
  77.  ------------------------------------------------------------
  78.  
  79.   type Queue_Handle_Type is private;        --HMQ
  80.   Null_Queue : constant Queue_Handle_Type;
  81.  
  82.   Null_HMQ : constant Queue_Handle_Type;
  83.  
  84.  ----------------------------------------------------------- 
  85.  
  86.   type Anchor_Block_Handle_Type is private;  --HAB
  87.   Null_Anchor_Block : constant Anchor_Block_Handle_Type;
  88.  
  89.   Null_HAB : constant Anchor_Block_Handle_Type;
  90.  
  91.   ----------------------------------------------------------
  92.  
  93.   type Ps_Type is private;  --Hps
  94.   Null_PS : constant PS_Type;
  95.  
  96.   ----------------------------------------------------------
  97.  
  98.   type Parameter_Type is new Pm_Types.Long;
  99.  
  100.   type Time_Type is new Pm_Types.Long;
  101.  
  102.   type Pixel_Type is new Pm_Types.Long;
  103.  
  104.   subtype World_Model_Space_Type 
  105.               is Pixel_Type range -134_217_728 .. 134_217_727;
  106.  
  107.   subtype Device_Screen_Space_Type 
  108.               is Pixel_Type range -32_768 .. 32_767;
  109.  
  110.  ---------------------------------------------------
  111.  -- Messages
  112.  
  113.   type Message_Type is new Pm_Types.U_Long;
  114.  
  115.   --Standard Window Messages
  116.  
  117.   Wm_Null                  : constant Message_Type := 16#0000#;
  118.   Wm_Create                : constant Message_Type := 16#0001#;
  119.   Wm_Destroy               : constant Message_Type := 16#0002#;
  120.  
  121.   Wm_Enable                : constant Message_Type := 16#0004#;
  122.   Wm_Show                  : constant Message_Type := 16#0005#;
  123.   Wm_Move                  : constant Message_Type := 16#0006#;
  124.   Wm_Size                  : constant Message_Type := 16#0007#;
  125.   Wm_Adjust_Window_Pos     : constant Message_Type := 16#0008#;
  126.  
  127.   Wm_Calc_Valid_Rects      : constant Message_Type := 16#0009#;
  128.  
  129.   Wm_Set_Window_Params     : constant Message_Type := 16#000A#;
  130.   Wm_Query_Window_Params   : constant Message_Type := 16#000B#;
  131.   Wm_Hit_Test              : constant Message_Type := 16#000C#;
  132.   Wm_Activate              : constant Message_Type := 16#000D#;
  133.   Wm_Set_Focus             : constant Message_Type := 16#000F#;
  134.   Wm_Set_Selection         : constant Message_Type := 16#0010#;
  135.  
  136.   --Language Support Winproc
  137.   Wm_P_Paint               : constant Message_Type := 16#0011#;
  138.   Wm_P_Set_Focus           : constant Message_Type := 16#0012#;
  139.   Wm_P_Sys_Color_Change    : constant Message_Type := 16#0013#;
  140.   Wm_P_Size                : constant Message_Type := 16#0014#;
  141.   Wm_P_Activate            : constant Message_Type := 16#0015#;
  142.   Wm_P_Control             : constant Message_Type := 16#0016#;
  143.  
  144.   Wm_Command               : constant Message_Type := 16#0020#;
  145.   Wm_Sys_Command           : constant Message_Type := 16#0021#;
  146.   Wm_Help                  : constant Message_Type := 16#0022#;
  147.   Wm_Paint                 : constant Message_Type := 16#0023#;
  148.  
  149.   --Used for SAA 
  150.   Wm_Timer                 : constant Message_Type := 16#0024#;
  151.   Wm_Sem_1                 : constant Message_Type := 16#0025#;
  152.   Wm_Sem_2                 : constant Message_Type := 16#0026#;
  153.   Wm_Sem_3                 : constant Message_Type := 16#0027#;
  154.   Wm_Sem_4                 : constant Message_Type := 16#0028#;
  155.  
  156.   Wm_Close                 : constant Message_Type := 16#0029#;
  157.   Wm_Quit                  : constant Message_Type := 16#002A#;
  158.   Wm_Sys_Color_Change      : constant Message_Type := 16#002B#;
  159.   Wm_Sys_Value_Changed     : constant Message_Type := 16#002D#;
  160.   Wm_App_Terminate_Notify  : constant Message_Type := 16#002E#;
  161.   Wm_Pres_Param_Changed    : constant Message_Type := 16#002F#;
  162.  
  163.   --Control notification messages
  164.  
  165.   Wm_Control               : constant Message_Type := 16#0030#;
  166.   Wm_V_Scroll              : constant Message_Type := 16#0031#;
  167.   Wm_H_Scroll              : constant Message_Type := 16#0032#;
  168.   Wm_Init_Menu             : constant Message_Type := 16#0033#;
  169.   Wm_Menu_Select           : constant Message_Type := 16#0034#;
  170.   Wm_Menu_End              : constant Message_Type := 16#0035#;
  171.   Wm_Draw_Item             : constant Message_Type := 16#0036#;
  172.   Wm_Measure_Item          : constant Message_Type := 16#0037#;
  173.   Wm_Control_Pointer       : constant Message_Type := 16#0038#;
  174.   Wm_Query_Dlg_Code        : constant Message_Type := 16#003A#;
  175.   Wm_Init_Dgl              : constant Message_Type := 16#003B#;
  176.   Wm_Substitute_String     : constant Message_Type := 16#003C#;
  177.   Wm_Match_Menonic         : constant Message_Type := 16#003D#;
  178.   Wm_Save_Application      : constant Message_Type := 16#003E#;
  179.  
  180.   --Mouse Messages
  181.   
  182.   Wm_Mouse_First           : constant Message_Type := 16#0070#;
  183.   Wm_Mouse_Last            : constant Message_Type := 16#0079#;
  184.   Wm_Button_Click_First    : constant Message_Type := 16#0071#;
  185.   Wm_Button_Click_Last     : constant Message_Type := 16#0079#;
  186.  
  187.   Wm_Mouse_Move            : constant Message_Type := 16#0070#;
  188.  
  189.   Wm_Button_1_Down         : constant Message_Type := 16#0071#;
  190.   Wm_Button_1_Up           : constant Message_Type := 16#0072#;
  191.   Wm_Button_1_Dbl_Clk      : constant Message_Type := 16#0073#;
  192.   Wm_Button_2_Down         : constant Message_Type := 16#0074#;
  193.   Wm_Button_2_Up           : constant Message_Type := 16#0075#;
  194.   Wm_Button_2_Dbl_Clk      : constant Message_Type := 16#0076#;
  195.   Wm_Button_3_Down         : constant Message_Type := 16#0077#;
  196.   Wm_Button_3_Up           : constant Message_Type := 16#0078#;
  197.   Wm_Button_3_Dbl_Clk      : constant Message_Type := 16#0079#;
  198.  
  199.   Wm_Ext_Mouse_First       : constant Message_Type := 16#0410#;
  200.   Wm_Ext_Mouse_Last        : constant Message_Type := 16#0419#;
  201.  
  202.   Wm_Chord                 : constant Message_Type := 16#0410#;
  203.   Wm_Button_1_Motion_Start : constant Message_Type := 16#0411#;
  204.   Wm_Button_1_Motion_End   : constant Message_Type := 16#0412#;
  205.   Wm_Button_1_Click        : constant Message_Type := 16#0413#;
  206.   Wm_Button_2_Motion_Start : constant Message_Type := 16#0414#;
  207.   Wm_Button_2_Motion_End   : constant Message_Type := 16#0415#;
  208.   Wm_Button_2_Click        : constant Message_Type := 16#0416#;
  209.   Wm_Button_3_Motion_Start : constant Message_Type := 16#0417#;
  210.   Wm_Button_3_Motion_End   : constant Message_Type := 16#0418#;
  211.   Wm_Button_3_Click        : constant Message_Type := 16#0419#;
  212.  
  213.   --Messages 16#041A# - 16#041F# are reserved
  214.  
  215.   Wm_Mouse_Translate_First : constant Message_Type := 16#0420#;
  216.   Wm_Mouse_Translate_Last  : constant Message_Type := 16#0428#;
  217.   Wm_Begin_Drag            : constant Message_Type := 16#0420#;
  218.   Wm_End_Drag              : constant Message_Type := 16#0421#;
  219.   Wm_Single_Select         : constant Message_Type := 16#0422#;
  220.   Wm_Open                  : constant Message_Type := 16#0423#;
  221.   Wm_Context_Menu          : constant Message_Type := 16#0424#;
  222.   Wm_Text_Edit             : constant Message_Type := 16#0426#;
  223.   Wm_Begin_Select          : constant Message_Type := 16#0427#;
  224.   Wm_End_Select            : constant Message_Type := 16#0428#;
  225.  
  226.   -- Key/Character input messages
  227.  
  228.   Wm_Char                  : constant Message_Type := 16#007A#;
  229.   Wm_VIO_Char              : constant Message_Type := 16#007B#;
  230.  
  231.   Wm_Journal_Notify        : constant Message_Type := 16#007C#;
  232.  
  233.   --Frame window related message
  234.  
  235.   Wm_Flash_Window          : constant Message_Type := 16#0040#;
  236.   Wm_Format_Frame          : constant Message_Type := 16#0041#;
  237.   Wm_Update_Frame          : constant Message_Type := 16#0042#;
  238.   Wm_Focus_Change          : constant Message_Type := 16#0043#;
  239.  
  240.   Wm_Set_Border_Size       : constant Message_Type := 16#0044#;
  241.   Wm_Track_Frame           : constant Message_Type := 16#0045#;
  242.   Wm_Min_Max_Frame         : constant Message_Type := 16#0046#;
  243.   Wm_Set_Icon              : constant Message_Type := 16#0047#;
  244.   Wm_Query_Icon            : constant Message_Type := 16#0048#;
  245.   Wm_Set_Accel_Table       : constant Message_Type := 16#0049#;
  246.   Wm_Query_Accel_Table     : constant Message_Type := 16#004A#;
  247.   Wm_Translate_Accel       : constant Message_Type := 16#004B#;
  248.   Wm_Query_Track_Info      : constant Message_Type := 16#004C#;
  249.   Wm_Query_Border_Size     : constant Message_Type := 16#004D#;
  250.   Wm_Next_Menu             : constant Message_Type := 16#004E#;
  251.   Wm_Erase_Background      : constant Message_Type := 16#004F#;
  252.   Wm_Query_Frame_Info      : constant Message_Type := 16#0050#;
  253.   Wm_Query_Pos_Change      : constant Message_Type := 16#0051#;
  254.   Wm_Owner_Pos_Change      : constant Message_Type := 16#0052#;
  255.   Wm_Cacl_Frame_Rect       : constant Message_Type := 16#0053#;
  256.    -- Note 16#0054# is reserved
  257.   Wm_Window_Pos_Changed    : constant Message_Type := 16#0055#;
  258.   Wm_Adjust_Frame_Pos      : constant Message_Type := 16#0056#;
  259.   Wm_Query_Frame_Ctl_Count : constant Message_Type := 16#0059#;
  260.    -- Note 16#005A# is reserved
  261.   Wm_Query_Help_Info       : constant Message_Type := 16#005B#;
  262.   Wm_Set_Help_Info         : constant Message_Type := 16#005C#;
  263.   Wm_Error                 : constant Message_Type := 16#005D#;
  264.   Wm_Realize_Palette       : constant Message_Type := 16#005E#;
  265.    
  266.   --Clipboard messages
  267.  
  268.   Wm_Render_Fmt            : constant Message_Type := 16#0060#;
  269.   Wm_Render_All_Fmts       : constant Message_Type := 16#0061#;
  270.   Wm_Destroy_Clipboard     : constant Message_Type := 16#0062#;
  271.   Wm_Paint_Clipboard       : constant Message_Type := 16#0063#;
  272.   Wm_Size_Clipboard        : constant Message_Type := 16#0064#;
  273.   Wm_H_Scroll_Clipboard    : constant Message_Type := 16#0065#;
  274.   Wm_V_Scroll_Clipboard    : constant Message_Type := 16#0066#;
  275.   Wm_Draw_Clipboard        : constant Message_Type := 16#0067#;
  276.  
  277.   --Dynamic Data Exchange (DDE) messages
  278.  
  279.   Wm_DDE_First             : constant Message_Type := 16#00A0#;
  280.   Wm_DDE_Initiate          : constant Message_Type := 16#00A0#;
  281.   Wm_DDE_Request           : constant Message_Type := 16#00A1#;
  282.   Wm_DDE_Ack               : constant Message_Type := 16#00A2#;
  283.   Wm_DDE_Data              : constant Message_Type := 16#00A3#;
  284.   Wm_DDE_Advise            : constant Message_Type := 16#00A4#;
  285.   Wm_DDE_Unadvise          : constant Message_Type := 16#00A5#;
  286.   Wm_DDE_Poke              : constant Message_Type := 16#00A6#;
  287.   Wm_DDE_Execute           : constant Message_Type := 16#00A7#;
  288.   Wm_DDE_Terminate         : constant Message_Type := 16#00A8#;
  289.   Wm_DDE_Initate_Ack       : constant Message_Type := 16#00A9#;
  290.   Wm_DDE_Last              : constant Message_Type := 16#00AF#;
  291.  
  292.   Wm_Query_Convert_Pos     : constant Message_Type := 16#00B0#;
  293.   Wm_Dbcs_First            : constant Message_Type := 16#00B0#;
  294.   Wm_Dbcs_Loat             : constant Message_Type := 16#00CF#;
  295.   
  296.   --Help manager message range
  297.  
  298.   Wm_Help_Base             : constant Message_Type := 16#0F00#;
  299.   Wm_Help_Top              : constant Message_Type := 16#0FFF#;
  300.  
  301.   --Menu Control Messages
  302.  
  303.   MM_Insert_Item             : constant Message_Type := 16#0180#;
  304.   MM_Delete_Item             : constant Message_Type := 16#0181#;
  305.   MM_Query_Item              : constant Message_Type := 16#0182#;
  306.   MM_Set_Item                : constant Message_Type := 16#0183#;
  307.   MM_Query_Item_Count        : constant Message_Type := 16#0184#;
  308.   MM_Start_Menu_Mode         : constant Message_Type := 16#0185#;
  309.   MM_End_Menu_Mode           : constant Message_Type := 16#0186#;
  310.   MM_Remove_Item             : constant Message_Type := 16#0188#;
  311.   MM_Select_Item             : constant Message_Type := 16#0189#;
  312.   MM_Query_Selected_Item_Id  : constant Message_Type := 16#018a#;
  313.   MM_Query_Item_Text         : constant Message_Type := 16#018b#;
  314.   MM_Query_Item_Text_Length  : constant Message_Type := 16#018c#;
  315.   MM_Set_Item_Handle         : constant Message_Type := 16#018d#;
  316.   MM_Set_Item_Text           : constant Message_Type := 16#018e#;
  317.   MM_Item_Position_From_Id   : constant Message_Type := 16#018f#;
  318.   MM_Item_Id_From_Position   : constant Message_Type := 16#0190#;
  319.   MM_Query_Item_Attr         : constant Message_Type := 16#0191#;
  320.   MM_Set_Item_Attr           : constant Message_Type := 16#0192#;
  321.   MM_Is_Item_Valid           : constant Message_Type := 16#0193#;
  322.   MM_Query_ITem_Rect         : constant Message_Type := 16#0194#;
  323.  
  324.   MM_Query_Default_Item_Id   : constant Message_Type := 16#0431#;
  325.   MM_Set_Default_Item_Id     : constant Message_Type := 16#0432#;
  326.  
  327.  
  328.   --User messages are defined after Wm_User
  329.   Wm_User                  : constant Message_Type := 16#1000#;
  330.  
  331.  
  332.   type MB_Button_Styles_Type is (
  333.         MB_Ok,                 -- Message box contains an 
  334.                                -- Okay pushbutton.
  335.  
  336.         MB_Ok_Cancel,          -- Message box contains both Okay and 
  337.                                -- Cancel pushbuttons.
  338.  
  339.         MB_Cancel,             -- Message box contains a Cancel pushbutton.
  340.         MB_Enter,              -- Message box contains an Enter pushbutton.
  341.         MB_Enter_Cancel,       -- Message box contains both Enter and 
  342.                                -- Cancel pushbuttons.
  343.  
  344.         MB_Retry_Cancel,       -- Message box contains both Retry and 
  345.                                -- Cancel pushbuttons.
  346.  
  347.         MB_Abort_Retry_Ignore, -- Message box contains Abort, Retry, and 
  348.                                -- Ignore pushbuttons.
  349.  
  350.         MB_Yes_No,             -- Message box contains both Yes and 
  351.                                -- No pushbuttons.
  352.  
  353.         MB_Yes_No_Cancel);     -- Message box contains Yes, No, and Cancel 
  354.                                -- pushbuttons.
  355.  
  356.   type MB_Icon_Styles_Type is (
  357.       MB_No_Icon,         -- The message box does not contain an icon.
  358.       MB_Icon_Hand,       -- The message box contains a hand icon.
  359.       MB_Icon_Question,    -- The message box contains a question mark icon.
  360.       MB_Icon_Exclamation, -- The message box contains an exclamation point icon.
  361.       MB_Icon_Asterisk,    -- The message box contains an asterisk icon.
  362.       MB_Information,      -- The message box contains a black information 
  363.                            -- `i in a square box.
  364.  
  365.       MB_Query,            -- The message box contains a question mark in a 
  366.                            -- square box.
  367.  
  368.       MB_Warning,          -- The message box contains a black ! in a 
  369.                            -- square box.
  370.  
  371.       MB_Error);           -- The message box contains a Stop icon on a
  372.                            -- white background.
  373.  
  374.   type MB_Default_Action_Type is (
  375.       MB_Default_On_Button_1,  --The first button is the default selection.
  376.       MB_Default_On_Button_2,  --The second button is the default selection.
  377.       MB_Default_On_Button_3);  --The third button is the default selection.
  378.       
  379.   type MB_Modality_Type is (
  380.       MB_Application_Modal, -- The message box is application modal.  This
  381.                             -- is the default case.  The owner is disabled
  382.                             -- so do specfiy the owner as parent if this 
  383.                             -- option is used.
  384.       MB_System_Modal);     -- The entire system is stop until this message 
  385.                             -- box is cleared.
  386.  
  387.   type Mb_Response_Type is (
  388.     MB_Enter_Pressed,  -- The Enter pushbutton was pressed.
  389.     MB_Ok_Pressed,     -- The Ok pushbutton was pressed.
  390.     MB_Cancel_Pressed, -- The Cancel pushbutton was pressed.
  391.     MB_Abort_Pressed,  -- The Abort pushbutton was pressed.
  392.     MB_Retry_Pressed,  -- The Retry pushbutton was pressed.
  393.     MB_Ignore_Pressed, -- The Ignore pushbutton was pressed.
  394.     MB_Yes_Pressed,    -- The Yes pushbutton was pressed.
  395.     MB_No_Pressed,     -- The No pushbutton was pressed.
  396.     MB_Help_Pressed,    -- The Help pushbutton was pressed.
  397.     MB_Error);         -- The message box failed because of an error.           
  398.  
  399.   type Point_Type is
  400.     record
  401.       X : Pixel_Type;
  402.       Y : Pixel_Type;
  403.     end record; 
  404.  
  405.   type Point_Pointer_Type is access Point_Type;
  406.  
  407.   type Short_Point_Type is
  408.     record
  409.       X : PM_Types.U_Short;
  410.       Y : Pm_Types.U_Short;
  411.     end record; 
  412.  
  413.   type Queue_Message_Type is 
  414.     record
  415.       Win_Handle  : Handle_Type;
  416.       Message_Id  : Message_Type;   
  417.       Parameter_1 : Parameter_Type;
  418.       Parameter_2 : Parameter_Type;
  419.       Time        : Time_Type;
  420.       Pointer_Pos : Point_Type; 
  421.     end record;
  422.  
  423.   type Queue_Message_Pointer_Type is access Queue_Message_Type;
  424.  
  425.   ------------------------------------------------
  426.  
  427.   type Error_Info_Type is 
  428.     record
  429.       Size           : Pm_Types.U_Long;
  430.       Id             : Pm_Types.U_Long;
  431.       Details        : Pm_Types.U_Long;
  432.       Message_Offset : Pm_Types.U_Long;
  433.       Binary_Data    : Pm_Types.U_Long;
  434.     end record;
  435.  
  436.    type Error_Info_Pointer_Type is access Error_Info_Type;
  437.  
  438.   ------------------------------------------------
  439.  
  440.   type Class_Style_Type is (
  441.        Cs_Size_Redraw,   --Determines whether a window will be redrawn when 
  442.                          --sized.
  443.  
  444.        Cs_Sync_Paint,    --The window is synchronously repainted.
  445.        Cs_Move_Notify,   --When the window is moved a WM_Move message is 
  446.                          --posted.
  447.  
  448.        Cs_Clip_Children, --Causes a window of style WS_Clip_Children to be 
  449.                          --created.
  450.  
  451.        Cs_Clip_Siblings, --Causes a window of style WS_Clip_Siblings to be
  452.                          --created.
  453.  
  454.        Cs_Parent_Clip,   --Causes a window of style WS_Parent_Clip to be 
  455.                          --created.
  456.  
  457.        Cs_Save_Bits,     --Causes a window of WS_Save_Bits to be created.
  458.        Cs_Public,        --Causes a public window class to be registered.
  459.        Cs_Hit_Test,      --If set a Wm_Hit_Test message is send to the window 
  460.                          --before any pointing device messages are sent.
  461.                          --If it is not set then no Wm_Hit_Test message is 
  462.                          --sent.
  463.  
  464.        Cs_Frame);        --All windows are expected to behave as frame windows.
  465.  
  466.   type Class_Styles_Type is array (Class_Style_Type) of Boolean;
  467.  
  468.   type Position_Options_Type is (
  469.          Swp_Size,             --Change the size of the window.
  470.          Swp_Move,             --Move the window to the specified x, y 
  471.                                --position.
  472.  
  473.          Swp_Z_Order,          --Move the window either behind or in front of 
  474.                                --another window.
  475.  
  476.          Swp_Show,             --Show the window.
  477.          Swp_Hide,             --Hide the window.  This does not iconfiy 
  478.                                --a window.
  479.  
  480.          Swp_No_Redraw,        --Do not draw the changes.
  481.          Swp_No_Adjust,        --Do not send the WM_Adjust_Window_Pos message 
  482.                                --when moving or sizing the window.
  483.  
  484.          Swp_Activate,         --Actives the Window if it is a framed window.  
  485.                                --This option has no effect on other windows.  
  486.                                --The window is also made the top most window, 
  487.                                --unless Swp_Z_Order is used in which case the
  488.                                --Window in Behind_Window is used.
  489.  
  490.          Swp_Deactivate,       --Deactivates the Window if it is a framed 
  491.                                --window.  It has no effect on other windows.  
  492.                                --The window is made the bottom most window 
  493.                                --unless the Swp_Z_Order options is also in use.
  494.  
  495.          Swp_Ext_State_Change, --Unknown? Not in online documentation. ####
  496.  
  497.          Swp_Minimize,         --Minimizes the window.  The option has no effect 
  498.                                --if the window is already minimized.  This 
  499.                                --iconfies a window.  This option cannot be used 
  500.                                --with the Swp_Maximize or Swp_Restore options.
  501.  
  502.          Swp_Maximize,         --The window is set to the maximum screen size.  
  503.                                --The option has no effect if the window is 
  504.                                --already maximized.  This option cannot be used 
  505.                                --with the Swp_Minimize or Swp_Restore options.
  506.  
  507.          Swp_Restore,          --Restores a window to its normal state after a 
  508.                                --Swp_Minimize or Swp_Maximize.  This option cannot 
  509.                                --be used with the Swp_Minimize or Swp_Maximize 
  510.                                --options.  If the Swp_Move or Swp_Size options
  511.                                --are set the new values for size and position 
  512.                                --will be used when restoring the window.
  513.  
  514.          Swp_Focus_Active,     --Window is given the active focus.
  515.          Swp_Focus_Deactivate, --Window loses the focus.
  516.          Swp_No_Auto_Close);   --Unknown.
  517.  
  518.    type Position_Type is array (Position_Options_Type) of Boolean;
  519.  
  520.   -----------------------------------------------------------
  521.  
  522.    type Window_Style_Type is (
  523.       Ws_Sync_Paint,         --The window is synchronously repainted.  This
  524.                              --style is useful when the Class style is 
  525.                              --Cs_Sync_Paint.  An applications can the turn 
  526.                              --this style on and off to vary the repainting of
  527.                              --the window.
  528.  
  529.       Ws_Clip_Children,      --The area occupied by a child window should be
  530.                              --excluded when drawing is done to the parent 
  531.                              --window.  Normally, the child window's area is
  532.                              --included.
  533.  
  534.       Ws_Clip_Siblings,      --The area occupied by a sibling's window should 
  535.                              --be excluded when drawing is done to the window. 
  536.                              --Normally, the sibling's window area is included.
  537.  
  538.       Ws_Disabled,           --The window is disabled.  Normally a window is 
  539.                              --enabled.
  540.  
  541.       Ws_Maximized,          --The frame window is to be created at maximum 
  542.                              --size.
  543.  
  544.       Ws_Mimimized,          --The frame window is created iconfied.
  545.  
  546.       Ws_Parent_Clip,        --Controls how a window is clipped when drawing
  547.                              --takes place inside of the window.
  548.  
  549.       Ws_Save_Bits,          --The contents of the window should be saved when
  550.                              --the window is made visible.
  551.       Ws_Visible,            --The window is made visible.  Normally, the 
  552.                              --window is invisible.
  553.       Ws_Animate,            --???
  554.  
  555.       Ws_Group,              --Used when a window is part of a Dialog Box.  
  556.                              --This option identifies the dialog items that 
  557.                              --form a group.  The first window of a group 
  558.                              --should be specified with this style.  The
  559.                              --following windows should not.  The windows of 
  560.                              --a group must also be adjacent siblings.
  561.  
  562.       Ws_Tab_Stop,           --Used when a window is part of a Dialog Box.
  563.                              --This option identifies a dialog item that the 
  564.                              --user can reach by using the TAB key.
  565.  
  566.       Ws_Multi_Select,       --???
  567.  
  568.       Fs_Screen_Align,       --The dialog box coordinates are relative to
  569.                              --the top left corner of the screen, rather 
  570.                              --than the parent window's top left corner.
  571.  
  572.       Fs_Mouse_Align,        --The dialog box's top left corner is position 
  573.                              --is relative to the mouse pointer at the time 
  574.                              --of creation.  The dialog box will stay on 
  575.                              --screen if possible.
  576.  
  577.       Fs_Sizing_Border,      --The window's frame has a border that can be
  578.                              -- sized.
  579.  
  580.       Fs_Border,             --The window is drawn with a thin border that
  581.                              --cannot be sized.      
  582.  
  583.       Fs_Dialog_Border,      --Window is drawn with the standard dialog box
  584.                              --border.
  585.  
  586.       Fs_System_Modal,       --The frame window is system modal.
  587.  
  588.       Fs_No_Byte_Align,      --When set the system will not optimize movement
  589.                              --and sizing of the window.  
  590.  
  591.       Fs_Task_List,          --When set, the program's title is prepended to
  592.                              --the window title text.  The new title is also 
  593.                              --entered on the task list. The program title is
  594.                              -- the text used to start the program.
  595.  
  596.       Fs_No_Move_With_Owner, --The window is not moved when the owning window
  597.                              --is moved.
  598.  
  599.       Fs_Auto_Icon);         --When redrawing iconized windows the system 
  600.                              --redraws the icon and the Wm_Paint message is
  601.                              --not to the application.      
  602.  
  603.    type Window_Styles_Type is array (Window_Style_Type) of Boolean;
  604.  
  605.    Null_Window_Styles : constant Window_Styles_Type := (others => False); 
  606.    Use_Class_Styles   : constant Window_Styles_Type := Null_Window_Styles;
  607.  
  608.   -----------------------------------------------------------------------------
  609.  
  610.    type Frame_Control_Flag_Type is (
  611.         Fcf_Title_Bar,           --The frame should have a title bar.
  612.         Fcf_System_Menu,         --The frame should have a system menu.  
  613.                                  --The system menu is the menu under the 
  614.                                  --application's icon in the upper left corner.
  615.  
  616.         Fcf_Menu,                --The frame should have a menu bar.
  617.  
  618.         Fcf_Min_Max,             --The frame should have a Minimize and 
  619.                                  --Maximize button.  These button will appear 
  620.                                  --in the upper right corner.
  621.  
  622.         Fcf_Min_Button,          --The frame should have a Minimize button.
  623.  
  624.         Fcf_Max_Button,          --The frame should have a Maximize button.
  625.  
  626.         Fcf_Vert_Scroll_Bar,     --The frame should have a vertical scroll bar.
  627.  
  628.         Fcf_Horz_Scroll_Bar,     --The frame should have a horizontal scroll
  629.                                  -- bar.
  630.  
  631.         Fcf_Sizing_Border,       --The frame has a border that can be sized.
  632.  
  633.         Fcf_Border,              --The window is drawn with a thin border that
  634.                                  --cannot be sized.
  635.  
  636.         Fcf_Dialog_Border,       --Window is drawn with the standard dialog
  637.                                  -- box border.
  638.  
  639.         Fcf_Accel_Table,         --Loads the accelerator table from the 
  640.                                  --resource file that is identified by the 
  641.                                  --Create_Standard_Window routine.
  642.  
  643.         Fcf_Icon,                --An icon is associated with the window 
  644.                                  --when it is minimized.  The icon is
  645.                                  --specified by the 
  646.                                  --Create_Standard_Window routine.
  647.  
  648.         Fcf_Shell_Position,      --The shell determines the size and position 
  649.                                  --of the window.  Normally, the application 
  650.                                  --determines the size and position.
  651.  
  652.         Fcf_System_Modal,        --The frame window is system modal.
  653.  
  654.         Fcf_No_Byte_Align,       --When set the system will not optimize
  655.                                  --movement and sizing of the window.  
  656.  
  657.         Fcf_Task_List,           --When set, the program's title is prepended
  658.                                  --to the window title text.  The new title is 
  659.                                  --also entered on the task list. The program 
  660.                                  --title is the text used to start the program.
  661.  
  662.         Fcf_No_Move_With_Owner,  --The window is not moved when the owning
  663.                                  --window is moved.
  664.  
  665.         Fcf_Standard,            --Default window frame.  Is the same as
  666.                                  --   Fcf_Title_Bar, Fcf_System_Menu, 
  667.                                  --   Fcf_Min_Button, Fcf_Max_Button, 
  668.                                  --   Fcf_Sizing_Border, Fcf_Icon,
  669.                                  --   Fcf_Menu, Fcf_Accel_Table, 
  670.                                  --   Fcf_Shell_Position, Fcf_Tasklist.
  671.                                  --If no frame control options are provided 
  672.                                  --this is considered the default settings.
  673.  
  674.         Fcf_Screen_Align,        --The dialog box coordinates are relative
  675.                                  --to the top left corner of the screen, rather
  676.                                  --than the parent window's top left corner.
  677.  
  678.         Fcf_Mouse_Align,         --The dialog box's top left corner is position
  679.                                  --is relative to the mouse pointer at the time 
  680.                                  --of creation.  The dialog box will stay on
  681.                                  --screen if possible.
  682.  
  683.         Fcf_Auto_Icon,           --When redrawing iconized windows the system 
  684.                                  --redraws the icon and the Wm_Paint message is 
  685.                                  --not to the application.
  686.  
  687.         Fcf_Hide_Button,         --Adds a hide button to the title bar.
  688.  
  689.         Fcf_Hide_Max);           --Hides the minimize and maximize buttons.
  690.  
  691.   type Frame_Control_Flags_Type is array (Frame_Control_Flag_Type) of Boolean;
  692.  
  693.   Null_Frame_Flags : constant Frame_Control_Flags_Type := (others => False);
  694.  
  695.   type Frame_Id_Type is (
  696.          Fid_System_Menu,
  697.          Fid_Titlebar,
  698.          Fid_Min_Max,
  699.          Fid_Menu,
  700.          Fid_Vert_Scroll_Bar,
  701.          Fid_Horz_Scroll_Bar,
  702.          Fid_Client,
  703.          Fid_DBE_App_Stat,
  704.          Fid_DBE_Kbd_Stat,
  705.          Fid_DBE_Pecic,
  706.          Fid_Dbe_KK_Pop_Up);
  707.  
  708.   -----------------------------------------------------------------------------
  709.  
  710.    Min_Max_Restore_Usage_Error : exception; --Raise when Swp_Minimize,
  711.                                             --Swp_Maximize or
  712.                                             --Swp_Restore are used together.
  713.  
  714.    Clear_Position : constant Position_Type := (Others => False);
  715.    Show_Window    : constant Position_Type := (Swp_Size     => True,
  716.                                                Swp_Move     => True,
  717.                                                Swp_Show     => True,
  718.                                                Swp_Activate => True,
  719.                                                Others       => False);
  720.    Iconify_Window : constant Position_Type := (Swp_Minimize => True,
  721.                                                others       => False);
  722.    Restore_Window : constant Position_Type := (Swp_Restore  => True,
  723.                                                Swp_Activate => True,
  724.                                                others       => False);
  725.  
  726.   ------------------------------------------------
  727.  
  728.    --Keyboard Types
  729.    type Key_Flag_Type is (
  730.           Kc_None,
  731.           Kc_Char,
  732.           Kc_Virtual_Key,      --Indicates that the Virtual_Key value is valid.
  733.  
  734.           Kc_Scan_Code,        --Indicates that the scancode is valid. 
  735.                                --This is usually set when a WM_Char message 
  736.                                --is generated by a user.  If the message is 
  737.                                --sent by an application it may not be set.
  738.  
  739.           Kc_Shift,            --The Shift key was down when the key was 
  740.                                --pressed or released.
  741.  
  742.           Kc_Ctrl,             --The Control key was down when the key was 
  743.                                --pressed or released.
  744.  
  745.           Kc_Atl,              --The Alt key was down when the key was pressed
  746.                                --or released
  747.  
  748.           Kc_Key_Up,           --The event is a key-up transition.  If false
  749.                                --then the event was a key-down transition.
  750.  
  751.           Kc_Previous_Down,    --The key was previously down.  If false 
  752.                                --then the key was up.
  753.  
  754.           Kc_Lone_Key,         --Indicates that this was the only key pressed 
  755.                                --and release while the key was cycled.
  756.  
  757.           Kc_Dead_Key,         --The character code is a dead key.  The 
  758.                                --application must generate the display for 
  759.                                --the key without advancing the
  760.                                --cursor.
  761.  
  762.           Kc_Composite,        --This character code is combined with the 
  763.                                --previous dead
  764.                                --key to from the character code.
  765.  
  766.           Kc_Invalid_Composite, --The character code is not valid with the
  767.                                 --previous dead key.  The application must 
  768.                                 --advance the cursor past the
  769.                                 --dead key image.
  770.  
  771.           Kc_Toggle,
  772.           Kc_Invalid_Character,
  773.           Kc_DB_CSR_SR_VD1,
  774.           Kc_Db_CSR_SR_VD2);
  775.  
  776.    type Key_Flags_Type is array (Key_Flag_Type) of Boolean;
  777.     
  778.    type Virtual_Key_Type is (
  779.            Vk_Button_1,
  780.            Vk_Button_2,
  781.            Vk_Button_3,
  782.            Vk_Break,
  783.            Vk_Backspace,
  784.            Vk_Tab,
  785.            Vk_Back_Tab,
  786.            Vk_New_Line,
  787.            Vk_Shift,
  788.            Vk_Ctrl,
  789.            Vk_Atl,
  790.            Vk_Alt_Graf,
  791.            Vk_Pause,
  792.            Vk_Caps_Lock,
  793.            Vk_Esc,
  794.            Vk_Space,
  795.            Vk_Page_Up,
  796.            Vk_Page_Down,
  797.            Vk_End,
  798.            Vk_Home,
  799.            Vk_Left,
  800.            Vk_Up,
  801.            Vk_Right,
  802.            Vk_Down,
  803.            Vk_Print_Screen,
  804.            Vk_Insert,
  805.            Vk_Delete,
  806.            Vk_Scroll_Lock,
  807.            Vk_Num_Lock,
  808.            Vk_Enter,
  809.            Vk_Sys_Rq,
  810.            Vk_F1,
  811.            Vk_F2,
  812.            Vk_F3,
  813.            Vk_F4,
  814.            Vk_F5,
  815.            Vk_F6,
  816.            Vk_F7,
  817.            Vk_F8,
  818.            Vk_F9,
  819.            Vk_F10,
  820.            Vk_F11,
  821.            Vk_F12,
  822.            Vk_F13,
  823.            Vk_F14,
  824.            Vk_F15,
  825.            Vk_F16,
  826.            Vk_F17,
  827.            Vk_F18,
  828.            Vk_F19,
  829.            Vk_F20,
  830.            Vk_F21,
  831.            Vk_F22,
  832.            Vk_F23,
  833.            Vk_F24,
  834.            Vk_End_Drag,
  835.            Vk_Menu,
  836.            Vk_Null);
  837.  
  838.    type Key_Press_Info_Type is
  839.       record
  840.         Flags          : Key_Flags_Type;
  841.         Repeat_Count   : Pm_Types.U_Byte;
  842.         Scan_Code      : Pm_Types.U_Byte;
  843.         Character_Code : Pm_Types.U_Short;
  844.         Virtual_Key    : Virtual_Key_Type;
  845.       end record;
  846.          
  847.  
  848.   function Key_Info_Is (Message_Parameter_1 : Parameter_Type;
  849.                         Message_Parameter_2 : Parameter_Type) 
  850.                                         return Key_Press_Info_Type;
  851.    --For use after recieving a WM_Char message.  Decodes the 
  852.    --two message parameters and returns the values in the record.  
  853.    --Use with other message will cause errors.
  854.  
  855.   ------------------------------------------------
  856.  
  857.   type Command_Source_Type is (
  858.        Cmd_Src_Push_Button,
  859.        Cmd_Src_Menu,
  860.        Cmd_Src_Accelerator,
  861.        Cmd_Src_Font_Dialog,
  862.        Cmd_Src_File_Dialog,
  863.        Cmd_Src_Print_Dialog,
  864.        Cmd_Src_Color_Dialog,
  865.        Cmd_Src_Other);
  866.  
  867.   type Command_Id_Type is new Pm_Types.U_Short;
  868.  
  869.   type Command_Info_Type is
  870.     record
  871.      Id         : Command_Id_Type;
  872.      Source     : Command_Source_Type;
  873.      By_Pointer : Boolean;
  874.    end record;  
  875.  
  876.   function Command_Info_Is (Message_Parameter_1 : Parameter_Type;
  877.                             Message_Parameter_2 : Parameter_Type)
  878.                                               return Command_Info_Type;
  879.  
  880.    --For use after recieving a Wm_Command message.  Decodes the two 
  881.    --message parameters and returns the values in the Command_Info type.
  882.    --Use with other message may cause errors.
  883.  
  884.   ------------------------------------------------
  885.  
  886.    type Menu_Style_Type is (
  887.        MIS_Submenu,
  888.        MIS_Mult_Menu,
  889.        MIS_Sys_Command,
  890.        MIS_Help,
  891.        MIS_Static,
  892.        MIS_Button_Separator,
  893.        MIS_Break,
  894.        MIS_Break_Separator,
  895.        MIS_Group,
  896.        MIS_Single);
  897.  
  898.    type Menu_Attribute_Type is (
  899.         MIA_No_Dismiss,
  900.         MIA_Framed,
  901.         MIA_Checked,
  902.         MIA_Disabled,
  903.         MIA_Highlighted);
  904.  
  905.   ------------------------------------------------
  906.  
  907.    function Check_Menu_Item (
  908.               Menu    : Handle_Type;
  909.               Item_Id : Command_Id_Type;
  910.               Check   : Boolean) return Boolean; 
  911.  
  912.   ------------------------------------------------
  913.  
  914.    type Message_Handler_Function is access 
  915.         function (Window              : Handle_Type;
  916.                   Message             : Message_Type;
  917.                   Message_Parameter_1 : Parameter_Type;  
  918.                   Message_Parameter_2 : Parameter_Type)                  
  919.                                                  return Pm_Types.U_Long;
  920.  
  921.   ------------------------------------------------
  922.  
  923.   function Pointer_Is (Parameter : Parameter_Type) return Point_Type;
  924.  
  925.   ------------------------------------------------
  926.  
  927.   function Get_Error_Info (Anchor_Block : Anchor_Block_Handle_Type)
  928.                                           return Error_Info_Pointer_Type; 
  929.  
  930.   ------------------------------------------------
  931.  
  932.   function Get_Last_Error (Anchor_Block : Anchor_Block_Handle_Type) 
  933.                                                   return Pm_Types.U_Long;
  934.  
  935.   ------------------------------------------------
  936.  
  937.   function Register_Class (Anchor_Block    : Anchor_Block_Handle_Type;
  938.                            Class_Name      : String;
  939.                            Message_Handler : Message_Handler_Function;
  940.                            Class_Style     : Class_Styles_Type;
  941.                            Extra_Storage   : Pm_Types.U_Short) return Boolean;
  942.  
  943.   Register_Failed : exception;
  944.  
  945.   procedure Register_Class (Anchor_Block    : in Anchor_Block_Handle_Type;
  946.                             Class_Name      : in String;
  947.                             Message_Handler : in Message_Handler_Function;
  948.                             Class_Style     : in Class_Styles_Type;
  949.                             Extra_Storage   : in Pm_Types.U_Short);
  950.  
  951.   ------------------------------------------------
  952.  
  953.   function Default_Window_Procedure 
  954.                           (Window              : Handle_Type;
  955.                            Message             : Message_Type;
  956.                            Message_Parameter_1 : Parameter_Type;  
  957.                            Message_Parameter_2 : Parameter_Type)                  
  958.                                                return Pm_Types.U_Long;
  959.  
  960.   ------------------------------------------------
  961.  
  962.   function Create_Standard_Window (
  963.             Parent_Window       : Handle_Type;
  964.             Window_Styles       : Window_Styles_Type;
  965.             Frame_Control_Flags : Frame_Control_Flags_Type;
  966.             Class_Name          : String;
  967.             Window_Title        : String;
  968.             Class_Style         : Class_Styles_Type;
  969.             Resource            : PULong;
  970.             Resource_ID         : Pm_Types.U_Long;
  971.             New_Window          : Handle_Pointer_Type) return Handle_Type;
  972.  
  973.   ------------------------------------------------
  974.  
  975.   function Window_From_Id (
  976.             Parent_Window : Handle_Type;
  977.             Frame_Id      : Frame_ID_Type) return Handle_Type;
  978.  
  979.   ------------------------------------------------
  980.  
  981.   
  982.   function Set_Window_Position (
  983.               Window           : Handle_Type;
  984.               Behind_Window    : Handle_Type;
  985.               X                : Device_Screen_Space_Type;
  986.               Y                : Device_Screen_Space_Type;
  987.               Width            : Device_Screen_Space_Type;
  988.               Height           : Device_Screen_Space_Type;
  989.               Position_Options : Position_Type) return Boolean; 
  990.  
  991.   Set_Failed : exception; 
  992.  
  993.   procedure Set_Window_Position (
  994.               Window           : in Handle_Type;
  995.               Behind_Window    : in Handle_Type;
  996.               X                : in Device_Screen_Space_Type;
  997.               Y                : in Device_Screen_Space_Type;
  998.               Width            : in Device_Screen_Space_Type;
  999.               Height           : in Device_Screen_Space_Type;
  1000.               Position_Options : in Position_Type);
  1001.  
  1002.   ------------------------------------------------
  1003.  
  1004.   function Is_Null (Window       : Handle_Type) return Boolean;
  1005.   function Is_Null (Queue        : Queue_Handle_Type) return Boolean;
  1006.   function Is_Null (Anchor_Block : Anchor_Block_Handle_Type) return Boolean;
  1007.   function Is_Null (PS           : PS_Type) return Boolean;
  1008.  
  1009.   ------------------------------------------------
  1010.  
  1011.   Initialization_Failed : exception;
  1012.  
  1013.   function Initialize (
  1014.                        Options : Pm_Types.U_Long := System_Default   
  1015.                             --The only PM option is a value of 0.
  1016.                                    ) return Anchor_Block_Handle_Type;
  1017.  
  1018.   procedure Initialize (
  1019.              Options      : in     Pm_Types.U_Long := System_Default;
  1020.              Anchor_Block :    out Anchor_Block_Handle_Type);
  1021.  
  1022.    --Initializes the PM facilities for use by an application.
  1023.    --OS/2 PM Function WinInitialize
  1024.  
  1025.   ------------------------------------------------
  1026.  
  1027.   procedure Terminate_App (Anchor : in out Anchor_Block_Handle_Type);
  1028.  
  1029.   function Terminate_App (Anchor : Anchor_Block_Handle_Type) return Boolean;
  1030.  
  1031.   --Terminates an OS/2 application and releases the applications resources.
  1032.  
  1033.   ------------------------------------------------
  1034.  
  1035.   procedure Destroy_Message_Queue (Message_Queue : in out Queue_Handle_Type);
  1036.  
  1037.   function Destroy_Message_Queue (Message_Queue : Queue_Handle_Type)
  1038.                                                               return Boolean;
  1039.    --Destroys the applications message queue.
  1040.    --OS/2 PM Function WinDestroyMsgQueue
  1041.  
  1042.   ------------------------------------------------
  1043.  
  1044.   procedure Destroy_Window (Window : in out Handle_Type);
  1045.  
  1046.   function Destroy_Window (Window : Handle_Type) return Boolean;
  1047.  
  1048.    --Destroys the specified window.
  1049.    --OS/2 PM Function WinDestroyWindow
  1050.  
  1051.   ------------------------------------------------
  1052.  
  1053.   Message_Queue_Was_Not_Created : exception;
  1054.  
  1055.   function Create_Message_Queue (
  1056.               Anchor_Block  : Anchor_Block_Handle_Type;
  1057.               Queue_Size    : Pm_Types.Long := System_Default)
  1058.                               return Queue_Handle_Type; 
  1059.  
  1060.   procedure Create_Message_Queue (
  1061.               Anchor_Block  : in     Anchor_Block_Handle_Type;
  1062.               Queue_Size    : in     Pm_Types.Long := System_Default;
  1063.               Queue         :    out Queue_Handle_Type);
  1064.  
  1065.      --Most PM function require a Message Queue.  This function should
  1066.      --be called right after the Initialize function and before any other
  1067.      --PM calls.
  1068.  
  1069.      --OS/2 PM Function WinCreateMsgQueue
  1070.      
  1071.   ------------------------------------------------
  1072.  
  1073.    function Get_Message (
  1074.                Anchor_Block : Anchor_Block_Handle_Type;
  1075.                Message      : Queue_Message_Pointer_Type;
  1076.                Window       : Handle_Type;
  1077.                First        : Pm_Types.U_Long;
  1078.                Last         : Pm_Types.U_Long) return Boolean;
  1079.  
  1080.   ------------------------------------------------
  1081.  
  1082.    procedure Dispatch_Message (
  1083.                Anchor_Block : in Anchor_Block_Handle_Type;
  1084.                Message      : in Queue_Message_Pointer_Type);
  1085.  
  1086.   ------------------------------------------------
  1087.  
  1088.   type Help_Id_Type is new Pm_Types.U_Short;
  1089.  
  1090.   function Message_Box (
  1091.             Parent_Window  : Handle_Type;
  1092.             Request_Owner  : Handle_Type;
  1093.             Message        : String;
  1094.             Title          : String;
  1095.             Help_Id        : Help_Id_Type;
  1096.             Buttons        : MB_Button_Styles_Type;
  1097.             Icons          : MB_Icon_Styles_Type;   
  1098.             Default_Action : MB_Default_Action_Type;
  1099.             Modality       : MB_Modality_Type := MB_Application_Modal;
  1100.             Help_Button    : Boolean          := False;
  1101.             Moveable       : Boolean          := True)
  1102.                                                 return MB_Response_Type;
  1103.  
  1104.  
  1105.   ------------------------------------------------
  1106.  
  1107.    function Send_Message (   
  1108.          To_Window   : Handle_Type;
  1109.          Message     : Message_Type;
  1110.          Parameter_1 : Parameter_Type;
  1111.          Parameter_2 : Parameter_Type) return Void_Type;
  1112.  
  1113.   ------------------------------------------------
  1114.  
  1115.    function Post_Message (   
  1116.          To_Window   : Handle_Type;
  1117.          Message     : Message_Type;
  1118.          Parameter_1 : Parameter_Type;
  1119.          Parameter_2 : Parameter_Type) return Boolean;
  1120.  
  1121.   ------------------------------------------------
  1122.  
  1123.    function Get_PS (Window : Handle_Type) return PS_Type;
  1124.  
  1125.    procedure Release_Ps (Ps_Handle : in out Ps_Type);
  1126.  
  1127.   ------------------------------------------------
  1128.  
  1129.  private
  1130.  
  1131.   type Handle_Type is new Pm_Types.Long;
  1132.  
  1133.   Null_Window           : constant Handle_Type := 0;
  1134.   Null_HWND             : constant Handle_Type := Null_Window; 
  1135.   Desktop_Window        : constant Handle_Type := 1;
  1136.   Top_Window            : constant Handle_Type := 3;
  1137.   Bottom_Windw          : constant Handle_Type := 4;
  1138.   Object_Handle         : constant Handle_Type := 2;
  1139.   Thread_Capture_Handle : constant Handle_Type := 5;
  1140.  
  1141.   ------------------------------------------
  1142.  
  1143.   type Queue_Handle_Type is new Pm_Types.Long;
  1144.  
  1145.   Null_Queue : constant Queue_Handle_Type := 0;
  1146.   Null_HMQ   : constant Queue_Handle_Type := Null_Queue;
  1147.  
  1148.   ------------------------------------------
  1149.  
  1150.   type Anchor_Block_Handle_Type is new Pm_Types.Long;
  1151.  
  1152.   Null_Anchor_Block : constant Anchor_Block_Handle_Type := 0;
  1153.   Null_HAB          : constant Anchor_Block_Handle_Type := Null_Anchor_Block;
  1154.  
  1155.   ------------------------------------------
  1156.  
  1157.   type Ps_Type is new Pm_Types.U_Long;
  1158.   Null_Ps : constant PS_Type := 0;
  1159.  
  1160. end Win;
  1161.    
  1162.  
  1163.  
  1164.  
  1165.  
  1166.