Quick Search for:  in language:    
RECT,endeavor,make,weather,program,computer,w
   Code/Articles » |  Newest/Best » |  Community » |  Jobs » |  Other » |  Goto » | 
CategoriesSearch Newest CodeCoding ContestCode of the DayAsk A ProJobsUpload
Visual Basic Stats

 Code: 3,011,557. lines
 Jobs: 115. postings

 How to support the site

 
Sponsored by:

 

You are in:

 
Login



Latest Code Ticker for Visual Basic.
CAPS Trigger
By Trevor Burley on 6/30


Auto clip picture
By Kenneth. Jakobsen on 6/30


Click here to see a screenshot of this code!Game of life clone (cool math)
By Johannes B on 6/30

(Screen Shot)

String to CHR()
By Nikhil Raj on 6/30


Encryption Decryption Demo
By Nikhil Raj on 6/30


Click here to see a screenshot of this code!Serial Registration
By Christian (eXonite Team) on 6/30

(Screen Shot)

Click here to see a screenshot of this code!Danger:Can pc kill me? interesting article
By Xasan on 6/30

(Screen Shot)

AniViewer
By Jerrame Hertz on 6/30


Click here to see a screenshot of this code!Raw Packet Sniffer
By Coding Genius on 6/30

(Screen Shot)

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



 
 
   

