home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / adapm_15.zip / win.ads < prev   
Text File  |  1994-04-05  |  56KB  |  1,326 lines

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