Important alert: (current site time 7/16/2013 2:36:34 AM EDT)
 

winzip icon

LaVolpe Desktop Icon Tweaks (Finished)

Email
Submitted on: 5/24/2006 3:23:15 AM
By: LaVolpe 
Level: Advanced
User Rating: By 25 Users
Compatibility: VB 5.0, VB 6.0
Views: 24645
author picture
(About the author)
 
     Desktop subclassing with VB. An icon uber-tweaker. FINAL CUT barring bugs. Per-Icon color & caption settings transforms a blah desktop to something pretty nice. Other options and tools are included with the project. =========================== This project put together to highlight the flexibility of VB. The effects are accomplished by subclassing the desktop. The DLL used to subclass the desktop is created in VB, the DLL used for injection into the desktop (global hooking) is the same DLL. =========================== Well, I can't upload compiled DLLs on PSC, you will have to compile the hybrid DLL yourself. I have included instructions on 2 ways to accomplish this: an easy way & the hard way (my way). Unzip the file using "Use Folders" option because this is 3 projects in one. =========================== Updates: 15May05::Fix issues reported by Steve and others; DLL was not coloring text & was result of DLL typo. 17May05::added save/restore/un-restore icon positions, tweaked GUI, & enabled removal of injected DLL. 17May05::found/fixed bug that can crash when items sent to recycle bin. InstallDLL function now does version check before install. Fixed losing saved icon positions on startup & ability to toggle AutoArrange on NT & 9x. 20May05::Reworked RebuildListView to prevent NT icons from unrestoring in some cases, added more options, tweaked GUI. 24May05:: Fixed auto-icon restore after display res change & a couple minor bugs. ======================= Always destroy your previous version of this project & run the TxtToBin to create compiled DLLs or compile them yourself. As of this upload, the frmDTop will have the required DLL version nr to help reduce any confusion. This version & any future updates will have 2 DLLs. One is simply used to remove the injected DLL. Read comments in Declaration section of frmDTop & also the HowToSetup.rtf file.

 

Windows API/Global Declarations:

Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
'**************************************
'Windows API/Global Declarations for :LaVolpe Desktop Icon Tweaks (Finished)
'**************************************
Dozens
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.
  3. Scan the source code with Minnow's Project Scanner

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.


Other 72 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Advanced category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments

5/12/2006 5:34:30 AMGh€ttoWarr!or

No icons found on desktop
(If this comment was disrespectful, please report it.)

 
5/12/2006 8:20:07 AMLaVolpe

What O/S version? Not tested with multiple desktops. If others are having problems, please post or email me. I'm not sure I want to "finish" this project; just wanted to prove I could subclass a different process using only VB.
(If this comment was disrespectful, please report it.)

 
5/12/2006 8:59:05 AMLaVolpe

Oh and if you skipped thru my remarks in the description above, you are undoubtedly receiving errors. Open and read the HowToSetUp.RTF file. It will explain exactly how to compile the DLL. When I repost updates, I'll fix that ubber to an uber so LiTe doesn't get on my case ;)
(If this comment was disrespectful, please report it.)

 
5/12/2006 9:59:00 AMDonB

No icons found on desktop. Version 5.1 XP
(If this comment was disrespectful, please report it.)

 
5/12/2006 10:57:54 AMCarles P.V.

Oops! Same problem here (Windows XP). However, the problem starts on retrieving ListView handle (0). This can be solved by changing '""' by 'vbNullString' (GetDeskTopIconColors->FindWindowEx...). Unfortunately, I can't get this working on XP. If you want, I can perform some particular tests, checks. Please, let me know. (By the moment, I'm not receiving any message at zWndProc1).
(If this comment was disrespectful, please report it.)

 
5/12/2006 11:08:28 AMCarles P.V.

Anyway, this is really cool! If this correctly works on W9x systems, a nice implementation could be 'emulate' a XP feature that allows 'snap to grid' icons. Also it would be interesting that were possible to 'memorize' some 'icon-position' layouts...
(If this comment was disrespectful, please report it.)

 
5/12/2006 12:10:54 PMLaVolpe

Thanx guys. vbNullString (slamming forehead!!) Carles thanx for offering & I'll take you up on it. If the hListView handle is zero, that explains a lot! P.S. FindWindowEx is also used in the DLL & I needed to fix that too.
(If this comment was disrespectful, please report it.)

 
5/12/2006 12:16:28 PMLaVolpe

Patch updated & hopefully XP users will see results.
(If this comment was disrespectful, please report it.)

 
5/12/2006 1:09:11 PMCarles P.V.

Results seen on XP :-)
(If this comment was disrespectful, please report it.)

 
5/12/2006 2:16:01 PMSnerf

This is really cool, have not seen anything done like this before. Would be fun to expand on it.
(If this comment was disrespectful, please report it.)

 
5/12/2006 2:22:45 PMLaVolpe

Carles thanx for helping troubleshoot. For all others, the save/restore icon positions isn't included cause I havent' finished writing those routines yet. I want it to do more than just that. Will update this post as more errors are noted and/or I get more options tested. Curious if anyone can test this on a multi-desktop system and let us know if it works. If it doesn't we can work together to make it so.
(If this comment was disrespectful, please report it.)

 
5/12/2006 6:06:05 PMMe

