Transparent Clock sourcecode
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
Transparent Clock sourcecode
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.
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.
Last edited by netmaestro on Tue Jul 07, 2009 8:25 pm, edited 4 times in total.
BERESHEIT
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
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!

@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!

I may look like a mule, but I'm not a complete ass.
- Psychophanta
- Always Here
- Posts: 5153
- Joined: Wed Jun 11, 2003 9:33 pm
- Location: Anare
- Contact:
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
Code: Select all
Case 0 To 128

Would have saved me alot of time on previous projects

I Stepped On A Cornflake!!! Now I'm A Cereal Killer!
@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!
Thanks for sharing this excellent code.
I wonder that the compiled task didn't remember the settings.
Code: Select all
ExamineDesktops()
Code: Select all
DesktopWidth(0)
Now it works perfectly!