home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / pmm100.zip / PMMMAN.TXT < prev    next >
Text File  |  1999-03-30  |  122KB  |  3,715 lines

  1.  
  2.  
  3.  
  4.  
  5. Online document
  6. ────────────────────────────────────────────────────────────────────────────
  7.  
  8.              PMM  OS/2 Presentation Manager Monitor Version 1.0
  9.  
  10.                           J. Salvador Amoros, 1999
  11.  
  12. ────────────────────────────────────────────────────────────────────────────
  13.  
  14.  
  15.                             Table of Contents
  16.                             ─────────────────
  17.  
  18.  
  19.  
  20.  1. PMM  OS/2 Presentation Manager Monitor . .  1
  21.  2. Installing and Using PMM . . . . . . . . .  1
  22.     Installation Procedure . . . . . . . . . .  2
  23.     How to Use PMM in an Application . . . . .  2
  24.     Considerations About Debuggers . . . . . .  4
  25.  3. Using Hooks with PMM . . . . . . . . . . .  5
  26.  4. Subclassing Windows when Using PMM . . . .  6
  27.  5. Messages Traced by PMM . . . . . . . . . . 10
  28.  6. The PMM Interface  . . . . . . . . . . . . 25
  29.     List of Functions  . . . . . . . . . . . . 25
  30.     List of Errors and Warnings  . . . . . . . 51
  31.        Errors Returned by Functions  . . . . . 51
  32.        Errors Occurring when Using PMM . . . . 53
  33.        Warnings Occurring when Using PMM . . . 54
  34.  7. PMM Message Trace Format . . . . . . . . . 55
  35.  8. Notes About PMM  . . . . . . . . . . . . . 59
  36.  9. Errors Detected in the Documentation . . . 61
  37. 10. PMM Limits . . . . . . . . . . . . . . . . 62
  38. 11. Tools Used in Creating PMM . . . . . . . . 62
  39. 12. Acknowledgments  . . . . . . . . . . . . . 63
  40. 13. Disclaimer . . . . . . . . . . . . . . . . 63
  41. 14. Trademarks . . . . . . . . . . . . . . . . 63
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.                                      i
  59.  
  60.  
  61.  
  62.         1. PMM  OS/2 Presentation Manager Monitor
  63.         ═════════════════════════════════════════
  64.  
  65.  
  66.         PMM is a learning and debugging tool aimed to show the flow of
  67.         messages produced in a Presentation Manager (PM) application.
  68.         PMM monitors messages received by windows, writing them to a file.
  69.         Messages posted to a queue or a window and messages sent via
  70.         WinSendMsg or through a pointer are traced.  Messages are
  71.         interpreted, formatted and shown as they occur in an application.
  72.         PMM gives you information about:
  73.  
  74.         -  The message stream
  75.         -  The attributes of the destination window of a message
  76.         -  The parameters of a message
  77.         -  How a message reached the window procedure
  78.         -  The return value of a message
  79.  
  80.         PMM is a tool that works inside your application.  It is not a
  81.         separate program running in the operating system.  The PMM interface
  82.         is a set of functions that you must call from your code.  You
  83.         control what messages to trace, how to trace them, when to trace
  84.         them and other important aspects of messages.
  85.  
  86.         You use PMM by creating a trace session in your program and
  87.         customizing it to your learning/debugging needs.  You can start and
  88.         stop tracing messages from inside your code as well as from the
  89.         keyboard.  To help debugging, you can write text to the trace file
  90.         at any point in your code and at any time.
  91.  
  92.         PM messages are divided into groups.  You can select one or more
  93.         groups of messages, to selectively trace the messages that you are
  94.         interested in.  You can trace messages related to one or more PM
  95.         controls and you can control most of the message information that
  96.         will be shown in the trace file.
  97.  
  98.  
  99.  
  100.         2. Installing and Using PMM
  101.         ═══════════════════════════
  102.  
  103.  
  104.         To install and use PMM, you will need:
  105.  
  106.         1. OS/2 2.1 or higher.
  107.         2. A C/C++ compiler.
  108.         3. The "#include" files PMMPOS2.H and PMM.H.
  109.         4. The library file PMM.LIB.
  110.         5. The dynamic link library PMM.DLL.
  111.  
  112.  
  113.  
  114.  
  115.  
  116.                                    - 1 -
  117.  
  118.  
  119.  
  120.         Installation Procedure
  121.         ──────────────────────
  122.  
  123.         1. Copy the dynamic link library PMM.DLL to any directory listed in
  124.            the LIBPATH environment variable.
  125.         2. Copy the library file PMM.LIB to any directory listed in the LIB
  126.            environment variable.
  127.         3. Copy the include files PMMPOS2.H and PMM.H to any directory you
  128.            choose.  Unless the directory is listed in the INCLUDE
  129.            environment variable, you will need to use a path when including
  130.            them.
  131.         4. If you have modified your CONFIG.SYS file you may need to reboot
  132.            OS/2 to activate the changes.
  133.  
  134.         Here is an example.  Let's assume that you decide to place PMM in
  135.         the directory C:\PMM.  Do the following:
  136.  
  137.         1. Create the directory
  138.         2. Copy all files included in the PMM package to this directory
  139.         3. Add C:\PMM to your LIBPATH environment variable:
  140.  
  141.            LIBPATH=C:\IBMWF21\DLL;C:\PMM;
  142.  
  143.         4. Add C:\PMM to your LIB environment variable:
  144.  
  145.            SET LIB=C:\TOOLKT21\OS2LIB;C:\IBMCPP\LIB;C:\PMM;
  146.  
  147.         5. Add C:\PMM to your INCLUDE environment variable:
  148.  
  149.            SET INCLUDE=C:\TOOLKT21\C\OS2H;C:\IBMCPP\INCLUDE;C:\PMM;
  150.  
  151.         6. Reboot OS/2 to activate the changes
  152.  
  153.  
  154.         How to Use PMM in an Application
  155.         ────────────────────────────────
  156.  
  157.         Follow these steps:
  158.  
  159.         1. Include the file PMMPOS2.H immediately before the line that
  160.            includes OS2.H.
  161.         2. Include the file PMM.H at any point after the line that
  162.            includes OS2.H.
  163.         3. Code the functions needed to create a trace session, to start
  164.            tracing, to customize PMM, etc., as shown later in this section.
  165.            If you use hooks or subclass windows, you must read carefully the
  166.            sections "Using Hooks with PMM," and "Subclassing Windows when
  167.            Using PMM," in this manual.
  168.         4. Link your program with the library PMM.LIB.
  169.         5. Compile and run your program.
  170.  
  171.  
  172.  
  173.  
  174.                                    - 2 -
  175.  
  176.  
  177.  
  178.         Example:
  179.  
  180.         // Conditional compilation. Activate/deactivate PMM easily
  181.         #define USE_PMM  1
  182.  
  183.         // Define some constants needed in your program
  184.         #define INCL_WININPUT
  185.         #define INCL_WINWINDOWMGR
  186.  
  187.         // Include this file immediately before including "os2.h"
  188.         #if USE_PMM
  189.            #include "pmmpos2.h"
  190.         #endif
  191.  
  192.         #include <os2.h>
  193.  
  194.         // Include header files as needed
  195.         #include <stdio.h>
  196.         #include <string.h>
  197.         #include <stdlib.h>
  198.  
  199.         // Include the "main" PMM file
  200.         #if USE_PMM
  201.            #include "pmm.h"
  202.         #endif
  203.  
  204.         int main( int argc, char * argv[] )
  205.         {
  206.            HAB hab;
  207.            HMQ hmq;
  208.            QMSG qmsg;
  209.  
  210.         #if USE_PMM
  211.            HPMMSESSION hpmms;
  212.            PMMRET pmmr;
  213.         #endif
  214.  
  215.            hab = WinInitialize( 0 );
  216.            if ( !hab )
  217.               return 1; /* Error */
  218.  
  219.            hmq = WinCreateMsgQueue( hab, 0 );
  220.            if ( !hmq )
  221.            {
  222.               WinTerminate( hab );
  223.               return 2; /* Error */
  224.            }
  225.  
  226.            // Return codes from PMM are not tested in this example,
  227.            // they should be tested
  228.  
  229.  
  230.  
  231.  
  232.                                    - 3 -
  233.  
  234.  
  235.  
  236.            // Create a trace session and start tracing
  237.         #if USE_PMM
  238.            pmmr = PMMCreateTraceSession( &hpmms, hab, "pmm.log" );
  239.            pmmr = PMMStartTracing( hpmms );
  240.         #endif
  241.  
  242.            // Initialize resources
  243.            // Create the main window
  244.  
  245.            while( WinGetMsg( hab, &qmsg, 0, 0, 0 ) )
  246.               WinDispatchMsg( hab, &qmsg );
  247.  
  248.            // Destroy the main window if it exists
  249.            // Free resources
  250.  
  251.            // Stop tracing and destroy the trace session
  252.         #if USE_PMM
  253.            pmmr = PMMStopTracing( hpmms );
  254.            pmmr = PMMDestroyTraceSession( hpmms );
  255.         #endif
  256.  
  257.            WinDestroyMsgQueue( hmq );
  258.  
  259.            WinTerminate( hab );
  260.  
  261.            return 0; /* Success */
  262.         } // End of main
  263.  
  264.  
  265.         Considerations About Debuggers
  266.         ──────────────────────────────
  267.  
  268.         You can use any debugger when using PMM.  Debuggers, in general,
  269.         intercept exceptions produced in an application and, when one is
  270.         detected, let you choose the next action to be performed.  Then you
  271.         can, for instance, investigate the cause of the exception or run the
  272.         registered exception handlers.  PMM tests all pointers involved in
  273.         a message and will report an access violation exception when a
  274.         memory address is inaccessible.  At this point you should run the
  275.         registered exception handlers to inform PMM to handle the exception;
  276.         execution will continue.  PMM will display the inaccessible pointer
  277.         in the message trace file.
  278.  
  279.         See the function PMMShowPointers in the section "The PMM Interface."
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.                                    - 4 -
  291.  
  292.  
  293.  
  294.         3. Using Hooks with PMM
  295.         ═══════════════════════
  296.  
  297.  
  298.         You can skip this section if your application doesn't use send
  299.         message hooks or input hooks.
  300.  
  301.         PMM uses hooks and subclassing to keep track of all messages
  302.         occurring in an application.  Currently, PMM uses a send message
  303.         hook and an input hook installed in an application message queue.
  304.         No system hooks are used.  Hooks are called on a FIFO basis, that
  305.         is, the most recently installed hook is called first.  Given this,
  306.         when using hooks with PMM you need to be aware of the following
  307.         facts:
  308.  
  309.         - PMM introduces some messages in the message stream of an
  310.           application
  311.         - PMM temporarily alters messages sent by an application to windows
  312.           of another process.
  313.  
  314.         Therefore, in a send message hook an application should:
  315.  
  316.         - ignore some messages introduced by PMM
  317.         - process the unaltered messages, i.e. the messages received in the
  318.           hook as if the application were not using PMM.
  319.  
  320.         An application does this by using the functions PMMQueryIfIgnoreMsg
  321.         and PMMSMHQueryMsg.  See the example code in the function
  322.         PMMSMHQueryMsg.
  323.  
  324.         A send message hook is installed when an application calls
  325.         PMMCreateTraceSession.  From this point on, any send message hook,
  326.         whether installed *before* or installed *after* calling
  327.         PMMCreateTraceSession, may receive messages introduced by PMM or
  328.         messages modified by PMM.  The send message hook is uninstalled when
  329.         an application calls PMMDestroyTraceSession.
  330.  
  331.         If an application installs a send message hook and/or an input hook
  332.         after calling PMMCreateTraceSession, the calling order of the
  333.         hook(s) will be: the hook(s) installed by the application followed
  334.         by the hook(s) installed by PMMCreateTraceSession.  In this case
  335.         note that:
  336.  
  337.         - an application may modify any value in the structures received in
  338.           the hooks: SMHSTRUCT and QMSG
  339.         - in an input hook, an application may need not to pass on the
  340.           message to the next hook in the chain or to the application.
  341.  
  342.         Assuming this,
  343.  
  344.         - PMM will "receive" and trace any message modified by the
  345.  
  346.  
  347.  
  348.                                    - 5 -
  349.  
  350.  
  351.  
  352.           application's send message hook.  The unaltered message (before
  353.           the application send message hook) cannot be traced
  354.         - PMM will not trace a message that is not passed on in an
  355.           input hook
  356.         - PMM intercepts the WM_TRANSLATEACCEL and the WM_CHAR messages in
  357.           order to start and stop tracing through the keyboard.  An
  358.           application using hooks may modify or not pass on these messages.
  359.           Depending on the changes, the PMM logic to start and stop tracing
  360.           may not work.
  361.  
  362.  
  363.  
  364.         4. Subclassing Windows when Using PMM
  365.         ═════════════════════════════════════
  366.  
  367.  
  368.         You can skip this section if your application doesn't subclass
  369.         windows.
  370.  
  371.         An application may receive messages sent by other applications in
  372.         the system.  An example is the DM_PRINTOBJECT message.  As
  373.         documentation states, this message is sent to a source application
  374.         that supports the DRM_PRINT rendering method when objects are
  375.         dropped on a printer object.  Also, as mentioned in the
  376.         documentation when describing the SendMsgHook function, the send
  377.         message hook function is called *only* in the context of the sender,
  378.         i.e. if the sender has a queue hook installed it is called, but if
  379.         the receiver has a queue hook installed it is not called.  That is,
  380.         *not* all messages that a window receives pass through a hook.
  381.  
  382.         If the message trace has to be correct, i.e. intercept and show
  383.         *all* messages received by a window, the only real solution to this
  384.         problem is to subclass every window traced.  This is what PMM does.
  385.         If a trace session has been created, PMM subclasses each window on
  386.         the first message that it intercepts for that window, and
  387.         unsubclasses it when the window or the trace session is destroyed.
  388.         An application may subclass freely a window when using PMM since
  389.         PMM maintains a linked list of window procedures and sends the
  390.         messages to the appropriate window procedure.  To intercept all
  391.         messages that a window receives, PMM makes sure that the current
  392.         window procedure of a window is always a "PMM window procedure";
  393.         then the PMM window procedure sends the message to the "real"
  394.         (class or application) window procedure.
  395.  
  396.         The PMM include file PMM.H creates some macros redefining
  397.         WinSubclassWindow as PMMSubclassWindow, WinSetWindowPtr as
  398.         PMMSetWindowPtr and WinQueryWindowPtr as PMMQueryWindowPtr.
  399.         By default, an application will use these macros when including
  400.         the file PMM.H.  See the functions PMMSubclassWindow,
  401.         PMMSetWindowPtr and PMMQueryWindowPtr.
  402.  
  403.  
  404.  
  405.  
  406.                                    - 6 -
  407.  
  408.  
  409.  
  410.         An example follows about subclassing:
  411.  
  412.         1. Assume that a PMM trace session has been created
  413.         2. The application creates the window 'W'.  The window procedure
  414.            of 'W' is, at create time, 'pfnwpApp0'
  415.         3. PMM intercepts the WM_CREATE message for the window 'W' and
  416.            subclasses the window with the window procedure 'pfnwpPMM0'.
  417.            The window procedures of 'W' are:
  418.  
  419.            pfnwpApp0 -> pfnwpPMM0
  420.  
  421.            where 'pfnwpPMM0' is the current window procedure of 'W'
  422.  
  423.         4. The application subclasses the window 'W' with the window
  424.            procedure 'pfnwpApp1'.  The old window procedure returned to the
  425.            application is 'pfnwpPMM0'.  The window procedures of 'W' are:
  426.  
  427.            pfnwpApp0 -> pfnwpPMM0 -> pfnwpApp1
  428.  
  429.            Now, we have two cases:
  430.  
  431.            4.1 The application has used the PMMSubclassWindow function to
  432.                subclass the window.  PMM knows that a subclassing has been
  433.                made and subclasses the window again.  The window procedures
  434.                of 'W' are:
  435.  
  436.                pfnwpApp0 -> pfnwpPMM0 -> pfnwpApp1 -> pfnwpPMM1
  437.  
  438.                From now on, all messages will be intercepted and shown in
  439.                the trace file as they were received in the window procedure.
  440.  
  441.            4.2 The application has not used the PMMSubclassWindow function
  442.                to subclass the window.  PMM doesn't know that a subclassing
  443.                has been made and does nothing.  The window procedures of 'W'
  444.                do not change:
  445.  
  446.                pfnwpApp0 -> pfnwpPMM0 -> pfnwpApp1 (same as before)
  447.  
  448.                Suppose that a message is sent to the window 'W'.  We have:
  449.  
  450.                4.2.1 The message is sent using a pointer.  For this example,
  451.                      it must be 'pfnwpApp1'.  We have two possibilities:
  452.  
  453.                      4.2.1.1 The message is processed by 'pfnwpApp1', i.e.
  454.                              not passed to the old window procedure.  The
  455.                              window procedures of 'W' remain:
  456.  
  457.                              pfnwpApp0 -> pfnwpPMM0 -> pfnwpApp1
  458.  
  459.                              Since PMM is not aware that a subclassing has
  460.                              been made, this message will not appear in the
  461.  
  462.  
  463.  
  464.                                    - 7 -
  465.  
  466.  
  467.  
  468.                              trace file.
  469.  
  470.                      4.2.1.2 'pfnwpApp1' passes the message back to the old
  471.                              window procedure, which is 'pfnwpPMM0'.  PMM
  472.                              subclasses 'W' with 'pfnwpPMM1' and sends the
  473.                              message to 'pfnwpApp0'.  Now, the window
  474.                              procedures of 'W' are:
  475.  
  476.                              pfnwpApp0 -> pfnwpPMM0 -> pfnwpApp1 -> pfnwpPMM1
  477.  
  478.                              'pfnwpApp1' may modify the message before
  479.                              passing it back to the old window procedure.
  480.                              The message, whether modified or not, is shown
  481.                              in the trace file.  From now on, all messages
  482.                              will be intercepted and shown in the trace file
  483.                              as they were received in the window procedure.
  484.  
  485.                4.2.2 The message is sent or posted using WinSendMsg or
  486.                      WinPostMsg.  PMM intercepts the message, subclasses
  487.                      'W' with 'pfnwpPMM1' and sends the message to
  488.                      'pfnwpApp0'.  The window procedures of 'W' are:
  489.  
  490.                      pfnwpApp0 -> pfnwpPMM0 -> pfnwpApp1 -> pfnwpPMM1
  491.  
  492.                      All messages will be intercepted and shown in the trace
  493.                      file as they were received in the window procedure.
  494.  
  495.         Note that, in the case illustrated by 4.2.1.1 above, a message will
  496.         not be traced.  An application may avoid this by using, whenever
  497.         possible, the function PMMSubclassWindow or the combination
  498.         PMMQueryWindowPtr/PMMSetWindowPtr.
  499.  
  500.         Another example will clarify further the way PMM handles
  501.         subclassing.  Assume that a window has the following chain of
  502.         window procedures:
  503.  
  504.         pfnwpApp0 -> pfnwpPMM0 -> pfnwpApp1 -> pfnwpPMM1
  505.  
  506.         A message is sent or posted to that window using WinSendMessage,
  507.         WinPostMsg or through a pointer.  The message will arrive at
  508.         'pfnwpPMM1', which is the end of the chain of window procedures
  509.         associated with the window.  'pfnwpPMM1' logs the message, and
  510.         passes it on to 'pfnwpApp1', which may at its option pass the
  511.         message on to 'pfnwpPMM0'.  In 'pfnwpPMM0', the message is logged
  512.         again if 'pfnwpApp1' has changed the message.  In any event,
  513.         'pfnwpPMM0' then passes the message on to the original (create
  514.         time) window procedure, 'pfnwpApp0'.
  515.  
  516.         Regarding an application, subclassing has several implications:
  517.  
  518.         - A window may have one or more window procedures, each one of them
  519.  
  520.  
  521.  
  522.                                    - 8 -
  523.  
  524.  
  525.  
  526.           responding to some specific messages and passing the others to
  527.           another window procedure.  For a window, OS/2 has only a pointer
  528.           to the "current" window procedure; that is, OS/2 doesn't maintain
  529.           a list of window procedures when an application is subclassing a
  530.           window.  PMM cannot know the "history" of a window before a trace
  531.           session has been created. PMM knows only the last window procedure
  532.           that has been assigned to a window (when it is created or when is
  533.           subclassed) and, starting from this window procedure, maintains a
  534.           list of window procedures.  All this adds up to the following:
  535.           some messages may not be traced if an application subclasses
  536.           windows and then creates a trace session.
  537.  
  538.         - A window subclassed after calling PMMCreateTraceSession must be
  539.           unsubclassed, if it exists, before calling PMMDestroyTraceSession.
  540.  
  541.         - There is a limit on the number of times that an application can
  542.           subclass a window.  See the section "PMM Limits."  Note, however,
  543.           that for practical purposes no such a limit exists.
  544.  
  545.         - When not using PMM, given this sequence of calls:
  546.  
  547.           pfnwpB = WinSubclassWindow( hwnd, pfnwpA );
  548.           pfnwpC = WinSubclassWindow( hwnd, pfnwpB );
  549.  
  550.           'pfnwpA' is equal to 'pfnwpC', at end of execution.
  551.  
  552.           This is not true when using PMM.  Suppose that an application
  553.           executes this code:
  554.  
  555.           /*
  556.           Assume that a trace session has been created.
  557.           PMM has subclassed 'hwnd' with 'pfnwpPMM0' (internal to PMM)
  558.           before the aplication uses WinSubclassWindow.  We have:
  559.  
  560.           pfnwpDefault -> pfnwpPMM0
  561.  
  562.           The following code subclasses 'hwnd' with
  563.           a new window procedure: 'pfnwpA'.
  564.           The returned old window procedure is 'pfnwpB'.
  565.           */
  566.  
  567.           pfnwpB = WinSubclassWindow( hwnd, pfnwpA );
  568.  
  569.           /*
  570.           At this point, if an application uses PMMSubclassWindow, the
  571.           window is subclassed with a new window procedure: 'pfnwpPMM1'
  572.           (internal to PMM).  We have:
  573.  
  574.           pfnwpDefault -> pfnwpPMM0 -> pfnwpA -> pfnwpPMM1
  575.  
  576.           If an application does not use PMMSubclassWindow the window is
  577.  
  578.  
  579.  
  580.                                    - 9 -
  581.  
  582.  
  583.  
  584.           subclassed with 'pfnwpA'.  We have:
  585.  
  586.           pfnwpDefault -> pfnwpPMM0 -> pfnwpA
  587.           */
  588.  
  589.           /* This will generate a WM_SETWINDOWPARAMS message */
  590.           WinSetWindowText( hwnd, "sample" );
  591.           /*
  592.           At this point, if the application used PMMSubclassWindow, PMM does
  593.           nothing.  If the application did not use PMMSubclassWindow, the
  594.           window is now subclassed with a new window procedure: 'pfnwpPMM1'.
  595.           In either case, we have:
  596.  
  597.           pfnwpDefault -> pfnwpPMM0 -> pfnwpA -> pfnwpPMM1
  598.           */
  599.  
  600.           /* Undo the subclassing */
  601.           pfnwpC = WinSubclassWindow( hwnd, pfnwpB );
  602.           /*
  603.           If an application uses PMMSubclassWindow, PMM will undo the
  604.           subclassing: now 'hwnd' has the same window procedure that it had
  605.           before any subclassing has been done.  The final situation is:
  606.  
  607.           pfnwpDefault -> pfnwpPMM0
  608.  
  609.           which is correct.  At this point, however, 'pfnwpA' is *not* equal
  610.           to 'pfnwpC'.  'pfnwpC' is the window procedure that the window had
  611.           before undoing the subclassing, i.e. 'pfnwpPMM1', not the window
  612.           procedure that the window had before doing the first subclassing,
  613.           i.e. 'pfnwpPMM0'.
  614.           */
  615.  
  616.  
  617.  
  618.         5. Messages Traced by PMM
  619.         ═════════════════════════
  620.  
  621.  
  622.         All the PM messages are divided into groups, and a group can have
  623.         subgroups.  PMM considers the following groups and subgroups and
  624.         traces the following messages:
  625.  
  626.         - Group: Window messages.
  627.           The following messages are traced:
  628.  
  629.           WM_ACTIVATE
  630.           WM_ADJUSTWINDOWPOS
  631.           WM_CALCVALIDRECTS
  632.           WM_CLOSE
  633.           WM_COMMAND
  634.           WM_CREATE
  635.  
  636.  
  637.  
  638.                                   - 10 -
  639.  
  640.  
  641.  
  642.           WM_DESTROY
  643.           WM_ENABLE
  644.           WM_HELP
  645.           WM_INITDLG
  646.           WM_MATCHMNEMONIC
  647.           WM_MOVE
  648.           WM_NULL
  649.           WM_PACTIVATE
  650.           WM_PAINT
  651.           WM_PPAINT
  652.           WM_PRESPARAMCHANGED
  653.           WM_PSETFOCUS
  654.           WM_PSIZE
  655.           WM_QUERYDLGCODE
  656.           WM_QUERYWINDOWPARAMS
  657.           WM_QUIT
  658.           WM_SAVEAPPLICATION
  659.           WM_SETFOCUS
  660.           WM_SETSELECTION
  661.           WM_SETWINDOWPARAMS
  662.           WM_SHOW
  663.           WM_SIZE
  664.           WM_SUBSTITUTESTRING
  665.           WM_SYSCOMMAND
  666.  
  667.         - Group: messages related to PM standard controls.
  668.           This group has subgroups.  Below each subgroup are the messages
  669.           that PMM traces:
  670.  
  671.           - Subgroup: messages related to the Frame control.
  672.             The following messages are traced:
  673.  
  674.             WM_ADJUSTFRAMEPOS
  675.             WM_CALCFRAMERECT
  676.             WM_ERASEBACKGROUND
  677.             WM_ERROR
  678.             WM_FLASHWINDOW
  679.             WM_FOCUSCHANGE
  680.             WM_FORMATFRAME
  681.             WM_MINMAXFRAME
  682.             WM_OWNERPOSCHANGE
  683.             WM_QUERYACCELTABLE
  684.             WM_QUERYBORDERSIZE
  685.             WM_QUERYFOCUSCHAIN
  686.             WM_QUERYFRAMECTLCOUNT
  687.             WM_QUERYFRAMEINFO
  688.             WM_QUERYHELPINFO
  689.             WM_QUERYICON
  690.             WM_QUERYTRACKINFO
  691.             WM_SETACCELTABLE
  692.             WM_SETBORDERSIZE
  693.  
  694.  
  695.  
  696.                                   - 11 -
  697.  
  698.  
  699.  
  700.             WM_SETHELPINFO
  701.             WM_SETICON
  702.             WM_TRACKFRAME
  703.             WM_TRANSLATEACCEL
  704.             WM_TRANSLATEMNEMONIC (See Note)*
  705.             WM_UPDATEFRAME
  706.             WM_WINDOWPOSCHANGED
  707.  
  708.           *Note: The WM_TRANSLATEMNEMONIC message doesn't appear in the
  709.           toolkit include files.  Its value is 195 (hexadecimal).
  710.  
  711.           - Subgroup: messages related to the Combo Box control.
  712.             The following messages are traced:
  713.  
  714.             CBM_HILITE
  715.             CBM_ISLISTSHOWING
  716.             CBM_SHOWLIST
  717.             WM_CONTROL and WM_PCONTROL with these notifications:
  718.  
  719.                CBN_EFCHANGE
  720.                CBN_EFSCROLL
  721.                CBN_ENTER
  722.                CBN_LBSCROLL
  723.                CBN_LBSELECT
  724.                CBN_MEMERROR
  725.                CBN_SHOWLIST
  726.                and unknown notifications
  727.  
  728.           - Subgroup: messages related to the Button control.
  729.             The following messages are traced:
  730.  
  731.             BM_CLICK
  732.             BM_QUERYCHECK
  733.             BM_QUERYCHECKINDEX
  734.             BM_QUERYHILITE
  735.             BM_SETCHECK
  736.             BM_SETDEFAULT
  737.             BM_SETHILITE
  738.             WM_CONTROL and WM_PCONTROL with these notifications:
  739.  
  740.                BN_CLICKED
  741.                BN_DBLCLICKED
  742.                BN_PAINT
  743.                and unknown notifications
  744.  
  745.           - Subgroup: messages related to the Menu control.
  746.             The following messages are traced:
  747.  
  748.             MM_DELETEITEM
  749.             MM_ENDMENUMODE
  750.             MM_INSERTITEM
  751.  
  752.  
  753.  
  754.                                   - 12 -
  755.  
  756.  
  757.  
  758.             MM_ISITEMVALID
  759.             MM_ITEMIDFROMPOSITION
  760.             MM_ITEMPOSITIONFROMID
  761.             MM_QUERYDEFAULTITEMID
  762.             MM_QUERYITEM
  763.             MM_QUERYITEMATTR
  764.             MM_QUERYITEMCOUNT
  765.             MM_QUERYITEMRECT
  766.             MM_QUERYITEMTEXT
  767.             MM_QUERYITEMTEXTLENGTH
  768.             MM_QUERYSELITEMID
  769.             MM_REMOVEITEM
  770.             MM_SELECTITEM
  771.             MM_SETDEFAULTITEMID
  772.             MM_SETITEM
  773.             MM_SETITEMATTR
  774.             MM_SETITEMHANDLE
  775.             MM_SETITEMTEXT
  776.             MM_STARTMENUMODE
  777.             WM_DRAWITEM
  778.             WM_INITMENU
  779.             WM_MEASUREITEM
  780.             WM_MENUEND
  781.             WM_MENUSELECT
  782.             WM_NEXTMENU
  783.  
  784.           - Subgroup: messages related to the Static control.
  785.             The following messages are traced:
  786.  
  787.             SM_QUERYHANDLE
  788.             SM_SETHANDLE
  789.  
  790.           - Subgroup: messages related to the Entry Field control.
  791.             The following messages are traced:
  792.  
  793.             EM_CLEAR
  794.             EM_COPY
  795.             EM_CUT
  796.             EM_PASTE
  797.             EM_QUERYCHANGED
  798.             EM_QUERYFIRSTCHAR
  799.             EM_QUERYREADONLY
  800.             EM_QUERYSEL
  801.             EM_SETFIRSTCHAR
  802.             EM_SETINSERTMODE
  803.             EM_SETREADONLY
  804.             EM_SETSEL
  805.             EM_SETTEXTLIMIT
  806.             WM_CONTROL and WM_PCONTROL with these notifications:
  807.  
  808.                EN_CHANGE
  809.  
  810.  
  811.  
  812.                                   - 13 -
  813.  
  814.  
  815.  
  816.                EN_INSERTMODETOGGLE
  817.                EN_KILLFOCUS
  818.                EN_MEMERROR
  819.                EN_OVERFLOW
  820.                EN_SCROLL
  821.                EN_SETFOCUS
  822.                and unknown notifications
  823.  
  824.           - Subgroup: messages related to the List Box control.
  825.             The following messages are traced:
  826.  
  827.             LM_DELETEALL
  828.             LM_DELETEITEM
  829.             LM_INSERTITEM
  830.             LM_QUERYITEMCOUNT
  831.             LM_QUERYITEMHANDLE
  832.             LM_QUERYITEMTEXT
  833.             LM_QUERYITEMTEXTLENGTH
  834.             LM_QUERYSELECTION
  835.             LM_QUERYTOPINDEX
  836.             LM_SEARCHSTRING
  837.             LM_SELECTITEM
  838.             LM_SETITEMHANDLE
  839.             LM_SETITEMHEIGHT
  840.             LM_SETITEMTEXT
  841.             LM_SETTOPINDEX
  842.             WM_CONTROL and WM_PCONTROL with these notifications:
  843.  
  844.                LN_ENTER
  845.                LN_KILLFOCUS
  846.                LN_SCROLL
  847.                LN_SELECT
  848.                LN_SETFOCUS
  849.                and unknown notifications
  850.  
  851.             WM_DRAWITEM
  852.             WM_MEASUREITEM
  853.  
  854.           - Subgroup: messages related to the Scroll Bar control.
  855.             The following messages are traced:
  856.  
  857.             SBM_QUERYPOS
  858.             SBM_QUERYRANGE
  859.             SBM_SETPOS
  860.             SBM_SETSCROLLBAR
  861.             SBM_SETTHUMBSIZE
  862.             WM_HSCROLL
  863.             WM_VSCROLL
  864.  
  865.           - Subgroup: Messages related to the Title Bar control.
  866.             The following messages are traced:
  867.  
  868.  
  869.  
  870.                                   - 14 -
  871.  
  872.  
  873.  
  874.             TBM_QUERYHILITE
  875.             TBM_SETHILITE
  876.  
  877.           - Subgroup: messages related to the Multi-Line Entry Field
  878.             control.
  879.             The following messages are traced:
  880.  
  881.             MLM_CHARFROMLINE
  882.             MLM_CLEAR
  883.             MLM_COPY
  884.             MLM_CUT
  885.             MLM_DELETE
  886.             MLM_DISABLEREFRESH
  887.             MLM_ENABLEREFRESH
  888.             MLM_EXPORT
  889.             MLM_FORMAT
  890.             MLM_IMPORT
  891.             MLM_INSERT
  892.             MLM_LINEFROMCHAR
  893.             MLM_PASTE
  894.             MLM_QUERYBACKCOLOR
  895.             MLM_QUERYCHANGED
  896.             MLM_QUERYFIRSTCHAR
  897.             MLM_QUERYFONT
  898.             MLM_QUERYFORMATLINELENGTH
  899.             MLM_QUERYFORMATRECT
  900.             MLM_QUERYFORMATTEXTLENGTH
  901.             MLM_QUERYIMPORTEXPORT
  902.             MLM_QUERYLINECOUNT
  903.             MLM_QUERYLINELENGTH
  904.             MLM_QUERYREADONLY
  905.             MLM_QUERYSEL
  906.             MLM_QUERYSELTEXT
  907.             MLM_QUERYTABSTOP
  908.             MLM_QUERYTEXTCOLOR
  909.             MLM_QUERYTEXTLENGTH
  910.             MLM_QUERYTEXTLIMIT
  911.             MLM_QUERYUNDO
  912.             MLM_QUERYWRAP
  913.             MLM_RESETUNDO
  914.             MLM_SEARCH
  915.             MLM_SETBACKCOLOR
  916.             MLM_SETCHANGED
  917.             MLM_SETFIRSTCHAR
  918.             MLM_SETFONT
  919.             MLM_SETFORMATRECT
  920.             MLM_SETIMPORTEXPORT
  921.             MLM_SETREADONLY
  922.             MLM_SETSEL
  923.             MLM_SETTABSTOP
  924.             MLM_SETTEXTCOLOR
  925.  
  926.  
  927.  
  928.                                   - 15 -
  929.  
  930.  
  931.  
  932.             MLM_SETTEXTLIMIT
  933.             MLM_SETWRAP
  934.             MLM_UNDO
  935.             WM_CONTROL and WM_PCONTROL with these notifications:
  936.  
  937.                MLN_CHANGE
  938.                MLN_CLPBDFAIL
  939.                MLN_HSCROLL
  940.                MLN_KILLFOCUS
  941.                MLN_MARGIN
  942.                MLN_MEMERROR
  943.                MLN_OVERFLOW
  944.                MLN_PIXHORZOVERFLOW
  945.                MLN_PIXVERTOVERFLOW
  946.                MLN_SEARCHPAUSE
  947.                MLN_SETFOCUS
  948.                MLN_TEXTOVERFLOW
  949.                MLN_UNDOOVERFLOW
  950.                MLN_VSCROLL
  951.                and unknown notifications
  952.  
  953.           - Subgroup: messages related to the AppStat control.
  954.  
  955.             No messages are traced.
  956.  
  957.           - Subgroup: messages related to the KbdStat control.
  958.  
  959.             No messages are traced.
  960.  
  961.           - Subgroup: messages related to the Pecic control.
  962.  
  963.             No messages are traced.
  964.  
  965.           - Subgroup: messages related to the DBE_KKPopup control.
  966.  
  967.             No messages are traced.
  968.  
  969.           - Subgroup: messages related to the Spin Button control.
  970.             The following messages are traced:
  971.  
  972.             SPBM_OVERRIDESETLIMITS
  973.             SPBM_QUERYLIMITS
  974.             SPBM_QUERYVALUE
  975.             SPBM_SETARRAY
  976.             SPBM_SETCURRENTVALUE
  977.             SPBM_SETLIMITS
  978.             SPBM_SETMASTER
  979.             SPBM_SETTEXTLIMIT
  980.             SPBM_SPINDOWN
  981.             SPBM_SPINUP
  982.  
  983.  
  984.  
  985.  
  986.                                   - 16 -
  987.  
  988.  
  989.  
  990.             WM_CONTROL and WM_PCONTROL with these notifications:
  991.  
  992.                SPBN_CHANGE
  993.                SPBN_DOWNARROW
  994.                SPBN_ENDSPIN
  995.                SPBN_KILLFOCUS
  996.                SPBN_SETFOCUS
  997.                SPBN_UPARROW
  998.                and unknown notifications
  999.  
  1000.           - Subgroup: messages related to the Container control.
  1001.             The following messages are traced:
  1002.  
  1003.             CM_ALLOCDETAILFIELDINFO
  1004.             CM_ALLOCRECORD
  1005.             CM_ARRANGE
  1006.             CM_CLOSEEDIT
  1007.             CM_COLLAPSETREE
  1008.             CM_ERASERECORD
  1009.             CM_EXPANDTREE
  1010.             CM_FILTER
  1011.             CM_FREEDETAILFIELDINFO
  1012.             CM_FREERECORD
  1013.             CM_HORZSCROLLSPLITWINDOW
  1014.             CM_INSERTDETAILFIELDINFO
  1015.             CM_INSERTRECORD
  1016.             CM_INVALIDATEDETAILFIELDINFO
  1017.             CM_INVALIDATERECORD
  1018.             CM_OPENEDIT
  1019.             CM_PAINTBACKGROUND
  1020.             CM_QUERYCNRINFO
  1021.             CM_QUERYDETAILFIELDINFO
  1022.             CM_QUERYDRAGIMAGE
  1023.             CM_QUERYRECORD
  1024.             CM_QUERYRECORDEMPHASIS
  1025.             CM_QUERYRECORDFROMRECT
  1026.             CM_QUERYRECORDINFO
  1027.             CM_QUERYRECORDRECT
  1028.             CM_QUERYVIEWPORTRECT
  1029.             CM_REMOVEDETAILFIELDINFO
  1030.             CM_REMOVERECORD
  1031.             CM_SCROLLWINDOW
  1032.             CM_SEARCHSTRING
  1033.             CM_SETCNRINFO
  1034.             CM_SETRECORDEMPHASIS
  1035.             CM_SORTRECORD
  1036.             WM_CONTROL and WM_PCONTROL with these notifications:
  1037.  
  1038.                CN_BEGINEDIT
  1039.                CN_COLLAPSETREE
  1040.                CN_CONTEXTMENU
  1041.  
  1042.  
  1043.  
  1044.                                   - 17 -
  1045.  
  1046.  
  1047.  
  1048.                CN_DRAGAFTER
  1049.                CN_DRAGLEAVE
  1050.                CN_DRAGOVER
  1051.                CN_DROP
  1052.                CN_DROPHELP
  1053.                CN_EMPHASIS
  1054.                CN_ENDEDIT
  1055.                CN_ENTER
  1056.                CN_EXPANDTREE
  1057.                CN_HELP
  1058.                CN_INITDRAG
  1059.                CN_KILLFOCUS
  1060.                CN_QUERYDELTA
  1061.                CN_REALLOCPSZ
  1062.                CN_SCROLL
  1063.                CN_SETFOCUS
  1064.                and unknown notifications
  1065.  
  1066.             WM_DRAWITEM
  1067.  
  1068.           - Subgroup: messages related to the Slider control.
  1069.             The following messages are traced:
  1070.  
  1071.             SLM_ADDDETENT
  1072.             SLM_QUERYDETENTPOS
  1073.             SLM_QUERYSCALETEXT
  1074.             SLM_QUERYSLIDERINFO
  1075.             SLM_QUERYTICKPOS
  1076.             SLM_QUERYTICKSIZE
  1077.             SLM_REMOVEDETENT
  1078.             SLM_SETSCALETEXT
  1079.             SLM_SETSLIDERINFO
  1080.             SLM_SETTICKSIZE
  1081.             WM_CONTROL and WM_PCONTROL with these notifications:
  1082.  
  1083.                SLN_CHANGE
  1084.                SLN_KILLFOCUS
  1085.                SLN_SETFOCUS
  1086.                SLN_SLIDERTRACK
  1087.                and unknown notifications
  1088.  
  1089.             WM_DRAWITEM
  1090.  
  1091.           - Subgroup: messages related to the Value Set control.
  1092.             The following messages are traced:
  1093.  
  1094.             VM_QUERYITEM
  1095.             VM_QUERYITEMATTR
  1096.             VM_QUERYMETRICS
  1097.             VM_QUERYSELECTEDITEM
  1098.             VM_SELECTITEM
  1099.  
  1100.  
  1101.  
  1102.                                   - 18 -
  1103.  
  1104.  
  1105.  
  1106.             VM_SETITEM
  1107.             VM_SETITEMATTR
  1108.             VM_SETMETRICS
  1109.             WM_CONTROL and WM_PCONTROL with these notifications:
  1110.  
  1111.                VN_DRAGLEAVE
  1112.                VN_DRAGOVER
  1113.                VN_DROP
  1114.                VN_DROPHELP
  1115.                VN_ENTER
  1116.                VN_HELP
  1117.                VN_INITDRAG
  1118.                VN_KILLFOCUS
  1119.                VN_SELECT
  1120.                VN_SETFOCUS
  1121.                and unknown notifications
  1122.  
  1123.             WM_DRAWITEM
  1124.  
  1125.           - Subgroup: messages related to the Notebook control.
  1126.             The following messages are traced:
  1127.  
  1128.             BKM_CALCPAGERECT
  1129.             BKM_DELETEPAGE
  1130.             BKM_INSERTPAGE
  1131.             BKM_INVALIDATETABS
  1132.             BKM_QUERYPAGECOUNT
  1133.             BKM_QUERYPAGEDATA
  1134.             BKM_QUERYPAGEID
  1135.             BKM_QUERYPAGESTYLE
  1136.             BKM_QUERYPAGEWINDOWHWND
  1137.             BKM_QUERYSTATUSLINETEXT
  1138.             BKM_QUERYTABBITMAP
  1139.             BKM_QUERYTABTEXT
  1140.             BKM_SETDIMENSIONS
  1141.             BKM_SETNOTEBOOKCOLORS
  1142.             BKM_SETPAGEDATA
  1143.             BKM_SETPAGEWINDOWHWND
  1144.             BKM_SETSTATUSLINETEXT
  1145.             BKM_SETTABBITMAP
  1146.             BKM_SETTABTEXT
  1147.             BKM_TURNTOPAGE
  1148.             WM_CONTROL and WM_PCONTROL with these notifications:
  1149.  
  1150.                BKN_HELP
  1151.                BKN_NEWPAGESIZE
  1152.                BKN_PAGEDELETED
  1153.                BKN_PAGESELECTED
  1154.                and unknown notifications
  1155.  
  1156.             WM_DRAWITEM
  1157.  
  1158.  
  1159.  
  1160.                                   - 19 -
  1161.  
  1162.  
  1163.  
  1164.           - Subgroup: Other messages.
  1165.  
  1166.             In this group are some WM_CONTROL, WM_PCONTROL, WM_MEASUREITEM
  1167.             and WM_DRAWITEM messages that are erroneous, undocumented or
  1168.             cannot be interpreted.
  1169.  
  1170.             - Regarding WM_CONTROL and WM_PCONTROL:
  1171.  
  1172.               WM_CONTROL messages are sent by a window to notify its owner
  1173.               of significant events.  Upon receiving one of them, they can
  1174.               also be sent by a frame window to notify their client of the
  1175.               same event.  WM_PCONTROL messages are posted to the
  1176.               application queue.  A window whose class is not a:
  1177.  
  1178.               Button
  1179.               Combo Box
  1180.               Container
  1181.               Entry Field
  1182.               List Box
  1183.               Multi-Line Entry Field
  1184.               Notebook
  1185.               Slider
  1186.               Spin Button
  1187.               Value Set
  1188.  
  1189.               generates a message traced in this group.  Since no
  1190.               notification is defined for a window of such a class, the
  1191.               parameters of the WM_CONTROL or WM_PCONTROL message cannot
  1192.               be interpreted.
  1193.  
  1194.             - Regarding WM_MEASUREITEM:
  1195.  
  1196.               When a window which is not a:
  1197.  
  1198.                  List Box
  1199.                  Menu
  1200.  
  1201.               sends a WM_MEASUREITEM to its owner, the WM_MEASUREITEM
  1202.               message is traced in this group because the second message
  1203.               parameter cannot be interpreted.
  1204.  
  1205.             - Regarding WM_DRAWITEM:
  1206.  
  1207.               When a window which is not a:
  1208.  
  1209.                  Container
  1210.                  List Box
  1211.                  Menu
  1212.                  Notebook
  1213.                  Slider
  1214.                  Value Set
  1215.  
  1216.  
  1217.  
  1218.                                   - 20 -
  1219.  
  1220.  
  1221.  
  1222.               sends a WM_DRAWITEM to its owner, the WM_DRAWITEM message is
  1223.               traced in this group because the second message parameter
  1224.               cannot be interpreted.
  1225.  
  1226.         - Group: Keyboard messages.
  1227.           The following messages are traced:
  1228.  
  1229.           WM_CHAR
  1230.           WM_JOURNALNOTIFY
  1231.           WM_VIOCHAR (See Note)*
  1232.  
  1233.           *Note: The parameters of the WM_VIOCHAR message are undocumented.
  1234.  
  1235.         - Group: Mouse messages.
  1236.           The following messages are traced:
  1237.  
  1238.              WM_BUTTON1CLICK
  1239.              WM_BUTTON1DBLCLK
  1240.              WM_BUTTON1DOWN
  1241.              WM_BUTTON1UP
  1242.              WM_BUTTON2CLICK
  1243.              WM_BUTTON2DBLCLK
  1244.              WM_BUTTON2DOWN
  1245.              WM_BUTTON2UP
  1246.              WM_BUTTON3CLICK
  1247.              WM_BUTTON3DBLCLK
  1248.              WM_BUTTON3DOWN
  1249.              WM_BUTTON3UP
  1250.              WM_CHORD (See Note)*
  1251.              WM_CONTROLPOINTER
  1252.              WM_HITTEST
  1253.              WM_MOUSEMAP
  1254.              WM_MOUSEMOVE
  1255.  
  1256.           *Note: The first parameter of the WM_CHORD message is
  1257.           undocumented. This message occurs when the operator presses both
  1258.           button one and button two on the pointing device.
  1259.  
  1260.         - Group: Clipboard messages.
  1261.           The following messages are traced:
  1262.  
  1263.              WM_DESTROYCLIPBOARD
  1264.              WM_DRAWCLIPBOARD
  1265.              WM_HSCROLLCLIPBOARD
  1266.              WM_PAINTCLIPBOARD
  1267.              WM_RENDERALLFMTS
  1268.              WM_RENDERFMT
  1269.              WM_SIZECLIPBOARD
  1270.              WM_VSCROLLCLIPBOARD
  1271.  
  1272.  
  1273.  
  1274.  
  1275.  
  1276.                                   - 21 -
  1277.  
  1278.  
  1279.  
  1280.         - Group: Dynamic Data Exchange messages.
  1281.           The following messages are traced:
  1282.  
  1283.              WM_DDE_ACK
  1284.              WM_DDE_ADVISE
  1285.              WM_DDE_DATA
  1286.              WM_DDE_EXECUTE
  1287.              WM_DDE_INITIATE
  1288.              WM_DDE_INITIATEACK
  1289.              WM_DDE_POKE
  1290.              WM_DDE_REQUEST
  1291.              WM_DDE_TERMINATE
  1292.              WM_DDE_UNADVISE
  1293.  
  1294.         - Group: Help messages.
  1295.           The following messages are traced:
  1296.  
  1297.              HM_ACTIONBAR_COMMAND
  1298.              HM_CONTROL
  1299.              HM_CREATE_HELP_TABLE
  1300.              HM_DISMISS_WINDOW
  1301.              HM_DISPLAY_HELP
  1302.              HM_ERROR
  1303.              HM_EXT_HELP
  1304.              HM_EXT_HELP_UNDEFINED
  1305.              HM_HELPSUBITEM_NOT_FOUND
  1306.              HM_HELP_CONTENTS
  1307.              HM_HELP_INDEX
  1308.              HM_INFORM
  1309.              HM_INVALIDATE_DDF_DATA
  1310.              HM_KEYS_HELP
  1311.              HM_LOAD_HELP_TABLE
  1312.              HM_NOTIFY
  1313.              HM_QUERY
  1314.              HM_QUERY_DDF_DATA
  1315.              HM_QUERY_KEYS_HELP
  1316.              HM_REPLACE_HELP_FOR_HELP
  1317.              HM_SET_ACTIVE_WINDOW
  1318.              HM_SET_COVERPAGE_SIZE
  1319.              HM_SET_HELP_LIBRARY_NAME
  1320.              HM_SET_HELP_WINDOW_TITLE
  1321.              HM_SET_OBJCOM_WINDOW
  1322.              HM_SET_SHOW_PANEL_ID
  1323.              HM_SET_USERDATA
  1324.              HM_TUTORIAL
  1325.              HM_UPDATE_OBJCOM_WINDOW_CHAIN
  1326.  
  1327.         - Group: Direct Manipulation (Drag & Drop) messages.
  1328.           The following messages are traced:
  1329.  
  1330.              DM_DISCARDOBJECT
  1331.  
  1332.  
  1333.  
  1334.                                   - 22 -
  1335.  
  1336.  
  1337.  
  1338.              DM_DRAGERROR
  1339.              DM_DRAGFILECOMPLETE
  1340.              DM_DRAGLEAVE
  1341.              DM_DRAGOVER
  1342.              DM_DRAGOVERNOTIFY
  1343.              DM_DROP
  1344.              DM_DROPHELP
  1345.              DM_EMPHASIZETARGET
  1346.              DM_ENDCONVERSATION
  1347.              DM_FILERENDERED
  1348.              DM_PRINT
  1349.              DM_PRINTOBJECT
  1350.              DM_RENDER
  1351.              DM_RENDERCOMPLETE
  1352.              DM_RENDERFILE
  1353.              DM_RENDERPREPARE
  1354.              WM_BEGINDRAG
  1355.              WM_BUTTON1MOTIONEND
  1356.              WM_BUTTON1MOTIONSTART
  1357.              WM_BUTTON2MOTIONEND
  1358.              WM_BUTTON2MOTIONSTART
  1359.              WM_BUTTON3MOTIONEND
  1360.              WM_BUTTON3MOTIONSTART
  1361.              WM_ENDDRAG
  1362.  
  1363.         - Group: Double-Byte Character Set messages.
  1364.           The following messages are traced:
  1365.  
  1366.              WM_DBE_KKCPARAMS
  1367.              WM_DBE_SETAPPLSTAT
  1368.              WM_QUERYCONVERTPOS
  1369.  
  1370.           and all other messages, not appearing in the above list, in the
  1371.           range from WM_DBCSFIRST to WM_DBCSLAST.  The messages that do not
  1372.           have a name are traced as "(DBCS?) MsgNumber", where MsgNumber is
  1373.           shown in hexadecimal and decimal.
  1374.  
  1375.           The messages traced are those defined in the toolkit include
  1376.           files.
  1377.  
  1378.         - Group: Pen messages.
  1379.  
  1380.           No pen message is defined in Presentation Manager. Messages
  1381.           falling in the range WM_PENFIRST thru WM_PENLAST will be traced
  1382.           and named as "(PEN?) MsgNumber".
  1383.  
  1384.         - Group: MultiMedia messages.
  1385.  
  1386.           Multimedia messages are not interpreted in the current version
  1387.           of PMM.  Messages falling in the range WM_MMPMFIRST thru
  1388.           WM_MMPMLAST will be traced and named as "(MM?) MsgNumber".
  1389.  
  1390.  
  1391.  
  1392.                                   - 23 -
  1393.  
  1394.  
  1395.  
  1396.         - Group: System messages.
  1397.           The following messages are traced:
  1398.  
  1399.              PL_ALTERED
  1400.              WM_APPTERMINATENOTIFY
  1401.              WM_PSYSCOLORCHANGE
  1402.              WM_REALIZEPALETTE
  1403.              WM_SYSCOLORCHANGE
  1404.              WM_SYSVALUECHANGED
  1405.  
  1406.         - Group: Miscellaneous messages.
  1407.           The following messages are traced:
  1408.  
  1409.            WM_BEGINSELECT
  1410.            WM_CONTEXTMENU
  1411.            WM_ENDSELECT
  1412.            WM_OPEN
  1413.            WM_SEM1
  1414.            WM_SEM2
  1415.            WM_SEM3
  1416.            WM_SEM4
  1417.            WM_SINGLESELECT
  1418.            WM_TEXTEDIT
  1419.            WM_TIMER
  1420.  
  1421.         - Group: File Dialog messages.
  1422.           The following messages are traced:
  1423.  
  1424.              FDM_ERROR
  1425.              FDM_FILTER
  1426.              FDM_VALIDATE
  1427.  
  1428.         - Group: Font Dialog messages.
  1429.           The following messages are traced:
  1430.  
  1431.              FNTM_COLORCHANGED (See Note)*
  1432.              FNTM_FACENAMECHANGED
  1433.              FNTM_FILTERLIST
  1434.              FNTM_POINTSIZECHANGED
  1435.              FNTM_STYLECHANGED
  1436.              FNTM_UPDATEPREVIEW
  1437.  
  1438.           *Note: The parameters of the FNTM_COLORCHANGED message are
  1439.           undocumented.
  1440.  
  1441.         - Group: Reserved messages.
  1442.           The following messages are traced:
  1443.  
  1444.              0x0054
  1445.              0x005a
  1446.              0x041a
  1447.  
  1448.  
  1449.  
  1450.                                   - 24 -
  1451.  
  1452.  
  1453.  
  1454.              0x041b
  1455.              0x041c
  1456.              0x041d
  1457.              0x041e
  1458.              0x041f
  1459.  
  1460.         - Group: Undocumented messages.
  1461.           Messages that do not belong to any of the above groups are traced.
  1462.           All of these messages are undocumented.  Also, included in this
  1463.           group are the following three messages, whose name is known, but
  1464.           not their parameters or usage:
  1465.  
  1466.             PM_INVALIDATECELL       = WM_USER + 1000 (decimal)
  1467.             WM_CONTROLHEAP          = 39 (hexadecimal)
  1468.             WM_OTHERWINDOWDESTROYED = 3 (hexadecimal)
  1469.  
  1470.         - Group: User messages.
  1471.           User messages, i.e. messages greater than or equal to the WM_USER
  1472.           constant (excluding the File Dialog messages, the Font Dialog
  1473.           messages and the PM_INVALIDATECELL message).
  1474.  
  1475.  
  1476.  
  1477.         6. The PMM Interface
  1478.         ════════════════════
  1479.  
  1480.  
  1481.         This section describes the PMM interface to an application.
  1482.  
  1483.  
  1484.         List of Functions
  1485.         ═════════════════
  1486.  
  1487.  
  1488.         PMMCreateTraceSession
  1489.         ─────────────────────
  1490.  
  1491.         This function creates a trace session.  A message queue must exist
  1492.         before invoking this function.  Windows associated with the message
  1493.         queue created by the calling thread will be traced.  A line is
  1494.         written to the trace file indicating that a trace session has been
  1495.         created.
  1496.  
  1497.         Function Syntax:
  1498.  
  1499.            PMMRET       pmmr;
  1500.            HPMMSESSION  hpmms;
  1501.            PSZ          pszTraceFileName = "pmm.log";
  1502.  
  1503.            pmmr = PMMCreateTraceSession( &hpmms, hab, pszTraceFileName );
  1504.  
  1505.  
  1506.  
  1507.  
  1508.                                   - 25 -
  1509.  
  1510.  
  1511.  
  1512.         Parameters:
  1513.  
  1514.            hpmms (HPMMSESSION) - output
  1515.               Session handle returned by the function.  Unaltered if the
  1516.               function fails.
  1517.  
  1518.            hab (HAB) - input
  1519.               Anchor-block handle.
  1520.  
  1521.            pszTraceFileName (PSZ) - input
  1522.               Address of an ASCIIZ string with the path and filename of the
  1523.               file into which the trace information will be written.
  1524.  
  1525.         Return Values:
  1526.            Success:
  1527.               PMMESuccess
  1528.            Error: one of the following:
  1529.               PMMECannotQueryOS2Version
  1530.               PMMECannotRunInThisOS2Version
  1531.               PMMEMultipleSessionsNotAllowed
  1532.               PMMECannotQueryDesktopWindow
  1533.               PMMECannotQueryObjectWindow
  1534.               PMMENotEnoughMemory
  1535.               PMMECannotRegisterInternalClass
  1536.               PMMECannotCreateInternalWindow
  1537.               PMMECannotSetSendMsgHook
  1538.               PMMECannotSetInputMsgHook
  1539.               PMMECannotOpenTraceFile
  1540.               PMMEWriteFailed
  1541.               PMMECannotCloseTraceFile
  1542.  
  1543.  
  1544.         PMMStartTracing
  1545.         ───────────────
  1546.  
  1547.         This function opens the trace file and starts tracing messages.  A
  1548.         line is written to the trace file indicating that tracing has been
  1549.         started.  The trace file is opened using DosOpen.  If the file does
  1550.         not exist, it is created; if the file exists, its contents are
  1551.         preserved and the trace information is appended at the end of the
  1552.         file.  Other applications cannot write to the file while the file is
  1553.         open.  This file is write-only.
  1554.  
  1555.         Function Syntax:
  1556.  
  1557.            PMMRET       pmmr;
  1558.            HPMMSESSION  hpmms;
  1559.  
  1560.            pmmr = PMMStartTracing( hpmms );
  1561.  
  1562.  
  1563.  
  1564.  
  1565.  
  1566.                                   - 26 -
  1567.  
  1568.  
  1569.  
  1570.         Parameters:
  1571.  
  1572.            hpmms (HPMMSESSION) - input
  1573.               Session handle returned by a previous call to
  1574.               PMMCreateTraceSession.
  1575.  
  1576.         Return Values:
  1577.            Success:
  1578.               PMMESuccess
  1579.            Error: one of the following:
  1580.               PMMETraceSessionNotCreated
  1581.               PMMEInvalidHandle
  1582.               PMMEAlreadyTracing
  1583.               PMMECannotOpenTraceFile
  1584.               PMMEWriteFailed
  1585.  
  1586.  
  1587.         PMMStopTracing
  1588.         ──────────────
  1589.  
  1590.         This function stops tracing messages.  A line is written to the
  1591.         trace file indicating that tracing has been stopped.  The trace file
  1592.         is closed and ready to be examined.
  1593.  
  1594.         Function Syntax:
  1595.  
  1596.            PMMRET       pmmr;
  1597.            HPMMSESSION  hpmms;
  1598.  
  1599.            pmmr = PMMStopTracing( hpmms );
  1600.  
  1601.         Parameters:
  1602.  
  1603.            hpmms (HPMMSESSION) - input
  1604.               Session handle returned by a previous call to
  1605.               PMMCreateTraceSession.
  1606.  
  1607.         Return Values:
  1608.            Success:
  1609.               PMMESuccess
  1610.            Error: one of the following:
  1611.               PMMETraceSessionNotCreated
  1612.               PMMEInvalidHandle
  1613.               PMMENotTracingNow
  1614.               PMMEWriteFailed
  1615.               PMMECannotCloseTraceFile
  1616.  
  1617.  
  1618.  
  1619.  
  1620.  
  1621.  
  1622.  
  1623.  
  1624.                                   - 27 -
  1625.  
  1626.  
  1627.  
  1628.         PMMDestroyTraceSession
  1629.         ──────────────────────
  1630.  
  1631.         This function destroys a trace session.  A line is written to the
  1632.         trace file indicating that a trace session has been destroyed.
  1633.  
  1634.         Function Syntax:
  1635.  
  1636.            PMMRET       pmmr;
  1637.            HPMMSESSION  hpmms;
  1638.  
  1639.            pmmr = PMMDestroyTraceSession( hpmms );
  1640.  
  1641.         Parameters:
  1642.  
  1643.            hpmms (HPMMSESSION) - input
  1644.               Session handle returned by a previous call to
  1645.               PMMCreateTraceSession.
  1646.  
  1647.         Return Values:
  1648.            Success:
  1649.               PMMESuccess
  1650.            Error: one of the following:
  1651.               PMMETraceSessionNotCreated
  1652.               PMMEInvalidHandle
  1653.               PMMEWriteFailed
  1654.               PMMECannotCloseTraceFile
  1655.               PMMECannotReleaseInputMsgHook
  1656.               PMMECannotReleaseSendMsgHook
  1657.               PMMECannotDestroyInternalWindow
  1658.               PMMECannotOpenTraceFile
  1659.  
  1660.  
  1661.         PMMQueryVersion
  1662.         ───────────────
  1663.  
  1664.         This function queries the current version of PMM.
  1665.  
  1666.         Function Syntax:
  1667.  
  1668.            PMMRET       pmmr;
  1669.            HPMMSESSION  hpmms;
  1670.            ULONG        ulVersion;
  1671.  
  1672.            pmmr = PMMQueryVersion( hpmms, &ulVersion );
  1673.  
  1674.         Parameters:
  1675.  
  1676.            hpmms (HPMMSESSION) - input
  1677.               Session handle returned by a previous call to
  1678.               PMMCreateTraceSession.
  1679.  
  1680.  
  1681.  
  1682.                                   - 28 -
  1683.  
  1684.  
  1685.  
  1686.            ulVersion (ULONG) - output
  1687.               Current version of PMM.  The major version is returned in the
  1688.               higher 16 bits, the minor version in the lower 16 bits.
  1689.  
  1690.         Return Values:
  1691.            Success:
  1692.               PMMESuccess
  1693.            Error: one of the following:
  1694.               PMMETraceSessionNotCreated
  1695.               PMMEInvalidHandle
  1696.  
  1697.         Notes:
  1698.            Useful to determine the functionality that is currently supported
  1699.            by PMM.
  1700.  
  1701.  
  1702.         PMMQueryTraceFileHandle
  1703.         ───────────────────────
  1704.  
  1705.         This function retrieves the handle of the trace file.  An
  1706.         application may write any text to the trace file using the OS/2 API
  1707.         DosWrite, with the handle returned from this call.  Since the trace
  1708.         file is opened by PMMStartTracing and closed by PMMStopTracing, you
  1709.         must be tracing at the time this function is invoked.
  1710.  
  1711.         Function Syntax:
  1712.  
  1713.            PMMRET       pmmr;
  1714.            HPMMSESSION  hpmms;
  1715.            HFILE        hTraceFile;
  1716.  
  1717.            pmmr = PMMQueryTraceFileHandle( hpmms, &hTraceFile );
  1718.  
  1719.         Parameters:
  1720.  
  1721.            hpmms (HPMMSESSION) - input
  1722.               Session handle returned by a previous call to
  1723.               PMMCreateTraceSession.
  1724.  
  1725.            hTraceFile (HFILE) - output
  1726.               Handle of the trace file.  Unaltered if the function fails.
  1727.  
  1728.         Return Values:
  1729.            Success:
  1730.               PMMESuccess
  1731.            Error: one of the following:
  1732.               PMMETraceSessionNotCreated
  1733.               PMMEInvalidHandle
  1734.               PMMENotTracingNow
  1735.  
  1736.  
  1737.  
  1738.  
  1739.  
  1740.                                   - 29 -
  1741.  
  1742.  
  1743.  
  1744.         Notes:
  1745.            See the functions PMMStartTracing and PMMStopTracing.
  1746.  
  1747.  
  1748.         PMMSetMsgGroupsToTrace
  1749.         ──────────────────────
  1750.  
  1751.         For tracing purposes, all the PM messages are divided into
  1752.         categories or groups, according to functionality.  This function
  1753.         sets the message groups to trace.  A line is written to the trace
  1754.         file when this function is called, indicating what groups are
  1755.         currently being traced.
  1756.  
  1757.         Function Syntax:
  1758.  
  1759.            PMMRET       pmmr;
  1760.            HPMMSESSION  hpmms;
  1761.            ULONG        ulMask;
  1762.            ULONG        ulFlags;
  1763.  
  1764.            pmmr = PMMSetMsgGroupsToTrace( hpmms, ulMask, ulFlags );
  1765.  
  1766.         Parameters:
  1767.  
  1768.            hpmms (HPMMSESSION) - input
  1769.               Session handle returned by a previous call to
  1770.               PMMCreateTraceSession.
  1771.  
  1772.            ulMask (ULONG) - input
  1773.               The mask is formed by combining zero or more constants in a
  1774.               logical OR operation.  Its use is described in the ulFlags
  1775.               section, below.  The following constants, defined in PMM.H,
  1776.               may be used in the mask:
  1777.  
  1778.                  PMMTMG_WINDOW
  1779.                  PMMTMG_CONTROLS
  1780.                  PMMTMG_KEYBOARD
  1781.                  PMMTMG_MOUSE
  1782.                  PMMTMG_CLIPBOARD
  1783.                  PMMTMG_DDE
  1784.                  PMMTMG_HELP
  1785.                  PMMTMG_DIRECT_MANIP
  1786.                  PMMTMG_DBCS
  1787.                  PMMTMG_PEN
  1788.                  PMMTMG_MULTIMEDIA
  1789.                  PMMTMG_SYSTEM
  1790.                  PMMTMG_OTHER
  1791.                  PMMTMG_FILE_DIALOG
  1792.                  PMMTMG_FONT_DIALOG
  1793.                  PMMTMG_RESERVED
  1794.                  PMMTMG_UNDOCUMENTED
  1795.  
  1796.  
  1797.  
  1798.                                   - 30 -
  1799.  
  1800.  
  1801.  
  1802.                  PMMTMG_USER
  1803.                  PMMTMG_ALL
  1804.  
  1805.            ulFlags (ULONG) - input
  1806.               The ulFlags parameter is formed by combining zero or more
  1807.               constants in a logical OR operation.  If the corresponding
  1808.               value in the mask is set, values present in this parameter
  1809.               will be interpreted as TRUE (trace this group of messages)
  1810.               while their absence will be interpreted as FALSE (do not
  1811.               trace this group of messages).  If a value is not present
  1812.               in the parameter ulMask, the corresponding value in the
  1813.               parameter ulFlags will be ignored.  The same constants used
  1814.               in the parameter ulMask may be used.
  1815.  
  1816.         Return Values:
  1817.            Success:
  1818.               PMMESuccess
  1819.            Error: one of the following:
  1820.               PMMETraceSessionNotCreated
  1821.               PMMEInvalidHandle
  1822.               PMMECannotOpenTraceFile
  1823.               PMMEWriteFailed
  1824.               PMMECannotCloseTraceFile
  1825.  
  1826.         Default values at startup:
  1827.            PMMTMG_ALL for ulMask.  All flags will be processed.
  1828.            PMMTMG_ALL for ulFlags.  All message groups will be traced.
  1829.  
  1830.         Notes:
  1831.            Undefined values in the parameters ulMask and ulFlags are
  1832.            ignored.  Because more groups may be added in the future, an
  1833.            application should not use undefined values.
  1834.  
  1835.  
  1836.         PMMSetControlsToTrace
  1837.         ─────────────────────
  1838.  
  1839.         Messages related to PM controls are organized in groups.  These
  1840.         groups belong to the more general group of 'Controls'.  This
  1841.         function sets the PM controls to trace.  For this function to have
  1842.         any effect, the flag PMMTMG_CONTROLS (mentioned in the function
  1843.         PMMSetMsgGroupsToTrace) must be set to trace the messages related
  1844.         to one or more controls.  A line is written to the trace file when
  1845.         this function is invoked, indicating which controls are currently
  1846.         being traced.
  1847.  
  1848.         Function Syntax:
  1849.  
  1850.            PMMRET       pmmr;
  1851.            HPMMSESSION  hpmms;
  1852.            ULONG        ulMask;
  1853.  
  1854.  
  1855.  
  1856.                                   - 31 -
  1857.  
  1858.  
  1859.  
  1860.            ULONG        ulFlags;
  1861.  
  1862.            pmmr = PMMSetControlsToTrace( hpmms, ulMask, ulFlags );
  1863.  
  1864.         Parameters:
  1865.  
  1866.            hpmms (HPMMSESSION) - input
  1867.               Session handle returned by a previous call to
  1868.               PMMCreateTraceSession.
  1869.  
  1870.            ulMask (ULONG) - input
  1871.               The mask is formed by combining zero or more constants in a
  1872.               logical OR operation.  Its use is described in the ulFlags
  1873.               section, below.  The following constants, defined in PMM.H,
  1874.               may be used in the mask:
  1875.  
  1876.                  PMMTCO_FRAME
  1877.                  PMMTCO_COMBOBOX
  1878.                  PMMTCO_BUTTON
  1879.                  PMMTCO_MENU
  1880.                  PMMTCO_STATIC
  1881.                  PMMTCO_ENTRYFIELD
  1882.                  PMMTCO_LISTBOX
  1883.                  PMMTCO_SCROLLBAR
  1884.                  PMMTCO_TITLEBAR
  1885.                  PMMTCO_MLE
  1886.                  PMMTCO_APPSTAT
  1887.                  PMMTCO_KBDSTAT
  1888.                  PMMTCO_PECIC
  1889.                  PMMTCO_DBE_KKPOPUP
  1890.                  PMMTCO_SPINBUTTON
  1891.                  PMMTCO_CONTAINER
  1892.                  PMMTCO_SLIDER
  1893.                  PMMTCO_VALUESET
  1894.                  PMMTCO_NOTEBOOK
  1895.                  PMMTCO_OTHER
  1896.                  PMMTCO_ALL
  1897.  
  1898.            ulFlags (ULONG) - input
  1899.               The ulFlags parameter is formed by combining zero or more
  1900.               constants in a logical OR operation.  If the corresponding
  1901.               value in the mask is set, values present in this parameter
  1902.               will be interpreted as TRUE (trace this group of messages)
  1903.               while their absence will be interpreted as FALSE (do not
  1904.               trace this group of messages).  If a value is not present
  1905.               in the parameter ulMask, the corresponding value in the
  1906.               parameter ulFlags will be ignored.  The same constants used
  1907.               in the parameter ulMask may be used.
  1908.  
  1909.  
  1910.  
  1911.  
  1912.  
  1913.  
  1914.                                   - 32 -
  1915.  
  1916.  
  1917.  
  1918.         Return Values:
  1919.            Success:
  1920.               PMMESuccess
  1921.            Error: one of the following:
  1922.               PMMETraceSessionNotCreated
  1923.               PMMEInvalidHandle
  1924.               PMMECannotOpenTraceFile
  1925.               PMMEWriteFailed
  1926.               PMMECannotCloseTraceFile
  1927.  
  1928.         Default values at startup:
  1929.            PMMTCO_ALL for ulMask.  All flags will be processed.
  1930.            PMMTCO_ALL for ulFlags.  All messages corresponding to the above
  1931.            list of controls will be traced.
  1932.  
  1933.         Notes:
  1934.            Undefined values in the parameters ulMask and ulFlags are
  1935.            ignored.  Because more groups may be added in the future, an
  1936.            application should not use undefined values.
  1937.  
  1938.  
  1939.         PMMShowWindowText
  1940.         ─────────────────
  1941.  
  1942.         This function controls whether PMM should show the text of a window
  1943.         in a message.  This is useful for identifying windows.  Square
  1944.         brackets denote optional items.  The window text is shown in this
  1945.         format:
  1946.  
  1947.            "WindowText"[a][t]
  1948.  
  1949.         where:
  1950.  
  1951.         - 'WindowText' is the text of the window.
  1952.         - The suffix 'a' means (a)ltered, i.e. the original window text has
  1953.           been altered by PMM.  Some windows have control characters like
  1954.           CR, LF in their text. Showing the control characters in a text
  1955.           file produces confusion since the trace line splits into several
  1956.           parts. The suffix indicates that all HT, LF, CR and SUB characters
  1957.           have been converted into spaces.
  1958.         - The suffix 't' means (t)rimmed, i.e. the window text has been
  1959.           trimmed.  The maximum text length shown is 20 characters.
  1960.  
  1961.         Function Syntax:
  1962.  
  1963.            PMMRET       pmmr;
  1964.            HPMMSESSION  hpmms;
  1965.            BOOL         bShow;
  1966.  
  1967.            bShow = TRUE;
  1968.            pmmr = PMMShowWindowText( hpmms, bShow );
  1969.  
  1970.  
  1971.  
  1972.                                   - 33 -
  1973.  
  1974.  
  1975.  
  1976.         Parameters:
  1977.  
  1978.            hpmms (HPMMSESSION) - input
  1979.               Session handle returned by a previous call to
  1980.               PMMCreateTraceSession.
  1981.  
  1982.            bShow (BOOL) - input
  1983.               Show window text indicator:
  1984.               TRUE
  1985.                  Show the window text.
  1986.               FALSE
  1987.                  Do not show the window text.
  1988.  
  1989.         Return Values:
  1990.            Success:
  1991.               PMMESuccess
  1992.            Error: one of the following:
  1993.               PMMETraceSessionNotCreated
  1994.               PMMEInvalidHandle
  1995.  
  1996.         Default value at startup:
  1997.            The window text will be shown.
  1998.  
  1999.         Notes:
  2000.            Some windows do not have a "Text" property.  The window text is
  2001.            shown if the window has this property and the text is not an
  2002.            empty string.  If the text contains embedded double quotes, which
  2003.            are used as a text delimiter, the embedded double quotes are
  2004.            simply displayed.  For instance, the following window text has
  2005.            unbalanced quotes and is correct:
  2006.  
  2007.               "Viewing "It is a Won"t
  2008.  
  2009.  
  2010.         PMMShowClassName
  2011.         ────────────────
  2012.  
  2013.         This function controls whether PMM should show the class name of a
  2014.         window in a message.  This is useful for identifying some windows
  2015.         that do not have text.  Square brackets denote optional items.  The
  2016.         class name is shown in this format:
  2017.  
  2018.            (ClassName)[t][u]
  2019.  
  2020.         where:
  2021.  
  2022.         - 'ClassName' is the name of the class.  The following literals are
  2023.           used to identify standard PM classes:
  2024.  
  2025.              Frame
  2026.              ComboBox
  2027.  
  2028.  
  2029.  
  2030.                                   - 34 -
  2031.  
  2032.  
  2033.  
  2034.              Button
  2035.              Menu
  2036.              Static
  2037.              EntryField
  2038.              ListBox
  2039.              ScrollBar
  2040.              TitleBar
  2041.              MLE
  2042.              AppStat
  2043.              KbdStat
  2044.              Pecic
  2045.              DBE_KKPopUp
  2046.              SpinButton
  2047.              Container
  2048.              Slider
  2049.              ValueSet
  2050.              Notebook
  2051.         - The suffix 't' means (t)rimmed, i.e. the class name has been
  2052.           trimmed.  The maximum class name length shown is 20 characters.
  2053.         - The suffix 'u' means (u)ser.  All classes that are not in the
  2054.           above list are considered user defined, whether they are system
  2055.           defined or user defined.
  2056.  
  2057.         Function Syntax:
  2058.  
  2059.            PMMRET       pmmr;
  2060.            HPMMSESSION  hpmms;
  2061.            BOOL         bShow;
  2062.  
  2063.            bShow = TRUE;
  2064.            pmmr = PMMShowClassName( hpmms, bShow );
  2065.  
  2066.         Parameters:
  2067.  
  2068.            hpmms (HPMMSESSION) - input
  2069.               Session handle returned by a previous call to
  2070.               PMMCreateTraceSession.
  2071.  
  2072.            bShow (BOOL) - input
  2073.               Show class name indicator:
  2074.               TRUE
  2075.                  Show the class name.
  2076.               FALSE
  2077.                  Do not show the class name.
  2078.  
  2079.         Return Values:
  2080.            Success:
  2081.               PMMESuccess
  2082.            Error: one of the following:
  2083.               PMMETraceSessionNotCreated
  2084.               PMMEInvalidHandle
  2085.  
  2086.  
  2087.  
  2088.                                   - 35 -
  2089.  
  2090.  
  2091.  
  2092.         Default value at startup:
  2093.            The class name will be shown.
  2094.  
  2095.         Notes:
  2096.            You can register, for instance, a class named "ListBox".  The
  2097.            suffix 'u' is intended to resolve any ambiguity between standard
  2098.            PM classes and user defined classes.
  2099.  
  2100.  
  2101.         PMMShowWindowID
  2102.         ───────────────
  2103.  
  2104.         This function controls whether PMM should show the identifier (ID)
  2105.         of a window in a message.  If the window or control has a predefined
  2106.         identifier, like FID_MENU, it will be shown; otherwise the window
  2107.         identifier, a number, will be shown.  This is useful for identifying
  2108.         some windows that do not have text.
  2109.  
  2110.         Function Syntax:
  2111.  
  2112.            PMMRET       pmmr;
  2113.            HPMMSESSION  hpmms;
  2114.            BOOL         bShow;
  2115.  
  2116.            bShow = TRUE;
  2117.            pmmr = PMMShowWindowID( hpmms, bShow );
  2118.  
  2119.         Parameters:
  2120.  
  2121.            hpmms (HPMMSESSION) - input
  2122.               Session handle returned by a previous call to
  2123.               PMMCreateTraceSession.
  2124.  
  2125.            bShow (BOOL) - input
  2126.               Show window ID indicator:
  2127.               TRUE
  2128.                  Show the window ID.
  2129.               FALSE
  2130.                  Do not show the window ID.
  2131.  
  2132.         Return Values:
  2133.            Success:
  2134.               PMMESuccess
  2135.            Error: one of the following:
  2136.               PMMETraceSessionNotCreated
  2137.               PMMEInvalidHandle
  2138.  
  2139.         Default value at startup:
  2140.            The window ID will not be shown.
  2141.  
  2142.  
  2143.  
  2144.  
  2145.  
  2146.                                   - 36 -
  2147.  
  2148.  
  2149.  
  2150.         Notes:
  2151.            A window ID is always considered as a 16 bit signed number, in
  2152.            the range -32768 to 32767.
  2153.  
  2154.  
  2155.         PMMShowPointers
  2156.         ───────────────
  2157.  
  2158.         This function controls whether PMM should show the pointers and
  2159.         string handles that are used in a message.  This is useful for
  2160.         checking that pointers point to the intended objects.
  2161.  
  2162.         PMM tests all pointers and string handles used in a message, whether
  2163.         they are to be shown or not.  PMM was designed to not introduce side
  2164.         effects to an application.  All pointers involved in a message are
  2165.         tested since printing the value they point to would produce a
  2166.         protection violation.
  2167.  
  2168.         Testing a pointer means to make sure the object pointed to can be
  2169.         accessed.  For a string object, the "object size" is considered as
  2170.         "all the characters up to the '\0' (included);" for all other
  2171.         objects the object size is the size defined in PM include files.
  2172.  
  2173.         Pointer names are displayed beginning with 'p' or 'ap'.  'p' stands
  2174.         for (p)ointer, 'a' for (a)rray.  String handles begin with 'hstr'.
  2175.         A descriptive name follows the prefix.  Pointer values are shown in
  2176.         hexadecimal, string handles in decimal.
  2177.  
  2178.         A pointer or string handle is shown using the format below.  One of
  2179.         a list of items enclosed in braces appears always.  Square brackets
  2180.         denote optional items.  Vertical bars separating items indicate that
  2181.         one of the items will appear.  '->' is used as a continuation mark.
  2182.         The format is:
  2183.  
  2184.            {p | ap | hstr}DescriptiveName: [0xnnnnnnnn | NULL | 0] ->
  2185.               [(Not allocated) | (Not accessible) | (Invalid) | (Size?)] ->
  2186.               [(Out)]
  2187.  
  2188.         where:
  2189.  
  2190.         - '(Not allocated)' can be shown for any generic pointer (except
  2191.           with pointers to a DRAGINFO structure).
  2192.         - '(Not accessible)' can be shown for pointers that point to a
  2193.           DRAGINFO structure (tested with DrgAccessDraginfo).
  2194.         - '(Invalid)' can be shown for string handles.
  2195.         - '(Size?) can be shown for pointers to a string if the string size
  2196.           used in the message is zero.  In this case the pointer cannot be
  2197.           tested for accessibility.
  2198.  
  2199.         If a pointer or string handle is "invalid" for some reason, PMM
  2200.         shows its name and value, regardless of the setting of this
  2201.  
  2202.  
  2203.  
  2204.                                   - 37 -
  2205.  
  2206.  
  2207.  
  2208.         function.  This is done to inform you that the value(s) pointed to
  2209.         cannot be printed and that there is a potential problem with this
  2210.         pointer.
  2211.  
  2212.         Some message parameters are defined as output, so they are pointers
  2213.         to an object.  The parameter output value is printed on return from
  2214.         the message handler.  Failing to mention the parameter in the
  2215.         message call would produce confusion when reading the message trace,
  2216.         since the parameter would be missing.  To avoid this, PMM ignores
  2217.         the setting of this function; that is, on an output parameter the
  2218.         pointer name is always printed, possibly followed of the pointer
  2219.         value, and followed by the literal '(Out)'.  Example ('->' is used
  2220.         as a continuation mark, ellipsis indicates that some information is
  2221.         not shown):
  2222.  
  2223.         2147483839 (Container)  CM_QUERYCNRINFO  pCnrInfo: (Out)  ->
  2224.            Bytes to copy: 92  Sent
  2225.         2147483839 (Container)  CM_QUERYCNRINFO  Returns Bytes ->
  2226.            copied: 92  [CNRINFO: cb: 92 pSortRecord: NULL ...  ->
  2227.            xVertSplitbar: -1<No splitbar>]
  2228.  
  2229.         Function Syntax:
  2230.  
  2231.            PMMRET       pmmr;
  2232.            HPMMSESSION  hpmms;
  2233.            BOOL         bShow;
  2234.  
  2235.            bShow = TRUE;
  2236.            pmmr = PMMShowPointers( hpmms, bShow );
  2237.  
  2238.         Parameters:
  2239.  
  2240.            hpmms (HPMMSESSION) - input
  2241.               Session handle returned by a previous call to
  2242.               PMMCreateTraceSession.
  2243.  
  2244.            bShow (BOOL) - input
  2245.               Show pointers indicator:
  2246.               TRUE
  2247.                  Show the pointers and string handles.
  2248.               FALSE
  2249.                  Do not show the pointers and string handles.
  2250.  
  2251.         Return Values:
  2252.            Success:
  2253.               PMMESuccess
  2254.            Error: one of the following:
  2255.               PMMETraceSessionNotCreated
  2256.               PMMEInvalidHandle
  2257.  
  2258.  
  2259.  
  2260.  
  2261.  
  2262.                                   - 38 -
  2263.  
  2264.  
  2265.  
  2266.         Default value at startup:
  2267.            Pointers and string handles will not be shown.
  2268.  
  2269.         Notes:
  2270.            For purposes of this function, string handles are considered to
  2271.            be pointers, even though they are not.
  2272.  
  2273.            The following behavior, though rare, may occur:
  2274.  
  2275.            Pointers to objects and pointers inside objects are always
  2276.            tested before the message arrives at the destination window.  It
  2277.            may occur that, when sending a message, one of the parameters of
  2278.            the message is a pointer, which points to an object that has more
  2279.            pointers inside it, and so on.  All these pointers are tested
  2280.            before the final message call is done.  The destination window
  2281.            cannot modify the parameters of the message (passed by value) but
  2282.            it can modify the pointers inside objects to point to
  2283.            inaccessible objects.  After returning from a message call, PMM
  2284.            does not retest the pointers inside objects.
  2285.  
  2286.  
  2287.         PMMShowAllArrayItems
  2288.         ────────────────────
  2289.  
  2290.         This function controls whether PMM should show all the array items
  2291.         when arrays appear in messages.  By default, PMM will not show all
  2292.         array items, i.e. it will show a maximum of five array items,
  2293.         either:
  2294.  
  2295.         - the first five, if they exist, or
  2296.         - the first two and the last two, if the array has more than five
  2297.           items.
  2298.  
  2299.         If the second form is used, an ellipsis (...) is placed between the
  2300.         first two items and the last two, to indicate that there are items
  2301.         not shown.  An array item is identified by its name and by an index,
  2302.         zero based.  The index, following the "C" syntax, is enclosed
  2303.         between square brackets.
  2304.  
  2305.         Function Syntax:
  2306.  
  2307.            PMMRET       pmmr;
  2308.            HPMMSESSION  hpmms;
  2309.            BOOL         bShow;
  2310.  
  2311.            bShow = TRUE;
  2312.            pmmr = PMMShowAllArrayItems( hpmms, bShow );
  2313.  
  2314.         Parameters:
  2315.  
  2316.            hpmms (HPMMSESSION) - input
  2317.  
  2318.  
  2319.  
  2320.                                   - 39 -
  2321.  
  2322.  
  2323.  
  2324.               Session handle returned by a previous call to
  2325.               PMMCreateTraceSession.
  2326.  
  2327.            bShow (BOOL) - input
  2328.               Show all array items indicator:
  2329.               TRUE
  2330.                  Show all array items.
  2331.               FALSE
  2332.                  Do not show all array items, only some.
  2333.  
  2334.         Return Values:
  2335.            Success:
  2336.               PMMESuccess
  2337.            Error: one of the following:
  2338.               PMMETraceSessionNotCreated
  2339.               PMMEInvalidHandle
  2340.  
  2341.         Default value at startup:
  2342.            Not all array items will be shown, only some.
  2343.  
  2344.  
  2345.         PMMShowAllLinkedListItems
  2346.         ─────────────────────────
  2347.  
  2348.         This function controls whether PMM should show all the linked list
  2349.         items when linked lists appear in messages.  By default, PMM will
  2350.         not show all linked list items, i.e. it will show a maximum of five
  2351.         linked list items, either:
  2352.  
  2353.         - the first five, if they exist, or
  2354.         - the first two and the last two, if the linked list has more than
  2355.           five items.
  2356.  
  2357.         If the second form is used, an ellipsis (...) is placed between
  2358.         the first two items and the last two, to indicate that there are
  2359.         items not shown.  A linked list item is identified by its name and
  2360.         by an index, zero based.  The index is enclosed between forward
  2361.         slashes.
  2362.  
  2363.         Function Syntax:
  2364.  
  2365.            PMMRET       pmmr;
  2366.            HPMMSESSION  hpmms;
  2367.            BOOL         bShow;
  2368.  
  2369.            bShow = TRUE;
  2370.            pmmr = PMMShowAllLinkedListItems( hpmms, bShow );
  2371.  
  2372.         Parameters:
  2373.  
  2374.            hpmms (HPMMSESSION) - input
  2375.  
  2376.  
  2377.  
  2378.                                   - 40 -
  2379.  
  2380.  
  2381.  
  2382.               Session handle returned by a previous call to
  2383.               PMMCreateTraceSession.
  2384.  
  2385.            bShow (BOOL) - input
  2386.               Show all linked list items indicator:
  2387.               TRUE
  2388.                  Show all linked list items.
  2389.               FALSE
  2390.                  Do not show all linked list items, only some.
  2391.  
  2392.         Return Values:
  2393.            Success:
  2394.               PMMESuccess
  2395.            Error: one of the following:
  2396.               PMMETraceSessionNotCreated
  2397.               PMMEInvalidHandle
  2398.  
  2399.         Default value at startup:
  2400.            Not all linked list items will be shown, only some.
  2401.  
  2402.  
  2403.         PMMShowFullMsgInfo
  2404.         ──────────────────
  2405.  
  2406.         Sometimes, in order to show the maximum information for the
  2407.         messages being traced, PMM needs to send a message to a window.
  2408.         Such a message wouldn't have been sent if the application were not
  2409.         using PMM, i.e. the message does not belong to the "normal"
  2410.         application message stream.  For instance, to interpret the return
  2411.         value of a VM_QUERYITEM message, PMM needs to know the VIA_*
  2412.         attribute of the value set.  A VM_QUERYITEMATTR is sent to the
  2413.         value set.  This guarantees that the message is properly interpreted
  2414.         and gives the maximum information for a message.
  2415.  
  2416.         To obtain a "clean" message stream, or if you are experiencing any
  2417.         trouble with messages, you can turn off this option.
  2418.  
  2419.         This option is on by default because, for most applications, the
  2420.         setting has not proved to cause undesirable effects.
  2421.  
  2422.         The following messages, which are considered internal, are sent by
  2423.         PMM to an application:
  2424.  
  2425.            WM_QUERYWINDOWPARAMS
  2426.            CM_QUERYCNRINFO
  2427.            MM_QUERYITEM
  2428.            VM_QUERYITEMATTR
  2429.  
  2430.         You can always see when the above messages are sent by turning on
  2431.         the option to show internal messages (See PMMShowInternalMessages).
  2432.  
  2433.  
  2434.  
  2435.  
  2436.                                   - 41 -
  2437.  
  2438.  
  2439.  
  2440.         Function Syntax:
  2441.  
  2442.            PMMRET       pmmr;
  2443.            HPMMSESSION  hpmms;
  2444.            BOOL         bShow;
  2445.  
  2446.            bShow = TRUE;
  2447.            pmmr = PMMShowFullMsgInfo( hpmms, bShow );
  2448.  
  2449.         Parameters:
  2450.  
  2451.            hpmms (HPMMSESSION) - input
  2452.               Session handle returned by a previous call to
  2453.               PMMCreateTraceSession.
  2454.  
  2455.            bShow (BOOL) - input
  2456.               Show full message information indicator:
  2457.               TRUE
  2458.                  Show full information for messages being traced.
  2459.               FALSE
  2460.                  Do not show full information for messages being traced.
  2461.  
  2462.         Return Values:
  2463.            Success:
  2464.               PMMESuccess
  2465.            Error: one of the following:
  2466.               PMMETraceSessionNotCreated
  2467.               PMMEInvalidHandle
  2468.  
  2469.         Default value at startup:
  2470.            Full message information will be shown.
  2471.  
  2472.         Notes:
  2473.            See PMMShowWindowText and PMMShowInternalMessages.
  2474.  
  2475.  
  2476.         PMMShowInternalMessages
  2477.         ───────────────────────
  2478.  
  2479.         PMM sends messages to windows to query the window text, and to get
  2480.         some information to fully interpret a message.  These messages are
  2481.         called "internal", since they do not belong to the application
  2482.         message stream.  This function controls whether PMM should show
  2483.         these messages in the trace file.  PMM may send the following
  2484.         messages to an application:
  2485.  
  2486.            WM_QUERYWINDOWPARAMS
  2487.            CM_QUERYCNRINFO
  2488.            MM_QUERYITEM
  2489.            VM_QUERYITEMATTR
  2490.  
  2491.  
  2492.  
  2493.  
  2494.                                   - 42 -
  2495.  
  2496.  
  2497.  
  2498.         In the trace file, an internal message is flagged with an initial
  2499.         'i' and a final comment indicating the message source. The message
  2500.         is shown above the message that has generated it (since it occurs
  2501.         before).  Also, it is shown with the same indentation that the
  2502.         message that has generated it.  Messages generated by internal
  2503.         messages, also considered internal, are indented as usual, one level
  2504.         to the right.  An example follows (the '->' means that the next line
  2505.         is to be interpreted as part of the current one):
  2506.  
  2507.         ...
  2508.         i 2147483922 (Frame) 1  WM_QUERYWINDOWPARAMS  [WNDPARAMS: ->
  2509.            fsStatus: WPM_TEXT WPM_CCHTEXT cchText: 22 pszText: ->
  2510.            0x006e000c (Out)]  Sent by PMM
  2511.           i 2147483923 (TitleBar) FID_TITLEBAR  WM_QUERYWINDOWPARAMS  ->
  2512.              [WNDPARAMS: fsStatus: WPM_TEXT WPM_CCHTEXT cchText: 22 ->
  2513.              pszText: 0x006e000c (Out)]  Sent int.
  2514.           i 2147483923 (TitleBar) FID_TITLEBAR  WM_QUERYWINDOWPARAMS  ->
  2515.              Returns: Success  [WNDPARAMS: fsStatus: WPM_TEXT WPM_CCHTEXT ->
  2516.              cchText: 5 Text: "Style"]i
  2517.         i 2147483922 (Frame) 1  WM_QUERYWINDOWPARAMS  Returns: ->
  2518.            Success  [WNDPARAMS: fsStatus: WPM_TEXT WPM_CCHTEXT cchText: 5 ->
  2519.            Text: "Style"]i
  2520.         (Below is the message return that has generated the above lines)
  2521.         2147483922 "Style" (Frame) 1  WM_SETWINDOWPARAMS  ->
  2522.            Returns: Success
  2523.         ...
  2524.  
  2525.         In most cases you will not be interested in seeing internal
  2526.         messages.  However, this function is useful to:
  2527.  
  2528.         - see when internal messages are sent and why.  In the previous
  2529.           example, on returning from a WM_SETWINDOWPARAMS call, PMM must
  2530.           query the window text since it has (possibly) changed.
  2531.         - identify some (rare) cases when sending an internal message
  2532.           produces an exception, because the destination window is
  2533.           unprepared to respond to the message at that time.  If this
  2534.           situation arises, depending on the message, you should turn off
  2535.           the appropriate option: PMMShowWindowText or PMMShowFullMsgInfo.
  2536.  
  2537.         Function Syntax:
  2538.  
  2539.            PMMRET       pmmr;
  2540.            HPMMSESSION  hpmms;
  2541.            BOOL         bShow;
  2542.  
  2543.            bShow = TRUE;
  2544.            pmmr = PMMShowInternalMessages( hpmms, bShow );
  2545.  
  2546.         Parameters:
  2547.  
  2548.            hpmms (HPMMSESSION) - input
  2549.  
  2550.  
  2551.  
  2552.                                   - 43 -
  2553.  
  2554.  
  2555.  
  2556.               Session handle returned by a previous call to
  2557.               PMMCreateTraceSession.
  2558.  
  2559.            bShow (BOOL) - input
  2560.               Show internal messages indicator:
  2561.               TRUE
  2562.                  Show internal messages.
  2563.               FALSE
  2564.                  Do not show internal messages.
  2565.  
  2566.         Return Values:
  2567.            Success:
  2568.               PMMESuccess
  2569.            Error: one of the following:
  2570.               PMMETraceSessionNotCreated
  2571.               PMMEInvalidHandle
  2572.  
  2573.         Default value at startup:
  2574.            Internal messages will not be shown.
  2575.  
  2576.         Notes:
  2577.            See PMMShowWindowText.
  2578.  
  2579.  
  2580.         PMMDefineStartStopTracingKeys
  2581.         ─────────────────────────────
  2582.  
  2583.         You can start and stop tracing at any time and at any point in your
  2584.         application by using the keyboard.  PMM uses a key to start tracing,
  2585.         and another key to stop tracing.  These keys are, by default, F11 to
  2586.         start tracing and F12 to stop tracing, since they are rarely used by
  2587.         applications.  If your application does use F11 or F12, you can use
  2588.         this function to define other keys to start and/or stop tracing.
  2589.         You can define the start key only, the stop key only, or both keys
  2590.         at the same time.
  2591.  
  2592.         Function Syntax:
  2593.  
  2594.            ('->' is used as a continuation mark).
  2595.  
  2596.            PMMRET       pmmr;
  2597.            HPMMSESSION  hpmms;
  2598.            USHORT       usStartKey;
  2599.            USHORT       usStopKey;
  2600.  
  2601.            pmmr = PMMDefineStartStopTracingKeys( hpmms, usStartKey, ->
  2602.               usStopKey );
  2603.  
  2604.         Parameters:
  2605.  
  2606.            hpmms (HPMMSESSION) - input
  2607.  
  2608.  
  2609.  
  2610.                                   - 44 -
  2611.  
  2612.  
  2613.  
  2614.               Session handle returned by a previous call to
  2615.               PMMCreateTraceSession.
  2616.  
  2617.            usStartKey (USHORT) - input
  2618.               Key to start tracing.  One of the following constants:
  2619.                  VK_F2
  2620.                  VK_F3
  2621.                  VK_F4
  2622.                  VK_F5
  2623.                  VK_F6
  2624.                  VK_F7
  2625.                  VK_F8
  2626.                  VK_F9
  2627.                  VK_F11
  2628.                  VK_F12
  2629.               as defined by Presentation Manager.
  2630.               Pass a 0 (zero) to leave this key unchanged.
  2631.  
  2632.            usStopKey (USHORT) - input
  2633.               Key to stop tracing.  Use the same constants as defined in the
  2634.               usStartKey parameter.
  2635.               Pass a 0 (zero) to leave this key unchanged.
  2636.  
  2637.         Return Values:
  2638.            Success:
  2639.               PMMESuccess
  2640.            Error: one of the following:
  2641.               PMMETraceSessionNotCreated
  2642.               PMMEInvalidHandle
  2643.               PMMEKeyNotDefinable
  2644.               PMMEKeysCannotBeTheSame
  2645.               PMMEKeyAlreadyDefined
  2646.  
  2647.         Default value at startup:
  2648.            The key to start tracing is F11.  The key to stop tracing is F12.
  2649.  
  2650.         Notes:
  2651.            See PMMStartTracing and PMMStopTracing.
  2652.            F1 and F10 are not allowed since they are defined by the system.
  2653.  
  2654.  
  2655.         PMMQueryIfIgnoreMsg
  2656.         ───────────────────
  2657.  
  2658.         PMM introduces some messages in an application message stream.
  2659.         Messages are introduced as a result of:
  2660.  
  2661.         - creating some internal windows
  2662.         - querying the window text and other attributes of a window
  2663.         - re-sending some messages to a window pertaining to another
  2664.           process.
  2665.  
  2666.  
  2667.  
  2668.                                   - 45 -
  2669.  
  2670.  
  2671.  
  2672.         These messages do not belong to the application message stream and
  2673.         should be ignored.
  2674.  
  2675.         If you are using hooks of type HK_SENDMSG, you must use this
  2676.         function in your hook handler to determine which messages belong in
  2677.         the data stream you are watching.  This will protect your code from
  2678.         receiving messages that your application doesn't generate.  Only
  2679.         this type of hook needs to be protected.
  2680.  
  2681.         Function Syntax:
  2682.  
  2683.            PMMRET       pmmr;
  2684.            HPMMSESSION  hpmms;
  2685.            BOOL         bIgnore;
  2686.  
  2687.            pmmr = PMMQueryIfIgnoreMsg( hpmms, &bIgnore );
  2688.  
  2689.         Parameters:
  2690.  
  2691.            hpmms (HPMMSESSION) - input
  2692.               Session handle returned by a previous call to
  2693.               PMMCreateTraceSession.
  2694.  
  2695.            bIgnore (PBOOL) - output
  2696.               Indicates if the application should ignore the message
  2697.               received in the hook.
  2698.  
  2699.         Return Values:
  2700.            Success:
  2701.               PMMESuccess
  2702.            Error: one of the following:
  2703.               PMMETraceSessionNotCreated
  2704.               PMMEInvalidHandle
  2705.  
  2706.         Notes:
  2707.            If you use this function, you need to use also the function
  2708.            PMMSMHQueryMsg.
  2709.  
  2710.            PMM uses queue hooks only, not system hooks.  You cannot use PMM
  2711.            together with software that uses hooks (or you suspect that it
  2712.            uses hooks) if you do not have access to the source code.  If you
  2713.            use PMM with such software, the results are unpredictable.
  2714.  
  2715.         Example:
  2716.            See the example in the function PMMSMHQueryMsg.
  2717.  
  2718.  
  2719.         PMMSMHQueryMsg
  2720.         ──────────────
  2721.  
  2722.         In order to interpret all messages correctly PMM must alter
  2723.  
  2724.  
  2725.  
  2726.                                   - 46 -
  2727.  
  2728.  
  2729.  
  2730.         temporarily the messages sent by your application to windows of
  2731.         another process.  This is by design.  If you are using hooks of type
  2732.         HK_SENDMSG you must use this function in your hook handler to
  2733.         determine whether PMM has changed the message you have just
  2734.         received.  Any other type of hook does not need this function.
  2735.         If the message has been changed, this function tells you the message
  2736.         that you should process, as it was before PMM changed it.
  2737.  
  2738.         Function Syntax:
  2739.  
  2740.            PMMRET       pmmr;
  2741.            HPMMSESSION  hpmms;
  2742.            PBOOL        pbChanged;
  2743.            PSMHSTRUCT   psmh;
  2744.            BOOL         bChanged;
  2745.            SMHSTRUCT    smh;
  2746.  
  2747.            pbChanged = &bChanged;
  2748.            psmh = &smh;
  2749.            pmmr = PMMSMHQueryMsg( hpmms, pbChanged, psmh );
  2750.  
  2751.         Parameters:
  2752.  
  2753.            hpmms (HPMMSESSION) - input
  2754.               Session handle returned by a previous call to
  2755.               PMMCreateTraceSession.
  2756.  
  2757.            pbChanged (PBOOL) - output
  2758.               Indicates if the message has been changed by PMM.  If the
  2759.               message has not been changed, the structure pointed to by the
  2760.               psmh parameter is not altered.
  2761.  
  2762.            psmh (PSMHSTRUCT) - output
  2763.               If the message has been changed by PMM, this structure
  2764.               contains the original values received in the send message
  2765.               hook, i.e. the values that an application should process.
  2766.  
  2767.         Return Values:
  2768.            Success:
  2769.               PMMESuccess
  2770.            Error: one of the following:
  2771.               PMMETraceSessionNotCreated
  2772.               PMMEInvalidHandle
  2773.               PMMEInvalidPointer
  2774.  
  2775.         Notes:
  2776.            Don't pass the same pointer that you have received as the second
  2777.            parameter in the hook (psmh in the example) to this function.
  2778.            This would produce an error and the structure SMHSTRUCT would not
  2779.            be updated, since this would lead to an erroneous message trace.
  2780.            Don't modify any of the values pointed to by the psmh pointer.
  2781.  
  2782.  
  2783.  
  2784.                                   - 47 -
  2785.  
  2786.  
  2787.  
  2788.            This would produce an erroneous message trace. See
  2789.            PMMQueryIfIgnoreMsg.
  2790.  
  2791.         Example:
  2792.  
  2793.            VOID EXPENTRY MySendMsgHook(   HAB hab
  2794.                                         , PSMHSTRUCT psmh
  2795.                                         , BOOL fInterTask )
  2796.            {
  2797.               PMMRET     pmmr;
  2798.               BOOL       bIgnore;
  2799.               BOOL       bChanged;
  2800.               SMHSTRUCT  rSMH;
  2801.  
  2802.               // Let's assume that hpmms is a global variable
  2803.               // defined elsewhere in the application
  2804.               pmmr = PMMQueryIfIgnoreMsg( hpmms, &bIgnore );
  2805.               if ( pmmr == PMMESuccess )
  2806.               {
  2807.                  // The trace session has been created,
  2808.                  // check whether we should ignore the message
  2809.                  if ( bIgnore )
  2810.                     return;
  2811.  
  2812.                  pmmr = PMMSMHQueryMsg( hpmms, &bChanged, &rSMH );
  2813.                  if ( bChanged )
  2814.                  {
  2815.                     // Changed, so we use the values in
  2816.                     // the rSMH structure
  2817.                     psmh = &rSMH;
  2818.                  }
  2819.               }
  2820.               else
  2821.               {
  2822.                  // The trace session hasn't been created,
  2823.                  // so the message couldn't have been altered.
  2824.                  // Nothing to do here
  2825.               }
  2826.  
  2827.               // From now on, psmh points to the correct message that
  2828.               // we should process
  2829.               // Normal code here
  2830.  
  2831.            } //end MySendMsgHook
  2832.  
  2833.  
  2834.         PMMSubclassWindow
  2835.         ─────────────────
  2836.  
  2837.         This function behaves almost exactly as the PM WinSubclassWindow
  2838.         function.  Note that the PMM include file PMM.H redefines
  2839.  
  2840.  
  2841.  
  2842.                                   - 48 -
  2843.  
  2844.  
  2845.  
  2846.         WinSubclassWindow as PMMSubclassWindow, so an application will use
  2847.         this function instead of WinSubclassWindow.  This function calls
  2848.         WinSubclassWindow using the same parameters being passed to it and
  2849.         returns the same value as returned by WinSubclassWindow.  Before
  2850.         returning, if a PMM trace session exists, it notifies PMM that a new
  2851.         subclassing has been made, so as to keep track immediately of a new
  2852.         window procedure.
  2853.  
  2854.         See the section "Subclassing Windows when Using PMM," above.
  2855.  
  2856.         Function Syntax:
  2857.  
  2858.            HWND   hwnd;
  2859.            PFNWP  pNewWindowProc;
  2860.            PFNWP  pOldWindowProc;
  2861.  
  2862.            pOldWindowProc = PMMSubclassWindow( hwnd, pNewWindowProc );
  2863.  
  2864.         Parameters:
  2865.  
  2866.            hwnd (HWND) - input
  2867.               Handle of window that is being subclassed.
  2868.  
  2869.            pNewWindowProc (PFNWP) - input
  2870.               New window procedure.
  2871.  
  2872.         Return Values:
  2873.  
  2874.            pOldWindowProc (PFNWP) - return
  2875.               Old window procedure.  Previous window procedure belonging
  2876.               to hwnd.
  2877.  
  2878.               If this function fails, 0L is returned.
  2879.  
  2880.  
  2881.         PMMSetWindowPtr
  2882.         ───────────────
  2883.  
  2884.         This function behaves almost exactly as the PM WinSetWindowPtr
  2885.         function.  Note that the PMM include file PMM.H redefines
  2886.         WinSetWindowPtr as PMMSetWindowPtr, so an application will use this
  2887.         function instead of WinSetWindowPtr.  This function calls
  2888.         WinSetWindowPtr using the same parameters being passed to it and
  2889.         returns the same value as returned by WinSetWindowPtr.  Before
  2890.         returning, if a PMM trace session exists and the lb parameter is
  2891.         QWP_PFNWP, it notifies PMM that a new subclassing has been made, so
  2892.         as to keep track immediately of a new window procedure.
  2893.  
  2894.         See the section "Subclassing Windows when Using PMM."
  2895.  
  2896.  
  2897.  
  2898.  
  2899.  
  2900.                                   - 49 -
  2901.  
  2902.  
  2903.  
  2904.         Function Syntax:
  2905.  
  2906.            HWND   hwnd;
  2907.            LONG   lb;
  2908.            PVOID  pp;
  2909.            BOOL   fSuccess;
  2910.  
  2911.            fSuccess = PMMSetWindowPtr( hwnd, lb, pp );
  2912.  
  2913.         Parameters:
  2914.  
  2915.            hwnd (HWND) - input
  2916.               Window handle.
  2917.  
  2918.            lb (LONG) - input
  2919.               Zero-based index into the window words.  The units of b are
  2920.               bytes.  Valid values are zero through (cbWindowData - 4),
  2921.               where cbWindowData is the parameter in WinRegisterClass that
  2922.               specifies the number of bytes available for
  2923.               application-defined storage.
  2924.  
  2925.               The value QWP_PFNWP can be used as the index for the address
  2926.               of the window procedure for the window.
  2927.  
  2928.            pp (PVOID) - input
  2929.               Pointer value to store in the window words.
  2930.  
  2931.         Return Values:
  2932.  
  2933.            fSuccess (BOOL) - return
  2934.               Success indicator:
  2935.               TRUE
  2936.                  Successful completion
  2937.               FALSE
  2938.                  Error occurred.
  2939.  
  2940.  
  2941.         PMMQueryWindowPtr
  2942.         ─────────────────
  2943.  
  2944.         This function is included for completeness and for future expansion
  2945.         of PMM.  It behaves exactly as the PM WinQueryWindowPtr function.
  2946.         Note that the PMM include file PMM.H redefines WinQueryWindowPtr as
  2947.         PMMQueryWindowPtr, so an application will use this function instead
  2948.         of WinQueryWindowPtr.
  2949.  
  2950.         See the section "Subclassing Windows when Using PMM."
  2951.  
  2952.         Function Syntax:
  2953.  
  2954.            HWND   hwnd;
  2955.  
  2956.  
  2957.  
  2958.                                   - 50 -
  2959.  
  2960.  
  2961.  
  2962.            LONG   index;
  2963.            PVOID  pp;
  2964.  
  2965.            pp = PMMQueryWindowPtr( hwnd, index );
  2966.  
  2967.         Parameters:
  2968.  
  2969.            hwnd (HWND) - input
  2970.               Window handle which has the pointer to retrieve.
  2971.  
  2972.            index (LONG) - input
  2973.               Index.  Zero-based index of the pointer value to retrieve.
  2974.               The units of index are bytes.  Valid values are zero through
  2975.               (cbWindowData - 4), where cbWindowData is the parameter in
  2976.               WinRegisterClass that specifies the number of bytes available
  2977.               for application-defined storage.
  2978.  
  2979.               The value QWP_PFNWP can be used for the address of the
  2980.               window's window procedure.
  2981.  
  2982.         Return Values:
  2983.  
  2984.            pp (PVOID) - return
  2985.               Pointer value.
  2986.               NULL
  2987.                  Error occurred.
  2988.               Other
  2989.                  Pointer value.
  2990.  
  2991.  
  2992.         List of Errors and Warnings
  2993.         ═══════════════════════════
  2994.  
  2995.  
  2996.         Errors Returned by Functions
  2997.         ────────────────────────────
  2998.  
  2999.         PMMESuccess
  3000.            The function has completed sucessfully.
  3001.         PMMECannotQueryOS2Version
  3002.            The current OS/2 version cannot be obtained.  PMM currently
  3003.            supports the OS/2 versions 2.1, 3.0 and 4.0.
  3004.         PMMECannotRunInThisOS2Version
  3005.            Your OS/2 version isn't 2.1, 3.0 or 4.0.  PMM cannot run in any
  3006.            other version.
  3007.         PMMEMultipleSessionsNotAllowed
  3008.            An application has attempted to create more than one PMM trace
  3009.            session.  This functionality is not supported.
  3010.         PMMECannotQueryDesktopWindow
  3011.            PMM has tried to query the desktop window handle and the function
  3012.            has failed.
  3013.  
  3014.  
  3015.  
  3016.  
  3017.                                   - 51 -
  3018.  
  3019.  
  3020.  
  3021.         PMMECannotQueryObjectWindow
  3022.            PMM has tried to query the desktop object window handle and the
  3023.            function has failed.
  3024.         PMMENotEnoughMemory
  3025.            A request to allocate memory has failed.
  3026.         PMMECannotRegisterInternalClass
  3027.            PMM uses a window, whose class is "PMMWorkingWindow", to perform
  3028.            most of its functions.  The class couldn't be registered.
  3029.         PMMECannotCreateInternalWindow
  3030.            PMM uses a window to perform most of its functions. The window
  3031.            couldn't be created.
  3032.         PMMECannotSetSendMsgHook
  3033.            PMM uses a queue hook to intercept messages sent by the
  3034.            WinSendMsg function.  The hook couldn't be set.
  3035.         PMMECannotSetInputMsgHook
  3036.            PMM uses a queue hook to intercept messages that are being posted
  3037.            to an application queue.  The hook couldn't be set.
  3038.         PMMECannotOpenTraceFile
  3039.            The trace file couldn't be opened.
  3040.         PMMEWriteFailed
  3041.            Writing to the trace file has failed.  A common error is that the
  3042.            disk is full.
  3043.         PMMECannotCloseTraceFile
  3044.            The trace file couldn't be closed.
  3045.         PMMETraceSessionNotCreated
  3046.            No trace session has been created.
  3047.         PMMEInvalidHandle
  3048.            An invalid trace session handle has been passed to a function.
  3049.         PMMEAlreadyTracing
  3050.            The application attempted to start tracing and PMM was already
  3051.            tracing.
  3052.         PMMENotTracingNow
  3053.            The application attempted to stop tracing and PMM was not
  3054.            tracing.
  3055.         PMMECannotReleaseInputMsgHook
  3056.            PMM uses a queue hook to intercept messages that are being posted
  3057.            to an application queue.  The hook couldn't be released.
  3058.         PMMECannotReleaseSendMsgHook
  3059.            PMM uses a queue hook to intercept messages sent by the
  3060.            WinSendMsg function.  The hook couldn't be released.
  3061.         PMMECannotDestroyInternalWindow
  3062.            PMM uses a window to perform most of its functions.  The window
  3063.            couldn't be destroyed.
  3064.         PMMEKeyNotDefinable
  3065.            The application attempted to define a key that isn't definable.
  3066.            See the definable keys in the function
  3067.            PMMDefineStartStopTracingKeys.
  3068.         PMMEKeysCannotBeTheSame
  3069.            The application attempted to define the same key to start and
  3070.            stop tracing.
  3071.  
  3072.  
  3073.  
  3074.                                   - 52 -
  3075.  
  3076.  
  3077.  
  3078.         PMMEKeyAlreadyDefined
  3079.            The application attempted to define a key to start/stop tracing
  3080.            and this key was already defined.
  3081.         PMMEInvalidPointer
  3082.            The application is using a send message hook and has invoked the
  3083.            function PMMSMHQueryMsg passing to it the pointer to a SMHSTRUCT
  3084.            object that has received as the second parameter in the send
  3085.            message hook function. This is not allowed.  See the notes in the
  3086.            function PMMSMHQueryMsg.
  3087.  
  3088.  
  3089.         Errors Occurring when Using PMM
  3090.         ───────────────────────────────
  3091.  
  3092.         These errors may occur at any time when running an application and
  3093.         using PMM.  All are critical, that is, PMM will write a message in
  3094.         the trace file (if possible), will stop tracing and will destroy the
  3095.         current trace session.
  3096.  
  3097.         PMMECritWriteFailed
  3098.  
  3099.            Error text:
  3100.  
  3101.            "PMM: Error 1001: Writing to disk failed. Cannot continue
  3102.            tracing"
  3103.  
  3104.            Writing to the trace file has failed.  Since that the basic
  3105.            function of PMM is to trace messages and write them to disk,
  3106.            PMM cannot continue.
  3107.  
  3108.         PMMECritNotEnoughMemory
  3109.  
  3110.            Error text:
  3111.  
  3112.            "PMM: Error 1002: Not enough memory. Cannot continue tracing"
  3113.  
  3114.            PMM allocates memory while running, if necessary.  The memory
  3115.            couldn't be allocated, so PMM cannot continue.
  3116.  
  3117.         PMMECritCannotSubclassWindow
  3118.  
  3119.            Error text:
  3120.  
  3121.            "PMM: Error 1003: Cannot subclass a window. Cannot continue
  3122.            tracing"
  3123.  
  3124.            PMM subclasses windows as needed to keep track of all messages
  3125.            occurring in an application.  There is a limit to the number of
  3126.            times that an application can subclass a window (see PMM limits).
  3127.            This message indicates that this limit has been reached.
  3128.  
  3129.  
  3130.  
  3131.  
  3132.                                   - 53 -
  3133.  
  3134.  
  3135.  
  3136.         PMMECritTooManyNestedMsgCalls
  3137.  
  3138.            Error text:
  3139.  
  3140.            "PMM: Error 1004: Too many nested message calls. Cannot continue
  3141.            tracing"
  3142.  
  3143.            PMM maintains an internal structure to keep track of all messages
  3144.            occurring in an application.  There is a limit to the number of
  3145.            messages that this structure can hold (see PMM limits).  This
  3146.            limit should be sufficient for virtually every application;
  3147.            however, an (erroneous) infinite recursion procedure could lead
  3148.            to this error.
  3149.  
  3150.  
  3151.         Warnings Occurring when Using PMM
  3152.         ─────────────────────────────────
  3153.  
  3154.         These warnings do not prevent PMM to continuing to do its functions.
  3155.         They are reported to the user by writing a message to the trace
  3156.         file.
  3157.  
  3158.         PMMWInvalidWindow
  3159.  
  3160.             Warning text:
  3161.  
  3162.             "PMM: Warning 5001: A message has been sent through a
  3163.             pointer to an invalid window. Address called: a.
  3164.             Message: hwnd: h msg: m mp1: mp1 mp2: mp2.
  3165.             The message will be ignored"
  3166.  
  3167.             This indicates that the application sent a message to a window
  3168.             using a pointer, which is supposed to point to a window
  3169.             procedure of the window, and the window doesn't exist. This is
  3170.             probably an application error.
  3171.  
  3172.         PMMWInvalidWindowProc
  3173.  
  3174.             Warning text:
  3175.  
  3176.             "PMM: Warning 5002: A message has been sent through a
  3177.             pointer using an address that is not a window procedure
  3178.             address of the window w. Address called: a.
  3179.             Message: hwnd: h msg: m mp1: mp1 mp2: mp2.
  3180.             The message will be ignored"
  3181.  
  3182.             PMM has intercepted a call to a window procedure that doesn't
  3183.             belong to the actual window procedures of the window being
  3184.             passed in the call.  The message cannot perform its intended
  3185.             function.  This is probably an application error.
  3186.  
  3187.  
  3188.  
  3189.  
  3190.                                   - 54 -
  3191.  
  3192.  
  3193.  
  3194.         7. PMM Message Trace Format
  3195.         ═══════════════════════════
  3196.  
  3197.  
  3198.         The following diagrams use the "railroad" syntax.  The following
  3199.         points show how to read them:
  3200.  
  3201.         - Read the format diagrams from left to right, from top to bottom,
  3202.           following the path of the line.
  3203.  
  3204.           The ── symbol indicates the beginning of the information being
  3205.           described.
  3206.  
  3207.           The ── symbol indicates that the information is continued on the
  3208.           next line.
  3209.  
  3210.           The ── symbol indicates that the information is continued from
  3211.           the previous line.
  3212.  
  3213.           The ── symbol indicates the end of the information.
  3214.  
  3215.  
  3216.         In the following diagrams an item represents a part of the
  3217.         information that PMM shows.
  3218.  
  3219.         - Items that always appear are shown on the horizontal line (the
  3220.           main path).
  3221.  
  3222.           ─────────────hWnd────────────────────────────────────
  3223.  
  3224.         - Optional items appear below the main path.
  3225.  
  3226.           ─────────────┬───────────┬───────────────────────────
  3227.                          └─ WindowId─┘
  3228.  
  3229.         - If PMM shows you an item, choosing from a set of two or more
  3230.           items, the set of items appears vertically, in a stack.
  3231.  
  3232.           If one of the items is always shown, one item in the stack appears
  3233.           on the main path.
  3234.  
  3235.           ──────────────┬─  Sent─────────────────┬──────────────
  3236.                          ├─  Dispatched───────────┤
  3237.                          └─  Posted to queue──────┘
  3238.  
  3239.           If showing one of the items is optional, the entire stack appears
  3240.           below the main path.
  3241.  
  3242.           ──────────────┬─────────┬─────────────────────────────
  3243.                          ├─ by PMM─┤
  3244.                          └─ int. ──┘
  3245.  
  3246.  
  3247.  
  3248.                                   - 55 -
  3249.  
  3250.  
  3251.  
  3252.           The item that is the default appears above the main path.
  3253.  
  3254.                          ┌─ "WindowText"─┐
  3255.           ─────────────┴───────────────┴───────────────────────
  3256.  
  3257.         - An arrow returning to the left above the main line indicates an
  3258.           item that can be repeated.
  3259.  
  3260.                          ┌─ Item: ItemValue─┐
  3261.           ────────────────────────────────┴────────────────────
  3262.  
  3263.  
  3264.  
  3265.         This is the format of a message as shown by PMM:
  3266.  
  3267.  
  3268.         Message Call:
  3269.         ─────────────
  3270.  
  3271.                                    ┌─ "WindowText"─┬───┬─┬───┬─┐
  3272.                                    │               └─a─┘ └─t─┘ │
  3273.         ──Indent.──┬────┬──hWnd──┴───────────────────────────┴──
  3274.                      └─i ─┘
  3275.  
  3276.             ┌─ (ClassName)──┬───┬─┬───┬─┐
  3277.             │               └─t─┘ └─u─┘ │
  3278.         ───┴───────────────────────────┴──┬─────┬─┬───────────┬──
  3279.                                            └─ O.─┘ └─ WindowId─┘
  3280.  
  3281.         ───  MessageName────┬──────────┬───┬──────────┬──────────
  3282.                              └─  Param1─┘   └─  Param2─┘
  3283.  
  3284.         ───┬─  Sent───┬─────────┬─────┬─────────┬─────────┬─────
  3285.             │          ├─ by PMM─┤     └─  It: n─┘         │
  3286.             │          └─ int. ──┘                         │
  3287.             ├─  Dispatched─────────────┬───────────────────┤
  3288.             │                          └─  fs: PM_NOREMOVE─┤
  3289.             └─  Posted to queue────────────────────────────┘
  3290.  
  3291.  
  3292.         Message Return:
  3293.         ───────────────
  3294.  
  3295.                                    ┌─ "WindowText"─┬───┬─┬───┬─┐
  3296.                                    │               └─a─┘ └─t─┘ │
  3297.         ──Indent.──┬────┬──hWnd─────────────────────────────┴──
  3298.                      └─i ─┘
  3299.  
  3300.  
  3301.  
  3302.  
  3303.  
  3304.  
  3305.  
  3306.                                   - 56 -
  3307.  
  3308.  
  3309.  
  3310.             ┌─ (ClassName)──┬───┬─┬───┬─┐
  3311.             │               └─t─┘ └─u─┘ │
  3312.         ──────────────────────────────┴──┬─────┬─┬───────────┬──
  3313.                                            └─ O.─┘ └─ WindowId─┘
  3314.  
  3315.                                            ┌─ Item: ItemValue─┐
  3316.         ───  MessageName────  Returns───────────────────────┼───
  3317.                                            └───: RetValue─────┘
  3318.  
  3319.         ─────┬─────────────┬───┬─────────────┬──────────────────
  3320.               └─  OutParam1─┘   └─  OutParam2─┘
  3321.  
  3322.  
  3323.         where:
  3324.  
  3325.         - 'Indent.' is the indentation showing the call and return nesting
  3326.           of messages.
  3327.         - 'i' means that this is an internal message.
  3328.         - 'hWnd' is the destination window handle of a message.
  3329.         - 'WindowText' is the window text of the destination window.  If
  3330.           the window doesn't have text or the text is a zero length string,
  3331.           the quotes are not shown.
  3332.         - 'a' means that the text has been altered.
  3333.         - 't' means that the text has been trimmed.
  3334.         - 'ClassName' is the class name of the destination window.
  3335.         - 'u' means that this is an user class.
  3336.         - 'O.' means that this is an object window.
  3337.         - 'WindowId' is the window identifier.
  3338.         - 'MessageName' is the name of the message.
  3339.         - 'Param1' is the first parameter of a message.  All values and
  3340.           objects being passed in the first parameter of a message are
  3341.           interpreted and displayed.
  3342.         - 'Param2' is the second parameter of a message.  All values and
  3343.           objects being passed in the second parameter of a message are
  3344.           interpreted and displayed.
  3345.         - 'Sent' means that the message has been sent (using WinSendMsg or
  3346.           using a pointer).
  3347.         - 'Dispatched' means that the message has been retrieved from the
  3348.           queue and dispatched by WinDispatchMsg.
  3349.         - 'Posted to queue' means that the message has been posted to the
  3350.           queue and the message will not be dispatched by WinDispatchMsg
  3351.           (because the window handle is NULL; or it is a WM_QUIT message;
  3352.           or the message is not being removed from the queue).
  3353.         - 'by PMM' means that the message has been sent by PMM, i.e. it is
  3354.           internal.
  3355.         - 'int.' means internally, i.e. the message has been sent from
  3356.           inside an internal message.
  3357.         - 'It: n' means intertask.  This item appears if the message has
  3358.           been sent between tasks.  If the item does not appear the message
  3359.           has been sent within a task (intratask).
  3360.         - 'fs: PM_NOREMOVE' are the message removal options received in the
  3361.  
  3362.  
  3363.  
  3364.                                   - 57 -
  3365.  
  3366.  
  3367.  
  3368.           third parameter of the input hook.  This item appears only if the
  3369.           message hasn't been removed from the queue, which is unusual.
  3370.         - 'RetValue' is the value returned by a message, given that the
  3371.           message name is clear and self-explanatory.
  3372.         - 'Item: ItemValue' is a brief description of what a message
  3373.           returns, plus the value returned.
  3374.         - 'OutParam1' is the first parameter of a message, given that it is
  3375.           an Input/Output or Output parameter.
  3376.         - 'OutParam2' is the second parameter of a message, given that it is
  3377.           an Input/Output or Output parameter.
  3378.  
  3379.  
  3380.         C structures are shown in this way:
  3381.  
  3382.             ┌───┐
  3383.         ───[─┴──StructName──┬───────┬──:───────────────────────
  3384.                                ├─[ai]──┤
  3385.                                └─/lle/─┘
  3386.  
  3387.             ┌────────────────────────────────┐   ┌───┐
  3388.         ──── VarName: VarValue─┬───────────┼────]─┴───┬───┬───
  3389.                                  └─<Meaning>─┘           └─i─┘
  3390.  
  3391.  
  3392.         where:
  3393.  
  3394.         - 'StructName' is the structure name as defined in PM include files.
  3395.         - 'ai' is the array index of the structure.  The square brackets
  3396.           around 'ai' indicate that the structure is an array item.
  3397.         - 'lle' is the ith element of a linked list of structures.  The
  3398.           slashes around 'lle' indicate that the structure is a linked
  3399.           list element.
  3400.         - 'VarName' is the variable name.
  3401.         - 'VarValue' is the value of the variable.
  3402.         - 'Meaning' is a brief description of what the variable value means,
  3403.           i.e. how the window should or will interpret the value.
  3404.         - 'i' means incomplete, i.e. not all struct variables are shown.
  3405.           This can be caused, for instance, because this is a call and some
  3406.           variables are output variables or because some variable values do
  3407.           not have meaningful values at the time the call is being made.
  3408.           (You may see the trace generated for the message CM_SETCNRINFO.)
  3409.  
  3410.         Initial and final square brackets may appear more than once,
  3411.         indicating the structure nesting.  For instance, the beginning and
  3412.         end of a structure contained inside another structure are shown,
  3413.         respectively, as '[[' and ']]'.
  3414.  
  3415.  
  3416.  
  3417.  
  3418.  
  3419.  
  3420.  
  3421.  
  3422.                                   - 58 -
  3423.  
  3424.  
  3425.  
  3426.         8. Notes About PMM
  3427.         ══════════════════
  3428.  
  3429.  
  3430.         When examples are given, the arrow indicates that the next line
  3431.         continues from the current one.  Ellipsis, unless stated otherwise,
  3432.         indicates that some information is not shown.
  3433.  
  3434.         1. Any message parameter defined as "Reserved," which should have
  3435.            a NULL value, is not shown, except when its value is not NULL.
  3436.  
  3437.         2. PMM interprets only "as much as defined in the documentation" in
  3438.            message parameters, structure variables and return values.  For
  3439.            instance, the parameter 1 in the WM_TIMER message is defined as a
  3440.            timer id and a timer id uses only the lower 16 bits of the
  3441.            parameter.  No attempt is made to test and interpret the higher
  3442.            16 bits.  Note that if an application uses "empty" bits a message
  3443.            may fail or produce unexpected results.
  3444.  
  3445.         3. Every variable or item defined as having a boolean type is tested
  3446.            against zero (0), meaning FALSE, and against non-zero, meaning
  3447.            TRUE.  The variable value is shown as FALSE, TRUE or it is
  3448.            decoded to some meaning.  If the variable value is not zero (0)
  3449.            or one (1), PMM appends the literal "(Value: n)" to the variable
  3450.            value, where 'n' is the real value of the variable.
  3451.            Example:
  3452.  
  3453.            2147484008 (Menu)  MM_QUERYITEMRECT  Item id: 300 Include ->
  3454.               submenus: FALSE  pRectl: 0x000b7e28 (Out)  Sent
  3455.            2147484008 (Menu)  MM_QUERYITEMRECT  ->
  3456.               Returns: TRUE(Value: 2147484008)<Item found>  ->
  3457.               Rectl: (58,20)-(133,1)
  3458.  
  3459.         4. Pointer values and undefined flags are shown in hexadecimal.
  3460.            Hexadecimal numbers are denoted by the prefix '0x'.
  3461.            Here is an example of an undefined flag:
  3462.  
  3463.            2147484457 (Style)u  WM_CHAR  Flags: KC_VIRTUALKEY KC_SCANCODE ->
  3464.               KC_KEYUP KC_LONEKEY 0x1000 Repeat count: 1 ...
  3465.            2147484457 (Style)u  WM_CHAR  Returns: FALSE<Message ignored>
  3466.  
  3467.            0x1000 is not defined in the PM include files.
  3468.  
  3469.         5. Some "strings," those susceptible to have binary data, are shown
  3470.            in hexadecimal.  Every character of the string is translated
  3471.            into 2 hexadecimal characters.  This translation is denoted by
  3472.            the suffix "(h)".
  3473.            Example:
  3474.  
  3475.  
  3476.  
  3477.  
  3478.  
  3479.  
  3480.                                   - 59 -
  3481.  
  3482.  
  3483.  
  3484.            2147484120 (DDE-Sample)u  WM_DDE_EXECUTE  hwndServer: ->
  3485.               2147484139  [DDESTRUCT: cbData: 9 [fsStatus: DDE_FACKREQ ->
  3486.               DDE_FAPPSTATUS: 0] usFormat: CF_TEXT offszItemName: 12 ->
  3487.               Item name: "Quote" offabData: 18 ->
  3488.               Data: 5b434c4f534528295d(h)="[CLOSE()]"]  Dispatched
  3489.            2147484120 (DDE-Sample)u  WM_DDE_EXECUTE  Returns
  3490.  
  3491.         6. The following is a table of abbreviations used in PMM:
  3492.  
  3493.            Abbreviation         Meaning
  3494.            ------------         -------
  3495.  
  3496.            accel                accelerator
  3497.            app                  application
  3498.            attr                 attribute
  3499.            coor                 coordinate
  3500.            id                   identifier
  3501.            ipt                  insertion point
  3502.            PDCIP                Pointing device capture in progress
  3503.            rectl                rectangle
  3504.  
  3505.         7. To avoid confusion, if a structure contains more than one
  3506.            structure of the same type and the contained structures are not
  3507.            an array, every contained structure is identified by the variable
  3508.            name beside its name.  An asterisk may appear before the variable
  3509.            name, denoting 'the contents of'.
  3510.            Example:
  3511.  
  3512.            2147484101 (Container) 30  CM_QUERYCNRINFO  pCnrInfo: (Out)  ->
  3513.               Bytes to copy: 92  Sent
  3514.            2147484101 (Container) 30  CM_QUERYCNRINFO  Returns Bytes ->
  3515.               copied: 92  [CNRINFO: cb: 92 pSortRecord: NULL ->
  3516.               *pFieldInfoLast: [[FIELDINFO: cb: 32 ...]] ->
  3517.               *pFieldInfoObject: [[FIELDINFO: cb: 32 ...]] ->
  3518.               ...]
  3519.  
  3520.         8. If a message has one or more output parameters and returns an
  3521.            error, the output parameters are always shown, even if they are
  3522.            not meaningful.
  3523.            Example:
  3524.  
  3525.            2147484113 (Menu) O. SC_SYSMENU  MM_QUERYITEM  Item id: -1 ->
  3526.               Include submenus: FALSE  pMenuItem: 0x00082380 (Output)  Sent
  3527.            2147484113 (Menu) O. SC_SYSMENU  MM_QUERYITEM  ->
  3528.               Returns: Error  [MENUITEM: iPosition: 0 afStyle: ->
  3529.               MIS_BITMAP MIS_SUBMENU afAttribute: 0 id: SC_SYSMENU ->
  3530.               hwndSubMenu: 2147484113 hItem: 67108870]
  3531.  
  3532.         10. When the absence of some flag implies another action or meaning
  3533.             and no constant exists for this action or meaning, PMM may
  3534.             "create" a constant showing the intended action.  An exclamation
  3535.  
  3536.  
  3537.  
  3538.                                   - 60 -
  3539.  
  3540.  
  3541.  
  3542.             point (!) will be appended to this undefined constant.
  3543.             Example:
  3544.  
  3545.             2147484094 (ListBox)  DM_DRAGFILECOMPLETE  File name: ->
  3546.                "TEST.TXT"  Flags: DF_COPY! DF_SOURCE DF_SUCCESSFUL  Sent
  3547.             2147484094 (ListBox)  DM_DRAGFILECOMPLETE  Returns: 0
  3548.  
  3549.             The operation is not a move (if it were the flag would have been
  3550.             DF_MOVE), so it is a copy.  Note that DF_COPY is not defined as
  3551.             a constant in the PM include files.
  3552.  
  3553.             This interpretation is done on some messages only.  Names have
  3554.             been selected that are easy to interpret.
  3555.  
  3556.         11. PMM detects automatically the File Dialog messages and the Font
  3557.             Dialog messages when sent to these dialog windows, and
  3558.             differentiates them from user messages with the same value.
  3559.  
  3560.         12. The function WinCreateMsgQueue creates an object window whose
  3561.             class is "#32767".  This window, like any other window,
  3562.             receives messages.  Some of them are:
  3563.  
  3564.             When the window is being created:
  3565.                WM_CREATE
  3566.                WM_ADJUSTWINDOWPOS
  3567.  
  3568.             When the window is being destroyed:
  3569.                WM_ADJUSTWINDOWPOS
  3570.                WM_WINDOWPOSCHANGED
  3571.                WM_SHOW
  3572.                WM_DESTROY
  3573.  
  3574.             Additionally, it may receive messages like this:
  3575.                WM_FOCUSCHANGE
  3576.  
  3577.             PMM does not trace the messages occurring at create or destroy
  3578.             time for this window.
  3579.  
  3580.  
  3581.  
  3582.         9. Errors Detected in the Documentation
  3583.         ═══════════════════════════════════════
  3584.  
  3585.  
  3586.         1. DM_PRINTOBJECT.  The documentation states that the first
  3587.            parameter (param1) in the message DM_PRINTOBJECT is a pointer to
  3588.            a DRAGINFO structure.  This is incorrect.  param1 is a pointer to
  3589.            a DRAGITEM structure.
  3590.  
  3591.         2. DM_DRAGOVER.  The documentation states that, for a modified drag
  3592.            operation, the field usOperation in the structure DRAGINFO must
  3593.  
  3594.  
  3595.  
  3596.                                   - 61 -
  3597.  
  3598.  
  3599.  
  3600.            have a value greater (>) than DO_UNKNOWN for an operation defined
  3601.            by an application.  When explaining the return values of this
  3602.            message it states that usDrop must be greater than or equal (>=)
  3603.            to DO_UNKNOWN.  PMM considers values greater than or equal to
  3604.            DO_UNKNOWN as application defined operations.
  3605.  
  3606.         3. HM_QUERY.  The parameters usmessageid and usselectionid do not
  3607.            appear in the documented order:
  3608.  
  3609.            param1
  3610.               USHORT usmessageid
  3611.               USHORT usselectionid
  3612.  
  3613.            The correct order is:
  3614.  
  3615.            param1
  3616.               USHORT usselectionid
  3617.               USHORT usmessageid
  3618.  
  3619.            PMM shows the correct order.
  3620.  
  3621.         4. HM_QUERY.  The constant HMQW_VIEWEDPAGES used in the variable
  3622.            usmessageid doesn't exist in the toolkit include files.  The
  3623.            correct constant is HMQW_VIEWPAGES.
  3624.  
  3625.  
  3626.  
  3627.         10. PMM Limits
  3628.         ══════════════
  3629.  
  3630.  
  3631.         The following are the PMM limits:
  3632.  
  3633.         Number of PMM sessions running in OS/2 (different tasks): no limit.
  3634.         Number of PMM sessions per task: 1.
  3635.         Number of PM message queues per session: 1.
  3636.         Number of windows handled per session: no limit.
  3637.         Number of times that an application can subclass a window: 20.
  3638.         Number of nested messages that a window can receive: 200.
  3639.  
  3640.  
  3641.  
  3642.         11. Tools Used in Creating PMM
  3643.         ══════════════════════════════
  3644.  
  3645.  
  3646.         PMM has been written using the following tools:
  3647.  
  3648.         The IBM C/C++ Tools Version 2.01.
  3649.         The IBM Developer's Toolkit for OS/2 Version 2.1.
  3650.  
  3651.  
  3652.  
  3653.  
  3654.                                   - 62 -
  3655.  
  3656.  
  3657.  
  3658.         PMM has been tested on OS/2 Version 2.1, 3.0 and 4.0.  No patches
  3659.         have been added to any of these versions of OS/2.
  3660.  
  3661.  
  3662.  
  3663.         12. Acknowledgments
  3664.         ═══════════════════
  3665.  
  3666.         My special thanks to B.D. (name withheld), David Johnston, Jon
  3667.         Saxton, Martin Schaffoener and Charles Wangersky, who reviewed
  3668.         the documentation and offered valuable comments and suggestions
  3669.         about this program.  I hope they know how much I appreciate
  3670.         their fine work.
  3671.  
  3672.  
  3673.  
  3674.         13. Disclaimer
  3675.         ══════════════
  3676.  
  3677.         PMM is distributed "as is."  No warranty of any kind is expressed
  3678.         or implied.  You use it at your own risk.  The author will not be
  3679.         liable for data loss, damages, loss of profits or any other kind
  3680.         of loss while using this software.
  3681.  
  3682.  
  3683.  
  3684.         14. Trademarks
  3685.         ══════════════
  3686.  
  3687.         The following terms used in this manual are trademarks or service
  3688.         marks of IBM Corporation.
  3689.  
  3690.         IBM
  3691.         OS/2
  3692.         Presentation Manager
  3693.  
  3694.  
  3695.  
  3696.  
  3697.  
  3698.  
  3699.  
  3700.  
  3701.  
  3702.  
  3703.  
  3704.  
  3705.  
  3706.  
  3707.  
  3708.  
  3709.  
  3710.  
  3711.  
  3712.                                   - 63 -
  3713.  
  3714.  
  3715.