Important alert: (current site time 7/16/2013 2:46:50 AM EDT)
 

winzip icon

LaVolpe EZ Subclasser III

Email
Submitted on: 2/23/2007 5:06:30 AM
By: LaVolpe 
Level: Advanced
User Rating: By 59 Users
Compatibility: VB 6.0
Views: 21467
author picture
(About the author)
 
     Added missing RTF document. Now with Life Insurance. Gotta be the most stable, non-thunking, subclassing DLL around. Added GPF error trapping (automatic for IDE & user-opted for compiled apps). As before, more comments than code. Includes built-in tray icon, window size restriction, & system menu disabling capabilities. Compatible down to Win95. Plenty of examples & a QuickLook file for an overview of the functions/properties. Only one way to get familiar with it::Play. Be warned that if the message or button says it will crash, it WILL crash by design. Those examples given to prove the limitations of the DLL. Open vbg file for IDE samples, compile individual vbp files to test compiled capabilities too. Check back every now & again to see if updates posted. You will be informed right here: Last Updated: 31 Mar 10:30 by request, added a simple custom system menu example to the System Menu sample project. No changes made to the DLL. 22Feb07: Re-Added missing RTF QuickLook document.

 
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

3/11/2005 10:42:05 PMLaVolpe

Major change: GPF protection. This is such a huge plus that it was worth losing the 15+ previous votes to get the latest out to you guys/gals that may be using it already. Big Thanx goes to Alan (aka A|T) for pointing me in that direction & bearing w/me while troubleshooting it too. Also Thanx to Ed Porter for major help with v2.
(If this comment was disrespectful, please report it.)

 
3/11/2005 10:43:46 PMMatthew R. Usner

There. You got one of your votes back. :-)

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

 
3/12/2005 12:49:02 AMEd Porter

Thanks for the mention, but I wasn't much help! I still have not been able to crash V2 - I don't know how I will be able to test crash V3 (but I'll try!)

This is excellent, professional code. It is extremely easy to use and is very robust. Should definitely be in everyone's Hall of Fame. 5 stars!
(If this comment was disrespectful, please report it.)

 
3/12/2005 9:56:55 AMLaVolpe

Now remember folks. 99.9% of the dll limitations are applicable if the dll is NOT compiled. Compile it & it is almost crash proof, end statements or no end statements... If you want to code safely while subclassing compile the DLL and simply reference it in your project. While in IDE, you will still get the good GPF protection, end statements don't crash, and your IDE stays alive. Although I made every attempt to keep IDE alive if DLL is uncompiled; just can't do it without ASM thunking.
(If this comment was disrespectful, please report it.)

 
3/12/2005 9:58:54 AMLaVolpe

Ed, you were a big help. I no longer have 95 & never owned XP. Your help saved me the embarrassment of putting out a best guess product & simply hoping it would work. 'Cause of your help, I posted with confidence -- to me that is a big thing. A|T provided similar assistance with v3 & XP.
(If this comment was disrespectful, please report it.)

 
3/12/2005 10:00:50 AMLight Templer

Keith, don't think about the lost votes - trust in your fans ;-) ! Here are my 5 ***** once more and thx for the many hours you put in! LiTe
(If this comment was disrespectful, please report it.)

 
3/12/2005 11:45:21 AMMirko Kressmann

Nice Code. I aqm trying this the first time now and its well done. thanks for sharing.

Mirko ... 5 Big Globes from me
(If this comment was disrespectful, please report it.)

 
3/12/2005 3:26:15 PMLaVolpe

Minor change suggested. It will be changed next time I update this post and pertains primarily to compiled exes: 1) lvSubclasser.SubclassMe - chg optional parameter to gpfIDE + gpfCompiled vs just gpfIDE, 2) cInit.ResetGPFhandle - erase the "If gpfHandle Then" part so that the line executes every time. <> After more trial & error, compiled exes do not have an EH which means gpfHandle will be zero in that case & the IF statement will prevent DLL from replacing the GPF pointer of zero.

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

 
3/12/2005 5:43:32 PMLaVolpe

uploaded update to include above change
(If this comment was disrespectful, please report it.)

 
3/13/2005 5:41:04 PMScorcel

