No announcement yet.

DragQueryFile in PBCC?

  • Filter
  • Time
  • Show
Clear All
new posts

  • DragQueryFile in PBCC?

    I see a couple of examples of this function for PBWin, but I can't figure out how to get the hDrop parameter in CC.

    Couple someone write up just a brief example where you can drop a file list out of windows explorer onto the icon and have it print the file list to the console?

    The big idea is to use this as a replacement for the COMMAND$() function for a send-to item to avoid the 2k workspace limit.

    The boy just ain't right.

  • #2
    If you mean like "paste" onto a desktop shortcut icon, that file list comes in thru COMMAND$.

    Same with "send to", the file name(s) come into your program via COMMAND$. (See the "properties" of the "send to" items in your start menu, you'll see ' programname.exe %1' )

    I think multiple files come in null-delimited, with two nulls at the end. That means you will have to parse lpCmdLine yourself, as ASCIIZ [PTR] datatypes will be truncated by the compiler at the FIRST null, which is not what you would want in this case.

    However... when you copy a list of files from Explorer, an 'hdrop' is put on the clipboard with format type CF_HDROP. Go get that, and there's your 'hdrop' for use with DragQueryFile()

    Your completed demo will be appreciated in the source code forum.

    Michael Mattias
    Tal Systems (retired)
    Port Washington WI USA
    [email protected]