Put a form (or any window) in the TRAY! [Updated #4]

Print
Email
 
winzip icon
Submitted on: 4/12/2001 10:59:07 PM
By: Jay  
Level: Advanced
User Rating: By 14 Users
Compatibility:VB 4.0 (32-bit), VB 5.0, VB 6.0

Users have accessed this code 10915 times.
 
(About the author)
 
      In my endeavor the make a weather program for my computer that would scroll weather information, I came to make this code. I was looking for a place to scroll the information without bothering any other programs and without the form taking focus. I was looking for the perfect place. I found it but it was of course occupied by something else. That something else was the task tray (Those small little icons and the clock in the bottom right hand corner of most windows computers). Well I said to myself how shall I take that area. I thought I would simply shape my form to that of the trays window. Then make my form a child of that window and set it's position to the topmost. Well my idea was correct and it works perfectly. You can use this technique for any window, it is far less involved then many other attempts witch require sub-classing. The window will resize to the RECT of the tray when the Task bar is resize and or moved and call the form to repaint also. I hope all of you can get something useful out of this I know have. *NEW* YOU can now resize the tray by doing a call ResizeTray (Number to resize by,A 1 or a 2 for rither making it larger or smaller) so call resizetray 11,1 would add eleven icons to the tray and call resizetray 11,2 would subtract eleven icons

 
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 18 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 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
4/12/2001 11:20:12 PM:Pure
I hope you guys/gals all love this 
code.  If you have any questions 
comments don't be afraid to post them.  
If you use the program please vote for 
it, it always makes authors feel good 
:) and encourages them to release more 
stuff!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/13/2001 2:29:23 AM:Edwin Vermeer
You get 5 globes from me. I will 
definitely use this in one of my 
applications. Maybe you have an answer 
to a similar problem that I have. I 
have an application (in Dutch, see nice 
screenshots at 
http://www.beursmonitor.com) with does 
a lot with stock quotes (including a 
couple of tickertapes) Using your code 
for an other tickertape would be a nice 
extra. Currently I have a tickertape 
which is using a timer to reposition a 
form over the titlebar of any active 
application. This is disturbed a bit 
when the processor is 100% occupied. I 
already tried the SetParent function 
but this does not work (MSDN tells me: 
The new parent window and the child 
window must belong to the same 
application) Zo how come your's is 
working? One other thing: You can make 
the scrolling text look very nice by 
using a very easy to use textanimation 
control I wrote. Just have a look at 
http://www.planet-source-code.com/xq/ASP
/txtCodeId.14615/lngWId.1/qx/vb/scripts/
ShowCode.htm
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/13/2001 3:27:36 AM:Pure
Well that's because the MSDN 
information is wrong :).  It works 
because my application is not it's own 
parent but a child of another window 
this allows the main application to be 
able to send the window the calls to 
change the text resize the lables ect.  
You'll run into a problem if you try to 
take a child form and set it's parent 
to 0 and try to make it it's own 
parent.  It will work but it will 
effectivly sever the link between the 
actually running program and the 
graphical window.  So nothing will 
update and your program will crash.  
Thanx for the scrolling text thing by 
the way :).  Am I understanding you 
right that your positioning the form 
over the titbar area to display info?  
What Information are you displaying?  
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/13/2001 3:29:13 AM:Jay
I have an Idea.. 
Have your form 
watch for the currently active window 
as it does now second have it check to 
see if the window state is not 
minimized if its not minimized then the 
person can see the title bar have the 
form then position itself over the 
titlebar.  Now when the form is 
minimized or losses focus the form will 
either move to the next active window 
or hide while the form is minimized.  
This will help a little in cutting down 
on resources.  On the other hand if 
it's just text you want displayed you 
could just change the caption of the 
currently active window to that of your 
text.. not sur eif this will do what 
you want but if you need help or if im 
just not egttig what your saying e-mail 
me at nemopsj@aol.com I'll try to help 
you out.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/13/2001 8:10:12 AM:Mark Robert Strange
You gotta love this...5 globes all the 
way.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/13/2001 10:40:15 AM:Edwin Vermeer
Thanks for the info. I will defenitely 
try this. I am using it in combination 
with the textanimation control to 
display the current stock quotes in the 
titlebar of the active application. 
When I will get it to work as a child 
form I will strip it form my 
application and post it on PSC.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/13/2001 11:10:54 AM:oSiruS2685
All I gotta say is that this is sweet.  
Definitely a 5er.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/17/2001 2:19:16 AM:Edwin Vermeer
Hi, I tried the setparent but then even 
if i set the window to the topmost it 
wil be displayed behind the titlebar. 
So i don't thinkt that a parent child 
relationship will work in my case. The 
second thing that i tried was hooking 
into the paint function of the 
application by using the lpPrevWndProc 
= apiSetWindowLong(hwnd, GWL_WNDPROC, 
AddrOf(strFunctionName)) (This is the 
SetWindowLongA in user32) But this wil 
return an access denied error. So I am 
back to the beginning. Does somebody 
have an idea how i can paint into the 
titlebar of any application? 
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/17/2001 2:06:58 PM:Pure
You know there is a way...  You have to 
search for "Animated Title bar".  This 
is what I found it animates the title 
bar with a picture but im sure with 
some tinkering/Canimbalising you can 
figure out how to get it to 
work.
"http://www.planetsourcecode.co
m/xq/ASP/txtCodeId.10295/lngWId.1/qx/vb/
scripts/ShowCode.htm"
p.s. To all 
those who enjoy my systray program I'm 
adding a feature to expand the systray 
so it's large enough to hold whatever 
you want whilst also resizing the rest 
of the task bar so everything fits!
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/18/2001 2:52:32 AM:Edwin Vermeer

Hi, As you can see the titlebar app 
is using the SetWindowLong and that 
will only work for the current 
application and i want to do this for 
all applications that are running. 
That new feature sounds good! 
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/18/2001 5:21:43 PM:Pure
Why does it need to be for all 
windows... that WILL eat up processing 
plus it's impracticle.  I mean the 
currently active window will be the 
only one the user is looking at or at 
least the only one he will be paying 
attention too.  So having it on all the 
others is pointless.  Well at least in 
my mind.
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/22/2001 11:03:48 PM:Anthony
This is nice, it would be cool if you 
could get the number of icons there 
before so that way you can have kinda a 
standard size like I would like mine to 
always be 6 icons big or something no 
matter how much they have
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
4/23/2001 4:04:38 PM:Pure
Good Idea, I'll add that
Keep the Planet clean! If this comment was disrespectful, please report it:
Reason:

 
7/21/2002 6:50:34 AM:IssamFe
i will add it to all my app, thx it's 
gr8
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.