home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 11 Util / 11-Util.zip / rwl025.zip / RWL.H < prev    next >
C/C++ Source or Header  |  2000-06-10  |  3KB  |  106 lines

  1. /**********************************************************************/
  2. /*                                                                    */
  3. /*  RWL - A demonstration program placed in the Public Domain         */
  4. /*        by it author, R L Walsh, June 10, 2000                      */
  5. /*                                                                    */
  6. /**********************************************************************/
  7. #if 0
  8.  
  9.     For a description of how RWL works, please see "rwlx.c"
  10.  
  11. #endif
  12. /**********************************************************************/
  13.  
  14. //  RWL.H
  15.  
  16. /**********************************************************************/
  17.  
  18. #define INCL_WIN
  19. #define INCL_DOS
  20.  
  21. #include <os2.h>
  22.  
  23. /**********************************************************************/
  24.  
  25. // functions exported from RWLD
  26. void _System    RWLDInitDll( HMODULE hDll, ULONG x2d, ULONG d2x);
  27. int  _System    RWLDInputHook( HAB hab, PQMSG pqmsg, ULONG fs);
  28.  
  29. /**********************************************************************/
  30.  
  31. // RWL struct - everything we need to know about a process,
  32. // plus a buffer for passing strings back and forth.
  33.  
  34. typedef struct _RWL
  35. {
  36.     ULONG   pid;        // the target's PID
  37.     HMQ     hmq;        // HMQ for the lowest numbered thread with a msg-q
  38.     HWND    hwnd;       // a window belonging to that thread
  39.     USHORT  used;       // least-recently-used indicator for array mgmt
  40.     USHORT  inuse;      // is this instance being used by a dialog
  41.     char *  pszProc;    // ptr to the target's f/q exe name
  42.     char *  pszBeg;     // ptr to the initial BeginLIBPATH for use by Undo
  43.     char *  pszEnd;     // ptr to the initial EndLIBPATH for use by Undo
  44.     ULONG   flags;      // msg flags that tell the hook code what to do
  45.     char    szPath[1024]; // buffer for strings
  46. } RWL;
  47.  
  48. typedef RWL *PRWL;
  49.  
  50. /**********************************************************************/
  51.  
  52. // values for RWL.flags
  53.  
  54. #define RWLF_GET    ((ULONG)0x0001)
  55. #define RWLF_SET    ((ULONG)0x0002)
  56. #define RWLF_BEG    ((ULONG)0x0004)
  57. #define RWLF_END    ((ULONG)0x0008)
  58. #define RWLF_PROC   ((ULONG)0x0010)
  59. #define RWLF_NOFREE ((ULONG)0x0020)
  60.  
  61. #define RWLF_OK     ((ULONG)0x00100)
  62. #define RWLF_BAD    ((ULONG)0x00200)
  63.  
  64. #define RWLF_BEGEND (RWLF_BEG | RWLF_END)
  65.  
  66. #define RWLF_X2D    (RWLF_GET | RWLF_SET  | RWLF_BEG | \
  67.                      RWLF_END | RWLF_PROC | RWLF_NOFREE)
  68.  
  69. #define RWLF_D2X    (RWLF_GET | RWLF_SET  | RWLF_BEG | \
  70.                      RWLF_END | RWLF_PROC | RWLF_OK | RWLF_BAD)
  71.  
  72. /****************************************************************************/
  73.  
  74. // APP struct - used while enumerating PM-based processes;
  75. // the pid and hwnd info is later stored in the dialog's listbox.
  76.  
  77. typedef struct _APP
  78. {
  79.     HWND    hwnd;
  80.     PID     pid;
  81.     TID     tid;
  82. } APP;
  83.  
  84. typedef APP * PAPP;
  85.  
  86. // the maximum number of processes we can enumerate
  87. #define MAXAPP  1024
  88.  
  89. /**********************************************************************/
  90.  
  91. // Miscellanea
  92.  
  93. // these are arbitrary msg IDs that should never end up being used
  94. #define RWLM_X2D    0x85AB
  95. #define RWLM_D2X    0x85AC
  96.  
  97. // a convenient macro
  98. #ifdef MP
  99.     #error MP already defined
  100. #else
  101.     #define MP      MPARAM
  102. #endif
  103.  
  104. /**********************************************************************/
  105.  
  106.