3 static char * fileIconNames[] =
5 "<:ecere>mimeTypes/file.png", /* none */
7 "<:ecere>mimeTypes/file.png", /* normalFile */
8 "<:ecere>mimeTypes/textEcereWorkspace.png", /* ewsFile */
9 "<:ecere>mimeTypes/textEcereProject.png", /* epjFile */
10 "<:ecere>mimeTypes/textEcereSource.png", /* ecFile */
11 "<:ecere>mimeTypes/textEcereHeader.png", /* ehFile */
12 "<:ecere>mimeTypes/textCSource.png", /* cFile */
13 "<:ecere>mimeTypes/textCHeader.png", /* hFile */
14 "<:ecere>mimeTypes/textC++Source.png", /* cppFile */
15 "<:ecere>mimeTypes/textC++Header.png", /* hppFile */
16 "<:ecere>mimeTypes/text.png", /* textFile */
17 "<:ecere>mimeTypes/textHyperTextMarkup.png", /* webFile */
18 "<:ecere>mimeTypes/image.png", /* pictureFile */
19 "<:ecere>status/audioVolumeHigh.png", /* soundFile */
20 "<:ecere>mimeTypes/package.png", /* archiveFile */
21 "<:ecere>mimeTypes/packageSoftware.png", /* packageFile */
22 "<:ecere>mimeTypes/packageOpticalDisc.png", /* opticalMediaImageFile */
24 "<:ecere>places/folder.png", /* folder */
25 "<:ecere>status/folderOpen.png", /* folderOpen */
26 "<:ecere>devices/computer.png", /* computer */
27 "<:ecere>devices/driveHardDisk.png", /* drive */
28 "<:ecere>places/driveRemote.png", /* netDrive */
29 "<:ecere>devices/mediaOptical.png", /* cdrom */
30 "<:ecere>devices/driveRemovableMedia.png", /* removable */
31 "<:ecere>devices/mediaFloppy.png", /* floppy */
32 "<:ecere>places/networkWorkgroup.png", /* network */
33 "<:ecere>places/networkServer.png", /* server */
34 "<:ecere>places/folderRemote.png", /* share */
36 "<:ecere>mimeTypes/package.png", /* treeLoader */
37 "<:ecere>places/startHere.png", /* lineNumbers */
42 //define guiApp = ((GuiApplication)__thisModule);
43 //define selectionColor = guiApp.currentSkin.selectionColor; //Color { 10, 36, 106 };
45 public enum __FileType
49 normalFile, ewsFile, epjFile, ecFile, ehFile, cFile, hFile, cppFile, hppFile,
50 textFile, webFile, pictureFile, soundFile,
51 archiveFile, packageFile, opticalMediaImageFile, /* these (all previous) are sort equal */
53 folder, folderOpen, computer,
54 drive, netDrive, cdrom, removable, floppy, network, server, share, // these are sort equal
64 this = SelectByExtension(value);
68 public property bool isFolder
70 get { return this >= folder && this <= share; }
73 public property bool isFile
75 get { return this >= normalFile && this <= opticalMediaImageFile; }
78 __FileType ::SelectByExtension(char * extension)
80 if(!strcmpi(extension, "ews"))
82 else if(!strcmpi(extension, "epj"))
84 else if(!strcmpi(extension, "ec"))
86 else if(!strcmpi(extension, "eh"))
88 else if(!strcmpi(extension, "cpp") ||
89 !strcmpi(extension, "cc") || !strcmpi(extension, "cxx"))
91 else if(!strcmpi(extension, "hpp") ||
92 !strcmpi(extension, "hh") || !strcmpi(extension, "hxx"))
94 else if(!strcmpi(extension, "c"))
96 else if(!strcmpi(extension, "h"))
98 else if(!strcmpi(extension, "txt") || !strcmpi(extension, "text") ||
99 !strcmpi(extension, "nfo") || !strcmpi(extension, "info"))
101 else if(!strcmpi(extension, "htm") || !strcmpi(extension, "html") ||
102 !strcmpi(extension, "css") || !strcmpi(extension, "php") ||
103 !strcmpi(extension, "js"))
105 else if(!strcmpi(extension, "bmp") || !strcmpi(extension, "pcx") ||
106 !strcmpi(extension, "jpg") || !strcmpi(extension, "jpeg") ||
107 !strcmpi(extension, "gif") || !strcmpi(extension, "png") ||
108 !strcmpi(extension, "ico"))
110 else if(!strcmpi(extension, "wav") || !strcmpi(extension, "mp3") ||
111 !strcmpi(extension, "ogg") || !strcmpi(extension, "snd"))
113 else if(!strcmpi(extension, "ear") || !strcmpi(extension, "7z") ||
114 !strcmpi(extension, "rar") || !strcmpi(extension, "zip") ||
115 !strcmpi(extension, "gz") || !strcmpi(extension, "bz2") ||
116 !strcmpi(extension, "tar") || !strcmpi(extension, "arj") ||
117 !strcmpi(extension, "lza") || !strcmpi(extension, "lzh") ||
118 !strcmpi(extension, "cpio") || !strcmpi(extension, "z"))
120 else if(!strcmpi(extension, "cab") || !strcmpi(extension, "deb") ||
121 !strcmpi(extension, "rpm"))
123 else if(!strcmpi(extension, "iso") || !strcmpi(extension, "mds") ||
124 !strcmpi(extension, "cue") || !strcmpi(extension, "bin") ||
125 !strcmpi(extension, "ccd") || !strcmpi(extension, "bwt") ||
126 !strcmpi(extension, "cdi") || !strcmpi(extension, "nrg"))
127 return opticalMediaImageFile;
132 //public enum FileSystemNodeType { file, folder, system };
134 define guiApp = ((GuiApplication)__thisModule); // how to do this in a dll?
135 define selectionColor = guiApp.currentSkin.selectionColor; //Color { 10, 36, 106 };
137 public class FileSystemNode : struct // : struct
140 /*//LinkElement<FileSystemNode> link;
141 FileSystemNode parent;
143 FileSystemNodeType type;
147 FileSystemNode prev, next;
149 bool loaded, childrenLoaded;
158 FileSystemNode parent;
164 void GetPath(String outputPath)
169 strcpy(outputPath, name);
170 for(up = parent; up; up = up.parent)
172 char temp[MAX_LOCATION];
173 strcpy(temp, up.name);
174 PathCat(temp, outputPath);
175 strcpy(outputPath, temp);
180 strcpy(outputPath, "/");
182 strcpy(outputPath, name);
187 bool IsChildOf(FileSystemNode node)
190 for(test = parent; test; test = test.parent)
196 void DuplicateChildren(bool recursive, bool forceExpanded, FileSystemNode addTo, FileSystemBox fsb)
200 FileSystemNode child;
202 for(child = children.first; child; child = child.next)
204 FileSystemNode copy { };
205 copy.name = CopyString(child.name);
206 copy.type = child.type;
207 fsb.AddTreeNode(copy, child.loaded, false, addTo);
209 copy.row.collapsed = false;
211 child.DuplicateChildren(recursive, forceExpanded, copy, fsb);
216 void EnsureVisible(bool expand)
219 parent.EnsureVisible(true);
221 row.collapsed = false;
222 // TODO: row.EnsureVisible(); // making the row visible by scrolling
232 FileSystemNode child;
233 for(; (child = children.first); )
236 children.Delete(child);
247 parent.children.Delete(this);
250 void OnDisplay(Surface surface, int x, int y, int width, FileSystemBox fsb, Alignment alignment, DataDisplayFlags displayFlags)
252 //int indentSize = (displayFlags.dropBox) ? 0 : 10;
258 char label[MAX_FILENAME];
265 icon = fsb.fileIcons[type].bitmap;
266 /*if(type == normalFile)
268 //xStart = indent * indent + x + (icon ? (icon.width + 5) : 0);
269 xStart = x + (icon ? (icon.width + 5) : 0);
275 sprintf(label, "%s [%s]", name, info);
282 if(type == folder || type == folderOpen)
283 surface.SetForeground(yellow);
287 //textOffset = indent * indentSize + (icon ? (icon.width + 4) : 0);
289 surface.TextOpacity(false);
290 surface.TextExtent(label, len, &w, &h);
293 // Draw the current row stipple
294 if(displayFlags.selected)
295 //surface.Area(xStart - 1, y, xStart - 1, y + h - 1);
296 //surface.Area(xStart + w - 1, y, xStart + w + 1, y + h - 1);
297 surface.Area(xStart - 3, y, xStart + w + 1, y + h - 1);
299 //surface.WriteTextDots(alignment, x + textOffset, y + 2, width - textOffset, name, strlen(name));
300 surface.WriteTextDots(alignment, xStart, y + 2, width, label, len);
302 //if(!guiApp.textMode) -- how to do this in a dll?
304 if(displayFlags.current)
306 if(displayFlags.active)
308 surface.LineStipple(0x5555);
309 if(displayFlags.selected)
310 surface.SetForeground(0xFFFFFF80);
312 surface.SetForeground(black);
316 surface.SetForeground(selectionColor);
318 surface.Rectangle(xStart - 3, y, xStart + w + 1, y + h - 1);
319 surface.LineStipple(0);
324 //surface.blend = true;
325 //surface.alphaWrite = blend;
326 surface.SetForeground(white);
327 //surface.Blit(icon, x + indent * indentSize, y,0,0, icon.width, icon.height);
328 surface.Blit(icon, x,y,0,0, icon.width, icon.height);
333 int OnCompare(FileSystemNode b)
336 FileSystemNode a = this;
337 if(a.type == b.type || (a.type < folder && b.type < folder) || (a.type >= drive))
338 result = strcmpi(a.name, b.name);
341 if(a.type == folder && b.type < folder) result = -1;
342 else if(a.type < folder && b.type == folder) result = 1;
348 /*int OnCompare(FileSystemNode b)
351 FileSystemNode a = this;
352 if(a.parent < b.parent) result = -1;
353 else if(a.parent > b.parent) result = 1;
355 result = fstrcmp(a.name, b.name);
359 char * OnGetString(char * tempString, FileSystemToolWindow fileSysToolWnd, bool * needClass)
361 return name ? name : "";
365 /*FileSystemNode MakeFileSystemNode(const FileStats stats, const char * name)
367 FileSystemNode node { stats = stats };
368 node.name = CopyString(name);
371 if(stats.attribs.isDirectory)
373 node.type = (stats.attribs.isDrive) ? drive : folder;
374 if(stats.attribs.isServer) node.type = server;
375 if(stats.attribs.isShare) node.type = share;
376 if(stats.attribs.isCDROM) node.type = cdrom;
377 if(stats.attribs.isRemote) node.type = netDrive;
378 if(stats.attribs.isRemovable)
380 if(name[0] == 'A' || name[0] == 'B')
383 node.type = removable;
388 char extension[MAX_EXTENSION];
389 GetExtension(node.name, extension);
390 node.type = __FileType::SelectByExtension(extension);
394 static FileSystemNode MakeFileSystemNode(const FileStats stats,
395 const char * fileName, const char * filePath,
396 const bool previewPicture, const DisplaySystem displaySystem)
398 int len = strlen(fileName);
399 char info[MAX_LOCATION];
400 char name[MAX_LOCATION];
401 char extension[MAX_EXTENSION];
403 FileSystemNode node { stats = stats };
405 //if(stats.attribs.isFile) // TODO fix this in ecere
406 if(stats.attribs.isDirectory)
410 node.type = (stats.attribs.isDrive) ? drive : folder;
411 if(stats.attribs.isServer) node.type = server;
412 if(stats.attribs.isShare) node.type = share;
413 if(stats.attribs.isCDROM) node.type = cdrom;
414 if(stats.attribs.isRemote) node.type = netDrive;
415 if(stats.attribs.isRemovable)
417 if(fileName[0] == 'A' || fileName[0] == 'B')
420 node.type = removable;
425 GetExtension(fileName, extension);
428 node.type = __FileType::SelectByExtension(extension);
431 if(stats.attribs.isDrive &&
432 len > 3 && !strncmp(&fileName[1], ": [", 3))
434 strncpy(name, fileName, 2);
436 strncpy(info, &fileName[4], len - 5);
441 strcpy(name, fileName);
445 node.path = CopyString(filePath);
446 node.name = CopyString(name);
448 node.info = CopyString(info);
449 node.extension = CopyString(extension);
451 if(node.type == pictureFile && previewPicture)
453 node.bitmap = Bitmap { };
454 node.bitmap.Load(filePath, null, displaySystem);
460 class FileSystemBoxBits
462 bool foldersOnly:1, filesOnly:1, details:1, treeBranches:1, previewPictures:1, navigateFolders:1;
463 //bool header:1, freeSelect:1, fullRowSelect:1, multiSelect:1, autoScroll:1, alwaysHL : 1, moveRows:1, resizable:1;
464 //bool moveFields:1, clearHeader:1, alwaysEdit:1, collapse:1, treeBranch:1, rootCollapse:1, heightSet:1;
465 //bool sortable:1, noDragging:1, fillLastField:1, expandOnAdd:1;
468 public class FileSystemBox : Window // should we not derive from ListBox instead?
470 this stuff from the listbox would be nicely exposed...
471 fullRowSelect = false;
473 collapseControl = true;
474 rootCollapseButton = true;
479 hasHorzScroll = false;
480 hasVertScroll = false;
486 FileSystemNode selection;
488 virtual bool Window::NotifyNodeSelect(FileSystemBox box, FileSystemNode node);
489 virtual bool Window::NotifyNodeOpen(FileSystemBox box, FileSystemNode node);
496 if(value && value[0])
497 path = CopyString(value);
499 locationBox.path = value;
505 //isset { return path && path[0]; }
508 property bool foldersOnly { set { bits.foldersOnly = value; bits.filesOnly = !value; } get { return bits.foldersOnly; } };
509 property bool filesOnly { set { bits.filesOnly = value; bits.foldersOnly = !value; } get { return bits.filesOnly; } };
510 property bool previewPictures { set { bits.previewPictures = value; } get { return bits.previewPictures; } };
511 property char * extensions { set { delete extensions; if(value && value[0]) extensions = CopyString(value); } get { return extensions; } }
512 property bool details { set { bits.details = value; } get { return bits.details; } };
513 property bool treeBranches
517 bits.treeBranches = value;
518 list.treeBranches = value;
519 list.collapseControl = value;
520 list.rootCollapseButton = value;
522 get { return bits.treeBranches; }
524 property bool navigateFolders { set { bits.navigateFolders = value; bits.foldersOnly = !value; } get { return bits.navigateFolders; } };
526 property FileSystemNode node
534 if(!list.currentRow.tag)
536 return (FileSystemNode)list.currentRow.tag;
542 void Select(FileSystemNode node)
546 node.EnsureVisible(false);
547 list.SelectRow(node.row);
551 FileSystemNode Find(const char * name, FileSystemNode parent)
554 FileSystemNode start = parent ? parent : root;
555 if(!start.loaded || !start.childrenLoaded)
557 for(node = start.children.first; node; node = node.next)
558 if(node.name && !strcmpi(node.name, name))
569 FileSystemBoxBits bits;
574 BitmapResource fileIcons[__FileType];
578 char wd[MAX_LOCATION];
579 GetWorkingDir(wd, sizeof(wd));
583 list.AddField(nameField);
593 for(c = 0; c < __FileType::enumSize; c++)
595 fileIcons[c] = BitmapResource { fileIconNames[c], alphaBlend = true };
596 AddResource(fileIcons[c]);
600 DataField nameField { dataType = "FileSystemNode", width = 240, userData = this };
601 DataField typeField { header = "Type", dataType = /*"String"*/ "char *", width = 40, freeData = false };
602 DataField sizeField { header = "Size", dataType = "FileSize", width = 96, alignment = right };
615 hasHorzScroll = true;
616 hasVertScroll = true;
617 fullRowSelect = false;
620 anchor = Anchor { left = 0, top = 0, right = 0, bottom = 0 };
622 // WHY is this not working ?
623 /*void OnResize(int width, int height)
625 if(vertScroll.visible)
626 nameField.width = width - vertScroll.size.w;
628 nameField.width = width;
631 bool NotifyCollapse(ListBox listBox, DataRow row, bool collapsed)
635 FileSystemNode node = (FileSystemNode)row.tag;
636 FileSystemNode child;
640 for(child = node.children.last; child; child = node.children.last)
642 listBox.DeleteRow(child.row);
646 node.childrenLoaded = false;
651 if(!node.loaded || !node.childrenLoaded)
654 //list.Sort(nameField, 1);
657 for(child = node.children.first; child && child.next; child = child.next);
659 child.EnsureVisible(false);
665 bool NotifyRightClick(ListBox listBox, int x, int y, Modifiers mods)
667 DataRow row = listBox.currentRow;
670 FileSystemNode node = (FileSystemNode)row.tag;
676 MenuItem { menu, "Cut\tCtrl+X", t, NotifySelect = null, disabled = false };
677 MenuItem { menu, "Copy\tCtrl+C", c, NotifySelect = null, disabled = false };
678 MenuItem { menu, "Paste\tCtrl+V", p, NotifySelect = null, disabled = false /*!clipboard*/ };
679 MenuItem { menu, "Delete\tDel", d, NotifySelect = null, disabled = false };
680 //MenuDivider { menu };
684 master = this, menu = menu,
686 x + clientStart.x + absPosition.x - guiApp.desktop.position.x,
687 y + clientStart.y + absPosition.y - guiApp.desktop.position.y }
695 bool NotifySelect(ListBox listBox, DataRow row, Modifiers mods)
699 FileSystemNode node = (FileSystemNode)row.tag;
700 NotifyNodeSelect(listBox.parent.master, this, node);
706 bool NotifyEditing(ListBox listBox, DataRow row)
710 FileSystemNode node = (FileSystemNode)row.tag;
715 bool NotifyEdited(ListBox listBox, DataRow row)
719 FileSystemNode node = (FileSystemNode)row.tag;
724 bool NotifyEditDone(ListBox listBox, DataRow row)
728 FileSystemNode node = (FileSystemNode)row.tag;
733 bool NotifyDoubleClick(ListBox listBox, int x, int y, Modifiers mods)
738 bool NotifyKeyDown(ListBox listBox, DataRow row, Key key, unichar ch)
741 if((SmartKey)key == enter)
752 if(selection && selection.type.isFolder && bits.navigateFolders)
754 property::path = selection.path;
758 result = NotifyNodeOpen(this.master, this, selection);
763 Menu editMenu { menu, "Edit", e };
766 editMenu, "Cut\tCtrl+X", t, disabled = true;
768 bool NotifySelect(MenuItem selection, Modifiers mods)
774 MenuItem itemEditCopy
776 editMenu, "Copy\tCtrl+C", c, disabled = true;
778 bool NotifySelect(MenuItem selection, Modifiers mods)
784 MenuItem itemEditPaste
786 editMenu, "Paste\tCtrl+V", p;
788 bool NotifySelect(MenuItem selection, Modifiers mods)
794 MenuItem itemEditDelete
796 editMenu, "Delete\tDel", d, disabled = true;
798 bool NotifySelect(MenuItem selection, Modifiers mods)
805 // WHY is this crashing ?
806 /*void OnResize(int width, int height)
808 if(this && nameField)
809 nameField.width = width - 80;
815 // this is crashing in for designer when details = true // can't save the file, always yields a crash
816 /*if(list && created)
819 list.AddField(nameField);
822 list.AddField(typeField);
823 list.AddField(sizeField);
826 if(bits.treeBranches)
834 FileListing listing { path, extensions = extensions };
837 while(listing.Find())
839 if((!bits.foldersOnly && !bits.filesOnly) ||
840 (bits.foldersOnly && listing.stats.attribs.isDirectory) ||
841 (bits.filesOnly && !listing.stats.attribs.isDirectory/*listing.stats.attribs.isFile*/)) // TOCHECK: isFile broken?
843 FileSystemNode node = MakeFileSystemNode(listing.stats, listing.name, listing.path, bits.previewPictures, displaySystem);
844 DataRow row = list.AddRow();
846 row.SetData(nameField, node);
849 row.SetData(typeField, node.extension);
850 row.SetData(sizeField, (void *)node.stats.size);
854 list.Sort(nameField, 1);
859 //char startPath[MAX_LOCATION];
860 FileSystemNode parent;
862 FileListing listing { path, extensions = extensions };
865 GetWorkingDir(startPath, sizeof(startPath));
867 strcpy(path, startPath);*/
872 //root = FileSystemNode { type = computer, loaded = true, childrenLoaded = true };
873 root = MakeFileSystemNode(FileStats { attribs = FileExists(path)}, path, path, bits.previewPictures, displaySystem);
875 //root.name = rootName;
876 AddTreeNode(root, true, false, null, list);
880 AddTreeNode(root, false, true, null);
882 // How can this make sense for linux?
884 while(listing.Find())
886 int len = strlen(listing.name);
887 char info[MAX_LOCATION];
888 char name[MAX_LOCATION];
889 if(listing.stats.attribs.isDrive &&
890 len > 3 && !strncmp(&listing.name[1], ": [", 3))
892 strncpy(name, listing.name, 2);
894 strncpy(info, &listing.name[4], len - 5);
899 strcpy(name, listing.name);
903 parent = MakeFileSystemNode(listing.stats, name);
905 parent.info = CopyString(info);
906 parent.loaded = true;
907 AddTreeNode(parent, !listing.stats.attribs.isDirectory, listing.stats.attribs.isDirectory, root, this);
908 if(!listing.stats.attribs.isDirectory)
909 parent.childrenLoaded = true;
912 node = FileSystemNode { name = msNetwork, type = network };
913 AddTreeNode(node, false, true, null, this);
914 node.row.collapsed = true;
919 list.Sort(nameField, 1);
922 void LoadTreeNode(FileSystemNode node)
926 char path[MAX_LOCATION];
929 FileListing listing { path, extensions = extensions };
930 if(node.children.count == 1)
931 DeleteNode(node.children.first);
933 while(listing.Find())
935 if((!bits.foldersOnly && !bits.filesOnly) ||
936 (bits.foldersOnly && listing.stats.attribs.isDirectory) ||
937 (bits.filesOnly && !listing.stats.attribs.isDirectory/*listing.stats.attribs.isFile*/)) // TOCHECK: isFile broken?
939 FileSystemNode child = MakeFileSystemNode(listing.stats, listing.name, listing.path, bits.previewPictures, displaySystem);
940 AddTreeNode(child, true, false, node);
941 NodeChildLoad(child, node);
945 node.childrenLoaded = true;
947 node.row.SortSubRows(false);
949 else if(!node.childrenLoaded)
951 FileSystemNode child;
952 if(node.children.first)
954 for(child = node.children.first; child; child = child.next)
958 else if(!child.childrenLoaded)
959 NodeChildLoad(child, node);
961 node.childrenLoaded = true;
962 node.row.SortSubRows(false);
967 void NodeChildLoad(FileSystemNode parent, FileSystemNode node)
969 char path[MAX_LOCATION];
970 parent.GetPath(path);
973 FileListing listing { path, extensions = extensions };
974 while(listing.Find())
976 if((!bits.foldersOnly && !bits.filesOnly) ||
977 (bits.foldersOnly && listing.stats.attribs.isDirectory) ||
978 (bits.filesOnly && !listing.stats.attribs.isDirectory/*listing.stats.attribs.isFile*/)) // TOCHECK: isFile broken?
980 FileSystemNode child = MakeFileSystemNode(listing.stats, listing.name, listing.path, bits.previewPictures, displaySystem);
981 AddTreeNode(child, true, false, parent);
988 //parent.childrenLoaded = true;
991 void AddTreeNode(FileSystemNode node, bool loaded, bool addLoader, FileSystemNode addTo)
993 DataRow row = (addTo && addTo.row) ? addTo.row.AddRow() : list.AddRow();
997 node.indent = addTo.indent + 1;
998 addTo.children.Add(node);
1000 row.tag = (int)node;
1002 row.SetData(null, node);
1004 node.loaded = loaded;
1006 //AddTreeNode(FileSystemNode { }, false, false, node); // why would this create a compile error?
1007 AddTreeNode(FileSystemNode { type = none }, false, false, node);
1010 row.collapsed = true;
1011 else if(node.type == folder)
1012 node.type = folderOpen;
1015 void DeleteNode(FileSystemNode node)
1017 FileSystemNode child;
1018 for(; (child = node.children.first); )
1020 list.DeleteRow(node.row);
1024 public class ClipBoardFiles
1038 int size = SelSize();
1041 // Try to allocate memory
1042 ClipBoard clipBoard { };
1043 if(clipBoard.Allocate(size+1))
1045 GetSel(clipBoard.memory, true);
1058 ClipBoard clipBoard { };
1059 if(clipBoard.Load())
1060 PutS(clipBoard.memory);
1071 SetViewToCursor(true);
1076 Private Type DROPFILES
1082 For iCounter = 0 To filelist.ListCount - 1
1083 If filelist.Selected(iCounter) = True Then
1084 strFiles = strFiles & FixPath(filelist.Path) & filelist.List(iCounter) & vbNullChar
1087 'all selected items are now put in strFiles
1089 hGlobal = GlobalAlloc(GHND, Len(DF) + Len(strFiles)) 'put all files to a exclusive number
1090 If hGlobal Then 'if the globalalloc worked
1091 lpGlobal = GlobalLock(hGlobal) 'lock the hGlobal
1092 DF.pFiles = Len(DF) 'set the size of the files
1094 Call CopyMem(ByVal lpGlobal, DF, Len(DF)) 'copy df to the lpglobal
1095 Call CopyMem(ByVal (lpGlobal + Len(DF)), ByVal strFiles, Len(strFiles)) 'copy strfiles to lpglobal
1096 Call GlobalUnlock(hGlobal) 'unlock hglobal again
1098 SetClipboardData CF_HDROP, hGlobal 'put files to the clipboard
1101 bool SaveFile(const char * filePath)