Quick Search for:  in language:    
Updated,Just,minor,stuff,cSuperClass,submissi
   Code/Articles » |  Newest/Best » |  Community » |  Jobs » |  Other » |  Goto » | 
CategoriesSearch Newest CodeCoding ContestCode of the DayAsk A ProJobsUpload
Visual Basic Stats

 Code: 3,014,970. lines
 Jobs: 119. postings

 How to support the site

 
Sponsored by:

 

You are in:

 
Login



Latest Code Ticker for Visual Basic.
CString v1.5
By Ultimatum on 7/2


Tablature Pro
By Michael McMullen on 7/2


Click here to see a screenshot of this code!MSN Password Decryptor
By Muhammad Sufyan Ansari on 7/2

(Screen Shot)

Mp3 Paker
By Michael McMullen on 7/2


Suppress Run Time Script Errors
By Nuclear_1000G on 7/2


Click here to see a screenshot of this code!List Maker
By KBM-00 on 7/1

(Screen Shot)

Web Update Checker
By knormalnight on 7/1


A*Beginners API*
By Michael Nipper on 7/1


source hog v1.1
By Robert Justason on 7/1


Click here to put this ticker on your site!


Add this ticker to your desktop!


Daily Code Email
To join the 'Code of the Day' Mailing List click here!





Affiliate Sites



 
 
   

Updated 3/07 - VB+ASM Subclass, Hook, Timer, Api-Window class thunks, w/ Form fade/shadow sample

Print
Email
 
winzip icon
Submitted on: 2/3/2003 5:25:46 AM
By: Paul Caton 
Level: Intermediate
User Rating: By 55 Users
Compatibility:VB 5.0, VB 6.0

Users have accessed this code 5694 times.
 
 
     Updated 3/07 - Just minor stuff --- My cSuperClass submission's download link appears broken so I thought it was about time I made a new entry. Just as Vlad Vissoultchev's excellent subclasser built on mine and added a hooking thunk, I've done likewise and added timer and api-windows thunks. Each of the thunks has an individual sample to demonstrate its use. If you're blessed with Windows 2000 or Windows XP check out the form shadow/fade user control. Credits: Thanks to Clint LaFever for the idea of a form shadow. http://www.exhedra.com/vb/scripts/ShowCode.asp?txtCodeId=42148&lngWId;=1 Thanks to Vlad for his superb subclass/hook thunks http://www.exhedra.com/vb/scripts/ShowCode.asp?txtCodeId=40518&lngWId;=1

 
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 Winzipto 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 2 submission(s) by this author

 

 
Report Bad Submission
Use this form to notify us if this entry should be deleted (i.e contains no code, is a virus, etc.).
Reason:
 
Your Vote!

