home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / os / mswindo / programm / misc / 4412 < prev    next >
Encoding:
Text File  |  1992-12-22  |  2.8 KB  |  76 lines

  1. Newsgroups: comp.os.ms-windows.programmer.misc
  2. Path: sparky!uunet!gatech!destroyer!cs.ubc.ca!alberta!kakwa.ucs.ualberta.ca!ee.ualberta.ca!manz
  3. From: manz@ee.ualberta.ca (Brett {Druid Queen} Manz)
  4. Subject: Re: drag & drop server
  5. Message-ID: <manz.724974780@ee.ualberta.ca>
  6. Sender: news@kakwa.ucs.ualberta.ca
  7. Nntp-Posting-Host: eigen.ee.ualberta.ca
  8. Organization: University Of Alberta, Edmonton Canada
  9. References: <1gojquINNqbv@usenet.INS.CWRU.Edu> <1992Dec13.3151.2724@dosgate> <1h0crpINNdvh@usenet.INS.CWRU.Edu>
  10. Date: Mon, 21 Dec 1992 21:53:00 GMT
  11. Lines: 63
  12.  
  13. In <1h0crpINNdvh@usenet.INS.CWRU.Edu> bu254@cleveland.Freenet.Edu (Stephen Groundwater) writes:
  14.  
  15.  
  16. >In a previous article, bu254@cleveland.Freenet.Edu (Stephen Groundwater) says:
  17. >[Stuff deleted]
  18. >>This is the result of my dumping the hDrop memory that
  19. >>comes on the WM_DROPFILES message, and my understanding of it.
  20. >> 
  21. >>The hDrop memory is a global memory object.
  22. >>The drag-drop memory object consists of two parts, a header, and
  23. >>a trailing bit.
  24. >>The header is 8 bytes long in windows 3.1.
  25. >>The trailer is however long it needs to be.
  26. >> 
  27. >>The header:
  28. >> 
  29. >>typedef struct tagDragHeader {
  30. >>    UNIT wStructSize; /* Size of struct (8 bytes in this ver) */
  31. >>    UINT x; /* x co-ord on window that is dropped on. (Client DC) */
  32. >>    UINT y; /* y co-ord on window that is dropped on. (Client DC) */
  33. >>    WORD wReserved; /* no known purpose, should be 0 */
  34. >>    } DragHeader;
  35. >> 
  36. >>This is what I think the header structure is, the first three
  37. >>fields I am more or less sure of, the fourth field is a mystery
  38. >>to me, but in every drop I've seen it's been 0.
  39. >> 
  40.  
  41. >Correction:
  42. >I have now found out what the fourth field is, thanks to hints from
  43. >blakeco@Microsoft.COM. The structure should be:
  44.  
  45. >typedef struct tagDRAGHEADER {
  46. >  UINT wStructSize; // Same as before
  47. >  UINT x; // Same as before
  48. >  UINT y; // Same as before
  49. >  BOOL fInClient; // True if drop is on client area,
  50. >                  // false if anywhere else (title bar etc)
  51. >  } DRAGHEADER;
  52.  
  53. >>The trailer:
  54. >> 
  55. >>The trailer is a series of null-terminated strings that contain
  56. >>the strings that DragQueryFile() will return. The number of the
  57. >>strings is not in any structure, so you don't need to worry about
  58. >>that.
  59.  
  60. Actually, I believe the trailer is a null-terminated list of
  61. null-terminated strings.  ie:
  62.  
  63. filename1\0filename2\0filename3\0\0
  64.  
  65. Without the last null DragQueryFile() won't know where the list ends
  66. and will likely cause a protection error.
  67.  
  68.  
  69. >>You should GlobalAlloc a block big enough for the header, and following
  70. >>file names, and use the flag GMEM_DDESHARE when allocating.
  71. -- 
  72. ---------------------------------+-------------------------------------
  73.  My opinions are my own.         |  You can't be proud of who you are
  74.  The truth belongs to everyone.  |  if you're ashamed of what you are.
  75.    I can't even *think straight! |    Cruise Men, Not Missiles! - anon
  76.