Good Code ..
(If this comment was disrespectful, please report it.)

 
5/14/2006 5:51:25 AMaz1d

"LaVolpe Desktop Icon Tweaks" is a risky title, if I hadn't seen that you were the author I would never have looked. "Subclassed Desktop" would attract more attention?

Anyway, despite that - great idea and well executed.

-az1d
(If this comment was disrespectful, please report it.)

 
5/14/2006 9:20:01 AMEvilgenious

after running it says, Failed to initialize. critical error reported. I have XP with SP2.
(If this comment was disrespectful, please report it.)

 
5/14/2006 11:07:39 AMLaVolpe

Evil Genious, ensure DLL is in system folder. That is the only way I know of to get that specific error. Feel free to remove the On Error statement in the Form Load and step through the code. You should get DLL not found error then.
(If this comment was disrespectful, please report it.)

 
5/14/2006 3:35:58 PMLaVolpe

Note: If re-downloading, ensure you recompile the DLL; it has changed and the main app not compatible with prev vesion of DLL and vice versa.
(If this comment was disrespectful, please report it.)

 
5/14/2006 4:11:19 PMGh€ttoWarr!or

my whole desktop is flickkering

when i run you project
(If this comment was disrespectful, please report it.)

 
5/14/2006 8:40:35 PMLaVolpe

Ghetto Warrior. Use taskmanager to kill Explorer and restart it. Now, did you run the TxtToBin project to recompile the DLL and remember to put it in your system folder? If not, that could explain why. I just downloaded this zip & ran it from scratch; no flickering. Recommend deleting any previous version you may still have & try again. Sorry for the inconvenience. If you still have the same problem, please email me the DLL and 2 .TXT files so I can test it out too.
(If this comment was disrespectful, please report it.)

 
5/15/2006 2:28:45 AMZhu JinYong

I can see the right click add-in menu on desktop.But doesn't see any appearence effect at all on my XP (English) SP2.
(If this comment was disrespectful, please report it.)

 
5/15/2006 3:53:55 AMSteve

Still no results for me on XP SP2. Icons are listed in the listbox, but changing the text color doesn't work. I notice that the icons flicker when I reset all to system colors, but can't see any other effect. :(
(If this comment was disrespectful, please report it.)

 
5/15/2006 8:22:01 AMLaVolpe

^^Zuh & Steve answered off line. Think this may be an individual issue.
(If this comment was disrespectful, please report it.)

 
5/15/2006 1:39:08 PMJohnGalt

Interesting idea, Keith, and I look forward to seeing it in action. Unfortuantely, I have the same experience as Zhu & Steve. Am running XP-sp2 as well. Your app does change captions, but not colors. When I try to "apply" color changes, selected icon flickers briefly, but no caption change. BTW, I used the "easy TXTtoDLL" method, and followed your intructions (copied DLL without registering it to WINDOWS\SYSTEM32), copied TLB. Regards.
(If this comment was disrespectful, please report it.)

 
5/15/2006 4:12:16 PMLaVolpe

John thanx for the feedback & help. Although I think is should work, your dropshadow settings may have an effect. Will follow up more. For all other, troubleshooting a compiled DLL is extremely difficult, bear with me.
(If this comment was disrespectful, please report it.)

 
5/15/2006 4:20:42 PMSteve

Sorry, Keith - still no luck, even with the latest version. No colour change, just a short flickering of the icons on XP SP2. Am definitely using the latest version.
(If this comment was disrespectful, please report it.)

 
5/15/2006 9:12:35 PMZhu JinYong

Lavolpe,you are true.My XP got effect now after this updatation.Thanks.
(If this comment was disrespectful, please report it.)

 
5/16/2006 3:11:29 AMSteve

Keith: yes, you are right. This only works on XP when in 'System Properties' >>> 'Visual Effects' the 'Transparent Background for Desktopicon texts' is **NOT** enabled. Otherwise is has no effect. :)
(If this comment was disrespectful, please report it.)

 
5/16/2006 8:31:18 AMLaVolpe

Great! Now to concentrate on updates. Appears I figured out how to remove DLL from injected process when no longer needed, just about finished the save/restore icon positions, making minor GUI mods and will post in a couple of days.
(If this comment was disrespectful, please report it.)

 
5/17/2006 9:03:23 AMSoorya

Hi, Can any one successfully move windows XP Taskbar to any side by VB6 coding ? It seems very difficult task.

soorya
(If this comment was disrespectful, please report it.)

 
5/17/2006 2:50:34 PMLaVolpe

Found a bug (can crash when compiled & sending icons to recycle bin); fixed as of this date/time.
(If this comment was disrespectful, please report it.)

 
5/17/2006 5:31:49 PMLaVolpe

And another bug found: command to toggle AutoArrange desktop works in 9x but not NT; trying alternatives. Stored icon positions may be ignored when read from INI; will patch that too.
(If this comment was disrespectful, please report it.)

 
5/17/2006 10:10:55 PMLaVolpe