What do you think of this code(in the Intermediate 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
2/3/2003 5:56:38 AM:Paul Caton
Sorry about the text formatting, I 
supose I should figure out how to html 
it. Enjoy!!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
2/3/2003 11:43:29 AM:Phantom Man
Out Standing!
5 *****
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
2/3/2003 12:13:36 PM:
just as i expected, excellent work 
:)
5 globes from me :)
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
2/3/2003 2:29:32 PM:Brian Battles WS1O
Fine job! 5 globes
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
2/3/2003 4:15:26 PM:
A long wait since your last submision, 
but it was worth it :D.
Thanks. 
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
2/3/2003 6:50:13 PM:Thushan Fernando
great work... i see this will be this 
months code of the month! we'll 5gz to 
get you there!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
2/3/2003 7:14:48 PM:sherif rofael
Really great work ,
But let me Say 
that Your code complicated me ,
how 
long have u been doing it ?
months 
man ?
In Addition , How long Have u 
been Doing VB ?
BTW , 5 Globes from 
Me.
Regards,
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
2/4/2003 3:42:08 AM:Ozan Yasin Dogan
Thank you Paul for your super 
performance tools. I would like you to 
write some MASM articles too. My 5G is 
allways for you ! :)
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
2/4/2003 2:01:57 PM:CodeFester
Cool submission.  Thanks for doing so.  
5 ballz w/o hesitation.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
2/5/2003 6:06:37 PM:Brio Networks
I was blown away, awesome code! 5 
globes from me.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
2/6/2003 9:31:26 AM:ORSHEE
I can notice that PSC is becoming a 
comunity gathering coders with great 
ideas and skills.
You're surely one of 
them.
Greetz and respect.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
2/6/2003 12:36:29 PM:Donathan Hutchings
Great Code! 5 globes from me.  Keep up 
the good work!!!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
2/8/2003 2:28:13 AM:
Hey pual, it would be nice if the 
cWindow class could have an events 
owner each window in a single class. 
this would save me having many 
instances of the same class just to set 
the .owner for differnt windows.
(i am 
useing this for a winsock api project 
so events need to be trigerd in 
differnt client classes)
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
2/8/2003 4:44:20 PM:Paul Caton
Re the winsock api dude/dudette... Why 
don't you email and explain how this 
would work. Can't you just Select Case 
hWnd in iWindow_WndProc ?
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
2/8/2003 4:50:17 PM:Paul Caton
Orzan, believe it or not I'm rubbish at 
assembler, I used to be pretty good on 
the Motorola 68000 cpu but when Intel 
started to dominate I learnt C rather 
than deal with the bizarre architecture 
that X86 was, it's better now with the 
flat memory model.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
2/8/2003 4:54:21 PM:Paul Caton
Sherif, I've worked for Microsoft 
(manufacturing) quite a bit over the 
years so I had a copy of VB 1 when it 
was still in beta (1991??), but just 
for fun, I didn't start to use it 
seriously until VB5 was released, up 
till then C/C++
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
2/8/2003 5:02:23 PM:Paul Caton
Thanks to all that voted, you'll be 
notified when I do an update. The alpha 
blended AND layered shadow is coming 
along nicely and is looking sweet, also 
performance using UpdateLayeredWindow 
for the shadow windows is that much 
better that i'm considering HideMove 
and HideSize defaulting to False.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
2/8/2003 8:59:52 PM:
Useing one window for all the sockets 
was a much better idea. lol, Thanks for 
making me feel foolish. hehe
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
2/14/2003 1:07:33 AM:joyprakash saikia
Hi paul,
Thank u for illustrating 
astounding power of VB inherited from 
legendy x86 instructions. It is really 
an awesome submission in PSC. It really 
deserves more than 5 globes. 
  I've 
