home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: Graphics / Graphics.zip / os2apipm.zip / PMEXAM / MENU / WIN.ADS < prev   
Text File  |  1996-07-22  |  50KB  |  1,189 lines

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