home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / DRGDRO.ZIP / DROPINFO.ZIP / PUTMSG.C < prev   
Text File  |  1993-02-22  |  6KB  |  160 lines

  1. #include "dropinfo.h"
  2.  
  3. /*****************************************************************************/
  4. /* Put message info in listbox item                                          */
  5. /*****************************************************************************/
  6. void PutMsg(HWND hwnd, char *type, MPARAM mp1, MPARAM mp2)
  7. {
  8.   char buf[100];                                 /* Message buffer           */
  9.  
  10.   sprintf(buf,                                   /* Copy info to buffer      */
  11.           "%s 0x%p, 0x%p",
  12.           type,
  13.           mp1,
  14.           mp2);
  15.   WinSendMsg(hwnd,                               /* Set listbox top index    */
  16.              LM_SETTOPINDEX,
  17.              (MPARAM)WinSendMsg(hwnd,            /* Position of new item     */
  18.                                 LM_INSERTITEM,
  19.                                 (MPARAM)LIT_END,
  20.                                 MPFROMP(buf)),
  21.              NULL);
  22.   return;
  23. }
  24.  
  25. /*****************************************************************************/
  26. /* Put DRAGINFO structure contents in listbox item                           */
  27. /*****************************************************************************/
  28. void PutDInfo(HWND hwnd, PDRAGINFO pDInfo)
  29. {
  30.   char buf[500];                                 /* Buffer                   */
  31.   sprintf(buf,                                   /* Copy info to buffer      */
  32.           " DRAGINFO: size: %d, %d, ops: %d, hwndSource: %08X, drop coords: (%d, %d), cdItem cnt: %d",
  33.           pDInfo->cbDraginfo,
  34.           pDInfo->cbDragitem,
  35.           pDInfo->usOperation,
  36.           pDInfo->hwndSource,
  37.           pDInfo->xDrop,
  38.           pDInfo->yDrop,
  39.           pDInfo->cditem);
  40.  
  41.   WinSendMsg(hwnd,                               /* Set listbox top index    */
  42.              LM_SETTOPINDEX,
  43.              (MPARAM)WinSendMsg(hwnd,            /* Position of new item     */
  44.                                 LM_INSERTITEM,
  45.                                 (MPARAM)LIT_END,
  46.                                 MPFROMP(buf)),
  47.              NULL);
  48.   return;
  49. }
  50.  
  51. /*****************************************************************************/
  52. /* Put DRAGITEM structure contents in listbox item                           */
  53. /*****************************************************************************/
  54. void PutDItem(HWND hwnd, PDRAGITEM pDItem)
  55. {
  56.   char buf[500],                                 /* Buffers                  */
  57.        srceType[100],
  58.        srceContainer[100],
  59.        srceName[100],
  60.        srceRMF[100],
  61.        targetName[100];
  62.  
  63.   DrgQueryStrName(pDItem->hstrSourceName,        /* Get info from DRAGITEM   */
  64.                   100,
  65.                   srceName);
  66.   DrgQueryStrName(pDItem->hstrContainerName,
  67.                   100,
  68.                   srceContainer);
  69.   DrgQueryStrName(pDItem->hstrType,
  70.                   100,
  71.                   srceType);
  72.   DrgQueryStrName(pDItem->hstrRMF,
  73.                   100,
  74.                   srceRMF);
  75.   DrgQueryStrName(pDItem->hstrTargetName,
  76.                   100,
  77.                   targetName);
  78.  
  79.   sprintf(buf,                                   /* Copy info to buffer      */
  80.           "   DRAGITEM: ulItemID: %d",
  81.           pDItem->ulItemID);
  82.   WinSendMsg(hwnd,                               /* Set listbox top index    */
  83.              LM_SETTOPINDEX,
  84.              (MPARAM)WinSendMsg(hwnd,            /* Position of new item     */
  85.                                 LM_INSERTITEM,
  86.                                 (MPARAM)LIT_END,
  87.                                 MPFROMP(buf)),
  88.              NULL);
  89.  
  90.   sprintf(buf,
  91.           "   --Type:      \"%s\"",
  92.           srceType);
  93.   WinSendMsg(hwnd,
  94.              LM_SETTOPINDEX,
  95.              (MPARAM)WinSendMsg(hwnd,
  96.                                 LM_INSERTITEM,
  97.                                 (MPARAM)LIT_END,
  98.                                 MPFROMP(buf)),
  99.              NULL);
  100.  
  101.   sprintf(buf,
  102.           "   --RMF:       \"%s\"",
  103.           srceRMF);
  104.   WinSendMsg(hwnd,
  105.              LM_SETTOPINDEX,
  106.              (MPARAM)WinSendMsg(hwnd,
  107.                                 LM_INSERTITEM,
  108.                                 (MPARAM)LIT_END,
  109.                                 MPFROMP(buf)),
  110.              NULL);
  111.  
  112.   sprintf(buf,
  113.           "   --Container: \"%s\"",
  114.           srceContainer);
  115.   WinSendMsg(hwnd,
  116.              LM_SETTOPINDEX,
  117.              (MPARAM)WinSendMsg(hwnd,
  118.                                 LM_INSERTITEM,
  119.                                 (MPARAM)LIT_END,
  120.                                 MPFROMP(buf)),
  121.              NULL);
  122.  
  123.   sprintf(buf,
  124.           "   --SourceName:      \"%s\"",
  125.           srceName);
  126.   WinSendMsg(hwnd,
  127.              LM_SETTOPINDEX,
  128.              (MPARAM)WinSendMsg(hwnd,
  129.                                 LM_INSERTITEM,
  130.                                 (MPARAM)LIT_END,
  131.                                 MPFROMP(buf)),
  132.              NULL);
  133.  
  134.   sprintf(buf,
  135.           "   --TargetName:      \"%s\"",
  136.           targetName);
  137.   WinSendMsg(hwnd,
  138.              LM_SETTOPINDEX,
  139.              (MPARAM)WinSendMsg(hwnd,
  140.                                 LM_INSERTITEM,
  141.                                 (MPARAM)LIT_END,
  142.                                 MPFROMP(buf)),
  143.              NULL);
  144.  
  145.   sprintf(buf,
  146.           "   --Offset: (%d, %d), cntl: %d, ops: %d",
  147.           pDItem->cxOffset,
  148.           pDItem->cyOffset,
  149.           pDItem->fsControl,
  150.           pDItem->fsSupportedOps);
  151.   WinSendMsg(hwnd,
  152.              LM_SETTOPINDEX,
  153.              (MPARAM)WinSendMsg(hwnd,
  154.                                 LM_INSERTITEM,
  155.                                 (MPARAM)LIT_END,
  156.                                 MPFROMP(buf)),
  157.              NULL);
  158.   return;
  159. }
  160.