my 5 Globes from one of ur Fans!!!!
(If this comment was disrespectful, please report it.)

 
3/13/2005 10:34:48 PMLaVolpe

One small limitation (depends on needs) is that an hWnd can only be subclassed once. Major modifications needed to allow subclassing a single hWnd multiple times simultaneously (global class & internal routing routines). If I find the need to do this, haven't yet, I'll post a v4. In the meantime, if you wish to add that functionality & repost, feel free. Tip: if done, the DLL should allow multiple, simultaneous, subclassing on a single hWnd in same process & across multiple processes. One request please. If you repost w/your mods, specifically annotate what you have added or changed. I don't want to get blamed for something you did & you don't want to get blamed for something I did.
(If this comment was disrespectful, please report it.)

 
3/14/2005 10:57:19 AMAlT

Keith, all I did was point. You're the one who worked it all out. But, thanks or the props anyway. That said, I think this library is rock-solid and wouldn't hesitate to use it in a commercial application or any of my company's production applications. Also, I would add that even if you don't want to use this library for subclassing, you should still use it for the GPF Protection. Do any of you remember VB Crash Guard? Anyway, the GPF Protection will give you a starting point if your app begins to receive the kind of page faults you see sprinkled throughout the newsgroups. You can use the crash protection to help you figure out the problem and, if you're really good, allow you program to continue executing. If not, at least it can help you shutdown your application more gracefully than a windows page fault message box. This is actually quite a powerful library and it is all pure vb. Download it, learn it, use it!
(If this comment was disrespectful, please report it.)

 
3/14/2005 1:38:02 PMFrédéric Côté

I solved that problem long ago, each time I install VB6, I replace the play button with the "full compile" version :)
Also, do you sleep sometimes? You have 4 submissions in the top this month lol
(If this comment was disrespectful, please report it.)

 
3/14/2005 2:10:18 PMLaVolpe

Updated for minor fix; cFunctions had .rgbBytes(0) vs rgbBytes(0). If I followed my own advice & started project w/Ctrl+F5 would have seen it sooner. I'm sure most caught that one. In addition changed the way parameter are sent to your ProcessMessage event. The wParam & lParam are now byRef vs byVal; allowing you to directly change their values vs using ForwardMessage.
(If this comment was disrespectful, please report it.)

 
3/14/2005 6:56:28 PMCodeFester

5 more from me. Thanks again for sharing this brilliance.
(If this comment was disrespectful, please report it.)

 
3/16/2005 6:10:03 AMPhantom Man

Thanks Keith.
Brilliant Code.

Regards

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

 
3/16/2005 3:02:33 PMLaVolpe

Guys/Gals. Not all GPFs are the same. Using RaiseException as done in this project creates Access Violation GPF & easily trapped. Using CopyMemory to create Access Violation may not be recoverable--well not by this project. An update is in final testing stages to specifically trap for crashes triggered by API calls like CopyMemory. Regardless, not all crashes are recoverable & some, though trappable, will still crash. Facts of life.
(If this comment was disrespectful, please report it.)

 
3/16/2005 10:18:31 PMLaVolpe

Update uploaded to include above. Some big changes from what you originally downloaded. Please glance over the QuickLook file & refamiliarize yourself with GPF_Callback as it now requires a parameter to set the property. Short of some other code shortfall, this should be it for awhile. PS Quicklook big cause of embedded bitmap. Probably needs a little code cleanup (i.e., variables no longer used) & remarks updated -- when time permits
(If this comment was disrespectful, please report it.)

 
3/17/2005 4:29:29 PMGDuncan

Not the hardest decission I have had to make today. 5*
(If this comment was disrespectful, please report it.)

 
3/20/2005 10:25:46 AMOricron

straight 5 ;)

How is your LaVolpe Custom Windows: Part II & III doing? we're still anxious and there was not much heard about it?
(If this comment was disrespectful, please report it.)

 
3/21/2005 10:51:39 AMRichard Mewett

Definitely one of the best uploads ever. This is sublime! 5 *
(If this comment was disrespectful, please report it.)

 
3/21/2005 6:02:06 PMDean Camera

Truly Brilliant. Keep it up LaVolpe, your a rare gem in a sea of dogy code(ers)!

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

 
3/24/2005 6:43:14 AMLight Templer