faced one small unhandled exception in 
SHADOW control in Windows NT 4.0 with 
SP 6.0a. The Control was unable to 
locate "SetLayeredWindowAttributes" 
API in user32.dll. so It halts the 
application containing the Shadow 
Control.
So my suggestion is, If u 
handle the entry point of the 
unsupported APIs with OS version, then 
an application having shadow control 
can run on machines having win NT 4.0, 
Windows 95, windows 98 (1st edition) 
etc.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
2/15/2003 5:23:00 AM:Praveen Menon
Dus all hav Win2000?
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
2/15/2003 5:57:59 AM:Praveen Menon
Great code Paul.. nice work.. we should 
always  try to do work like these... 
but i dont have a Win2000 Machine to 
check the SetLayeredWindowAttributes 
API in action....
Sad for that.. 5 
Globes
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
2/15/2003 7:39:53 AM:Paul Caton
Joyprakesh, the issue is the use of a 
type lib. I shouldn't have used one for 
a function that may not exist on the PC 
because linked this way the windows 
program loader tries to resolve the 
call, fails to find it (Win9x, NT4) and 
bails the app. One of the few 
advantages of VB's Declare mechanism is 
that the link to the function is 
performed dynamically on call and thus 
you have the opportunity to skip making 
calls to functions that don't exist. 
Anyway, the UpdateLayeredWindow call is 
now out of the  type lib. Upshot being 
that the control won't display a 
shadow/fade on 9x/NT 4 - but it won't 
cause a problem running the app. Sorry 
about the issue, but it was initialy 
only written as a demo of the cSubclass 
and cWindow classes. Seeing as people 
want to use it I'll endevour to ensure 
that it's up to production standard. 
Check the update and let me know.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
2/15/2003 1:48:47 PM:Vlad Vissoultchev
paul, shadow is looking much better 
here now. i'm considering 
re-implementing my office xp menu 
shadows.
bugreport: shadow depths of 
4 and below
HTH,
</wqw>
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
2/17/2003 12:34:17 AM:joyprakash saikia
Thanx for your updates for win9x and 
WintNT 4.0 as well as the introduction 
of 
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
2/17/2003 12:35:44 AM:joyprakash saikia
"pLayered" Function for Accurate 
verification of the shadow effect.
Now It is running Properly with WinNT 
4.0 , Win2K and Higher.  
Cheers! 
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
2/17/2003 9:51:00 AM:
5 from me! This is awesome. 
I only 
have 1 problem though: If I compile and 
execute the Shadow program, the form 
fades on exit but the program stays in 
memory. Both on Win 2K and XP Pro. Any 
idea what I might be doing wrong? 
phred@qti.net
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
2/17/2003 11:48:52 AM:Paul Caton
It's not your fault, there seems to be 
an aliasing issue that I haven't yet 
tracked down. Go to compile options, 
click advanced and uncheck the aliasing 
checkbox - the problem will go away. 
Hopefully I'll find it soon and do an 
update.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
2/17/2003 11:51:22 AM:Paul Caton
Thanks Vlad, i've found the issue 
you're refering to. It would've helped 
if I had access to XP then I'd have 
seen it straight away. Update coming, 
but I'd like to try and find the alias 
compile optimization that's causing 
problems.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
2/17/2003 1:35:06 PM:
Thanks a ton.  I've been using Vlad's 
subclasser and menus like nuts.  Some 
more subclasser updates and a cool 
shadow effect will make my apps even 
cooler.  BTW 5 globes.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
2/17/2003 1:41:33 PM:Paul Caton
Update 2/17 - Fixed isssue with depth < 
5 on XP. Fixed issue with 'No Aliasing' 
compiler optimization. Detects Luna 
theme rather than just assuming if XP. 
Added IsLuna property. Detects and 
responds to display and theme changes 
on the fly.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
3/6/2003 12:06:11 AM:
Could you make a tutorial on how to 
make our own? personaly i would like to 
know how to edit the cWindow class. i 
have masm and know some basic asm. but 
i dont know where togo from 
there.
also useing typelibs for 
implemented interfaces? this is so 
awsome. but tutorial would be great 
too. i know your really busy so i wont 
hold my breath :P
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
3/6/2003 12:56:41 PM:Paul Caton
Not that busy... I'm currently looking 
for some work to keep me amused. I'll 
look into doing a tutorial soon.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
3/7/2003 2:59:16 AM:
awsome, thanks alot! :D
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
3/19/2003 6:20:15 AM:
any updates? *impatiant* 
lol
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
3/31/2003 8:40:56 AM:Alpha Binary
o_0 AWESOME!!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/4/2003 1:12:46 AM:TJ Rode
Paul, I need a hand if you don't 
mind...
I'm trying to hook system 
messages globally, such as the WD_MOUSE 
events, MOVE events, etc.  With the 
"Hooking" project, it seems only to 
accept messages related to the 
Thunder/VB project.  Any clues as to 
where I'm going wrong?  Thanks. (*****)
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/15/2003 8:50:38 AM:Defcon2
great!!! 5 globes from me.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/2/2003 4:12:21 AM:Bram Pelgrom
YEAAAAH! Does this mean that I can 
*FINALLY* experiment with subclassing, 
without having to worry about VB 
crashing? :D 5 Globies from me my 
friend! :P
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/12/2003 9:31:26 AM:
This is a nice control.  Only one 
disadvantage I found: When using this 
control in a MDI form the shadow 
coordinates will not fix to the MDI 
coordinates, instead it will follow the 
screen coordinates.  I will try to 
study the code and do the neccessary, 
but in case any one updated please send 
to my mail: abdullahosman@yahoo.com  
THANX ALL
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
5/14/2003 4:11:22 AM:Paul Caton
Re MDI - I probably shouldn't say this 
is impossible but I think it is. It's 
easy enoung to correct the coordinates 
but the problem is that for proper 
behaviour the shadow windows would need 
to be MDI children themselves and as 
far as I can tell the transparent 
extended style won't work on an MDI 
child. Feel free to prove me wrong.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
Add Your Feedback!
Note:Not only will your feedback be posted, but an email will be sent to the code's author in your name.

NOTICE: The author of this code has been kind enough to share it with you.  If you have a criticism, please state it politely or it will be deleted.

For feedback not related to this particular code, please click here.
 
Name:
Comment:

 

Categories | Articles and Tutorials | Advanced Search | Recommended Reading | Upload | Newest Code | Code of the Month | Code of the Day | All Time Hall of Fame | Coding Contest | Search for a job | Post a Job | Ask a Pro Discussion Forum | Live Chat | Feedback | Customize | Visual Basic Home | Site Home | Other Sites | About the Site | Feedback | Link to the Site | Awards | Advertising | Privacy

Copyright© 1997 by Exhedra Solutions, Inc. All Rights Reserved.  By using this site you agree to its Terms and Conditions.  Planet Source Code (tm) and the phrase "Dream It. Code It" (tm) are trademarks of Exhedra Solutions, Inc.