Patched main app (no DLL changes this time) to overcome bugs I reported above.
(If this comment was disrespectful, please report it.)

 
5/18/2006 9:02:35 AMaz1d

I can't believe I didn't think of the autohide desktop idea. It's one of those things that changes your daily computer use for the better.

I only slightly modified the main program so that it runs "invisibly" by default, and doesn't have a system tray icon (I have plenty there as it is). I used some activate PrevInstance code so that I can access the configuration by running the exe a second time.

I hope you continue to work on this project, as even though it was meant to be a subclassing example, this project will probably become part of my base install for windows.

-az1d
(If this comment was disrespectful, please report it.)

 
5/18/2006 9:36:27 AMLaVolpe

az1d, I will continue to patch new bugs but not sure how far I want to take this. XP for example has some niffty new settings that override anything we do via subclassing. In fact some of the XP settings conflict as reported in MSDN. Keep this in mind before you add it to your base installs. The desktop is very iffy. Trial & Error is how I found when I can modify & when I cannot in order to prevent crashes. I am now tweaking some really minor issues and will repost them this weekend unless a bug shows up prompting a sooner post.
(If this comment was disrespectful, please report it.)

 
5/21/2006 12:53:33 AMLaVolpe

Restoring icons to new screen ratio when screen resolution changes is broke again. Will work that tomorrow & reupload patched project.
(If this comment was disrespectful, please report it.)

 
5/21/2006 3:46:05 AMSebastian Mares

What does un-restore actually do?
(If this comment was disrespectful, please report it.)

 
5/21/2006 9:18:33 AMaz1d

I'm getting uncomfortable commenting out if statements and blocks of code that reference the system tray, just so that I can run the program invisibly.

Any chance of better support for an "invisible mode" that doesn't use a system tray icon?
-az1d
(If this comment was disrespectful, please report it.)

 
5/21/2006 9:27:17 AMaz1d

Sorry about previous comment, just found the "do not show in system tray" option.

However a few procedures you might want to remove (dead code):
sc_Terminate, sc_DelMsg, sc_CallOrigWndProc, zWndProc1, sc_UnSubclass, zDelMsg

-az1d
(If this comment was disrespectful, please report it.)

 
5/21/2006 2:29:39 PMLaVolpe

Sebastian, un-restore is meant to move icons back to previous position just before you hit the restore button. az1d, zWndProc1 is heavily used and the others will stay. Should I want to revisit this in a year or so, and want to add/change functionality, I want Paul Caton's thunk code (all of it) at my disposal vs worrying about version issues a year later. As always feel free to tweak & modify to suit your needs.
(If this comment was disrespectful, please report it.)

 
5/23/2006 6:07:51 AMgrigri

Very nice indeed. Just a quick point though - you don't have to create a standard dll for shell injection - if you have a public class that implements IObjectWithSite (simple TLB) you can load it in the shell process with SHLoadInProc(). Unloading it might be a problem though...
(If this comment was disrespectful, please report it.)

 
5/23/2006 9:19:51 AMLaVolpe

grigri, you are absolutely correct. However, the real intent of this project was to show dll injection can be accomplished with just VB and this is one way to show usability. P.S. For everyone, I fixed the screen resolution change icon restoration, but have come across another strange anomoly, in some cases, causing VB to report screen.width = screen.height even though they really aren't the same. Troubleshooting that before I post with the latest updates. P.S. Until I update posting, ensure each .FindItem in RebuildListView routine uses the Index param set to iOffset (one of the calls do not). If Recycle Bin icon changes, can cause routine to infinite loop.
(If this comment was disrespectful, please report it.)

 
5/23/2006 9:54:38 AMT Jackson

That's officially the tidiest and most readable code I've ever seen.
(If this comment was disrespectful, please report it.)

 
5/24/2006 9:00:36 AMRussell Sanders

Good work as always. Thanks and here are the balls *****
(If this comment was disrespectful, please report it.)

 
5/24/2006 9:10:03 AMLaVolpe

All known bugs addressed. Maybe it is good to go, if not, only minor mods should be needed. Enjoy.
(If this comment was disrespectful, please report it.)

 
5/26/2006 10:02:13 AMaz1d

This version now crashes whenever I run a game. Previously it did not.

"The exception Floating-point inexect result."

-az1d
(If this comment was disrespectful, please report it.)

 
5/26/2006 9:06:13 PMLaVolpe

^^ Responded off line. Will post update if needed.
(If this comment was disrespectful, please report it.)

 
7/20/2006 4:01:52 PMMark J.

this one is just great! (as always)
2 "bugs":
after i ran the texttobin
i receive this error message when i start vb:
Error -2147467259 - Method '~' of object '~' failed

not sure if it is a bug or a "feature"
whenever i click on "Flash" an icon is added to the list syncronous with the flashing (with the same name)
and removed when the flash is gone
(If this comment was disrespectful, please report it.)

 
1/1/2007 9:47:23 AMJoaquin Marcher

rly good code friend! you are the best in VB
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.