Page 1 of 3
Transparent Clock sourcecode
Posted: Mon Nov 20, 2006 2:09 am
by netmaestro
Several months ago I started work on a transparent clock, which I named "VistaClock". Since that time I've been gradually improving the look and function of the clock, and the resources used by it have gone steadily down while performance has gone up. I always intended to release the source code for this project, but as it's been a learning experience for me I didn't feel it was appropriate to do so until I had something pretty solid. Today is the day, after much development, and a few last-minute changes to allow the clock to run successfully under Vista, I consider it "ready for critique". The images included with this release are not my transparent clock graphics, but they will suffice to allow the provided sourcecode to run. Here it is, I hope you enjoy studying it as much as I enjoyed writing it:
http://www.lloydsplace.com/transparentclock.zip
Something I noticed with this project is that the CreateStreamOnHGlobal_( API will work with a block of memory allocated with PB's AllocateMemory() on WinXP, but on Vista it's no dice. You have to use GlobalAlloc and GlobalLock. The clock initially wouldn't run on Vista at all until I found this little detail.
Posted: Mon Nov 20, 2006 2:45 am
by Clutch
Thanks very much for this. I've been lurking in these forums for several months, and I've always been very impressed with and learned a lot from your many contributions. Keep up the good work!

Posted: Mon Nov 20, 2006 3:42 am
by rsts
Thanks for another fine contribution (and lesson)
cheers
Posted: Mon Nov 20, 2006 5:22 am
by Pureabc
Excellent!!

Posted: Mon Nov 20, 2006 5:26 am
by Fangbeast
Posted: Mon Nov 20, 2006 5:45 am
by netmaestro
Thanks for the kind words, but I really shouldn't be considered in Sparkie's league. He's still a fifty times stronger coder than me.
But 6 months ago he was 60 times stronger... 
Posted: Mon Nov 20, 2006 7:05 am
by Dare
netmaestro wrote:But 6 months ago he was 60 times stronger... 
Thanks for this, netmaestro.
Posted: Mon Nov 20, 2006 7:36 am
by JCV
Thanks netmaestro.

Posted: Mon Nov 20, 2006 11:56 am
by srod
I look forward to studying this one netty; thanks. I could do with looking through some gdi+ code; thanks.
@fangs: compared to sparks and netty, I'm just a wild hack merchant! Hell, half the code I produce, I don't understand! The other half is not even mine!

Posted: Tue Nov 21, 2006 6:37 pm
by Psychophanta
Thank you

Posted: Mon Nov 27, 2006 6:08 am
by netmaestro
You're most welcome. It's time to tackle some more gdiplus challenges now. 610 commands, so little time...

Posted: Mon Nov 27, 2006 3:47 pm
by GeoTrail
netmaestro, amazing coding there m8.
Opened it up in Vista, hit compile and it runs perfect. It runs more smoothly on Vista then the clock from the sidebar

If there was a PB Hall Of Fame, this should have a place there

Posted: Mon Nov 27, 2006 3:50 pm
by GeoTrail
I didn't know we could do that
Would have saved me alot of time on previous projects

Posted: Thu Nov 30, 2006 10:13 pm
by Amundo
Very nice, Netmaestro, thanks for sharing your work.
Posted: Mon Dec 04, 2006 12:12 am
by jear
@netmaestro
Thanks for sharing this excellent code.
I wonder that the compiled task didn't remember the settings.
has to be done before
is used in line 503
Now it works perfectly!