Changeset 293
- Timestamp:
- 3/25/2008 12:39:31 PM (5 years ago)
- Location:
- branches/eraser6
- Files:
-
- 2 edited
-
Eraser/TaskDataSelectionForm.cs (modified) (1 diff)
-
Util/File.cs (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eraser6/Eraser/TaskDataSelectionForm.cs
r283 r293 45 45 DriveItem item = new DriveItem(); 46 46 item.Drive = drive.Substring(0, drive.Length - 1); 47 item.Label = Eraser.Util.File.GetFileDescription(item.Drive); 48 item.Icon = Eraser.Util.File.GetFileIcon(item.Drive); 47 item.Label = Eraser.Util.File.GetFileDescription(item.Drive + 48 Path.DirectorySeparatorChar); 49 item.Icon = Eraser.Util.File.GetFileIcon(item.Drive + 50 Path.DirectorySeparatorChar); 49 51 unusedDisk.Items.Add(item); 50 52 } -
branches/eraser6/Util/File.cs
r292 r293 78 78 /// </summary> 79 79 /// <param name="path">A string that contains the path and file name for 80 /// the file in question. Both absolute and relative paths are valid.</param> 80 /// the file in question. Both absolute and relative paths are valid. 81 /// Directories and volumes must contain the trailing \</param> 81 82 /// <returns>A string containing the description</returns> 82 83 public static string GetFileDescription(string path) … … 93 94 /// </summary> 94 95 /// <param name="path">A string that contains the path and file name for 95 /// the file in question. Both absolute and relative paths are valid.</param> 96 /// the file in question. Both absolute and relative paths are valid. 97 /// Directories and volumes must contain the trailing \</param> 96 98 /// <returns>An Icon object containing the bitmap</returns> 97 99 public static Icon GetFileIcon(string path) 98 100 { 99 101 SHFILEINFO shfi = new SHFILEINFO(); 100 SHGetFileInfo(path + "\\", 0, ref shfi, Marshal.SizeOf(shfi),102 SHGetFileInfo(path, 0, ref shfi, Marshal.SizeOf(shfi), 101 103 SHGetFileInfoFlags.SHGFI_SMALLICON | SHGetFileInfoFlags.SHGFI_ICON); 102 104 return Icon.FromHandle(shfi.hIcon); … … 399 401 } 400 402 403 [StructLayout(LayoutKind.Sequential)] 401 404 private struct SHFILEINFO 402 405 {
Note: See TracChangeset
for help on using the changeset viewer.