Good to see that PSC admins got this back.
(If this comment was disrespectful, please report it.)

 
3/24/2005 5:57:01 PMDarryn Frost

D@mn you, you slimy genius coder, taking my votes! :P

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

 
3/26/2005 5:44:14 AMDean Camera

^...Not to mention mine! Ah well, we're all (You, LaVolpe and Me) are in the top 3 - prizes all around! I'll shout you a drink in 2 years when I turn 18 ;).

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

 
3/26/2005 4:23:49 PM_Merlin_

Hi Keith,
Probably again one of your ingenious codings. ;)

Five balls from me.

Merlin is the name, and logic is my game...
(If this comment was disrespectful, please report it.)

 
3/26/2005 4:25:56 PM_Merlin_

You state: 'You will be informed right here: Updated: 16 Mar 2130.'
I'm not sure I will live long enough to see that update... ;)

Merlin is the name, and logic is my game...
(If this comment was disrespectful, please report it.)

 
3/26/2005 4:28:27 PMLaVolpe

Merlin, :) Old habits die hard. 2130 is military/24hr clock. Thanx for the laugh, needed that.
(If this comment was disrespectful, please report it.)

 
3/29/2005 3:55:29 AMFunny Dog

Probably the best subclassing code you ever done.

Brilliant, thanks for sharing.*****
(If this comment was disrespectful, please report it.)

 
3/29/2005 3:56:52 AMFunny Dog

Correction.
The best subclassing code ever done.
(If this comment was disrespectful, please report it.)

 
3/31/2005 10:30:49 AMLaVolpe

real minor update for sample project only, not the DLL. Added example of appending custom menu item to the system menu & test for user-clicks.
(If this comment was disrespectful, please report it.)

 
4/2/2005 8:09:15 PMMatthew R. Usner

Congrats on your 3,000th contest win!
(If this comment was disrespectful, please report it.)

 
4/5/2005 1:50:29 AMRoger Gilchrist

Congratulations, well deserved
(If this comment was disrespectful, please report it.)

 
8/31/2005 9:06:32 PMMoroco

Excellent code . This is one of the greatest code i have ever seen on psc .
(If this comment was disrespectful, please report it.)

 
2/23/2006 12:12:03 AMLaVolpe

To all. I am no longer supporting this project. There is nothing wrong with it (to the best of my knowledge). However, recent collaboration with Paul Caton and seeing what he is accomplishing thru his newest thunks, I am now a convert -- thunking is the way to go IMO.
(If this comment was disrespectful, please report it.)

 
1/5/2007 7:15:07 AMkerplunk_boy

To be very honest, I've just opened this because it says "By: LaVolpe". So it MUST be good stuff, and i'm not disapointed! Dude as always, good work! 5 globes!
(If this comment was disrespectful, please report it.)

 
2/25/2007 9:42:31 AMBasak Karpuz

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

 
2/26/2009 1:38:00 PMBrowner87

I'm not sure what is causing this problem in my program, but I think it has something to do with your DLL. Whenever I restore my window (of my program) from maximized, it loses ALL skinning from Windows XP i.e. the title bar and stuff all lose their XP skinning. Do you have any idea what this might be?
(If this comment was disrespectful, please report it.)

 
2/26/2009 1:40:10 PMBrowner87

sorry - it's not just when I restore from maximized. It just seems to happen randomly during resizes. But it also happens EVERY time I use the 'restore' button on the title bar.
(If this comment was disrespectful, please report it.)

 
2/26/2009 2:21:25 PMBrowner87

it seems to happen whenever the forum tries to become smaller that 1200ish pixels (about 18,000 twips) wide or 575 pixels high, but I think now that it is some other code. Sorry for the bother.
(If this comment was disrespectful, please report it.)

 
2/26/2009 8:49:06 PMBrowner87

Is this class capable of sublassing other programs, or only the project that is referencing and using it's code?
(If this comment was disrespectful, please report it.)

 
6/21/2009 9:44:28 AMLaVolpe

This DLL is only capable of subclassing a window within the project using the DLL. This DLL does not attempt to nor is it capable of subclassing other programs.
(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.