Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Visual Basic .NET (http://www.programmingforums.org/forum19.html)
-   -   A new project? (http://www.programmingforums.org/showthread.php?t=6217)

brokenhope Oct 2nd, 2005 5:26 PM

A new project?
 
What I want to make is a file explorer, one very very similar to the one that comes with Windows XP, give and take a few features. The reason I dont like windows file explorer is that in some directorys I will get a message it cant read the data at line whatever and it crashes, closing all open explorer windows, and explorer.exe, which means that everything locks up, I have to restart explorer and the user32 isnt functioning properly so I cant open and close my old windows like I usually can, with the tabs on the start bar only will work to maximize not minimize, and I have to use the minimize maximize close tabs on the window to function... you get my point it messes everything up badly.

I want to create an alternative in VB.NET that does nearly the same exact thing, adding in image browsing functions, rememberance of settings on directorys, mass setting setter (sets specific settings to many directorys), and a way to almost completely prevent it from crashing like windows file explorer does.

Is this possible? I mean I want the same look and feel of it, just diffrent features, if I cant get the exact look and feel, then something very similar will be fine. Do you think this will be a lot of work? Some things can be left out, like thumbnailing videos, the small little thumbnail view does nothing, having icons for each file works just fine...

Sane Oct 2nd, 2005 6:48 PM

If something is that wrong with your Windows, chances are your program won't be an able solution for it.

Other then that, it should be a decent challenge and I wish you good luck! ^_^

brokenhope Oct 2nd, 2005 6:59 PM

Its not usually wrong with it, its just when explorer.exe crashes, which I think windows file explorer is a part of, and it crashes whenever the warning, cannot read from blah in blah or whatever, and gives me the option of debug or ok, and it crashes... ive read that there are some bugs in windows file explorer so the crashing isnt unusual, but maybe the window problems after explorer crashes is... idk.

I just want to make a program just like it, maybe even somehow add or modify the link to "create shortcut" to make the shortcut run to my explorer program not windows.

Rory Oct 3rd, 2005 4:20 PM

Tools -> folder options -> tick "Launch folder windows in a separate process".
Or check out nautilus for windows, etc. :)

brokenhope Oct 3rd, 2005 9:17 PM

Alright cool, ok I have a question already X_X.

What control can I use to display the files? or how do I do it? Like Windows Explorer has where you select the file and it highlights and everything etc... and the icon thing. Is there a specific control or do I just have to write some code that loads icon images and positions the text below the image, and just go off that?

brokenhope Oct 4th, 2005 5:53 PM

Actually this is eaiser than I thought.

I used the listview component. I already have it to display all the files in the current directory, and a address bar type thing (that currently doesnt save past addresses, or have a "tree" of directorys in your computer), but you can type the address and hit enter and it works.

It displays icons for specific files, I only have 5 icons though, image, text, compressed, unknown, and folder.

Which brings me to my question, is it possible that I can access the windows icons. Like the library windows has of the icon image for a file type. Like windows icon for folder, its icon for .txt file, its icon for .jpg, its icon for .mp3, etc, and use those?

Silvanus Oct 4th, 2005 6:07 PM

The files are probably in one of the Windows system dlls. I don't know which one, but that might be a start.

Dameon Oct 4th, 2005 7:25 PM

There is a Windows API call for retreiving the icon for a specific filetype.

Note however that are several issues with trying to replace Explorer:
1. Any and all shell extensions (Including built-in Zip support) will not work with your tool
2. It will almost certainly be more crash prone than Explorer
3. Explorer.exe also doubles as the shell, so say goodbye to your Start button, taskbar, and system tray. You can use a replacement shell such as Blackbox or add it to the stack of things for you to do.
4. Your implementation will have to end up replicating a lot of configuration settings if you plan on having others use it.
5. You will have to have an interface to change NTFS permissions
6. Browsing Samba networks is also facilitated by Explorer.

I would go with Rory's suggestion. It should improve stability signifigantly. Also consider that the crashes are more than likely a product of outside influences (anything from virii/adware/spyware to poorly written shell extensions) and/or the tendency of a Windows installation to degrade over time.

brokenhope Oct 4th, 2005 7:30 PM

I dont think you understood what I was doing.

I wasnt trying to replace explorer.exe, I was trying to replace the file explorer impliment. You know when you click a folder or something on your desktop and it opens the file explorer, thats what im re-creating. I think the one windows uses by default is built into explorer.exe though, and thats why every time that crashes everything crashes, so I just want to make an outside application file browser program.

Do you know the windows api call for getting the icon of a specific file type?

All I could find is this icon class which gets the system icons, not the ones actually used currently with the system, http://www.freevbcode.com/ShowCode.Asp?ID=5174 is where its at, Im using it now and it works alright, but a couple of problems, I cant get the image of an icon to see if it exists in the imagelist, and actually thats all. I could convert the icon to a bitmap, if only I knew how X_X, but thats the least of my worries, I want up to date current icons that are actually used, not the original ones.

Rory Oct 5th, 2005 8:58 AM

There does seem to be little point in writing yet another file manager, but...

I'd use ExtractAssociatedIcon which will return a pointer to an icon resource and requires the path of the file/drive/folder, and some parameters dictating the size, style (icon, thumbnail etc) - check msdn for the details. Then you can paint straight to a valid DC with this pointer using DrawIcon, so if you're using the ListView control you can paint straight to the DIBs in that or an attached ImageList control, but if you prefer you could marshal it as a .NET bitmap first and paint using the GDI+ (which seems to give little benefit at a high speed penalty).

I followed this API approach for a web-based directory lister that showed specific as opposed to generic filetype icons, but I bet there's something built in to .NET that'll get the explorer file icons for you, as its quite a common task. Dameon? :)

Of course if it was going to be a proper file manager not relying on explorer, you'd generate the icons yourself like konqueror.


All times are GMT -5. The time now is 6:12 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC