The MASM Forum

General => The Workshop => Topic started by: Bill Cravener on May 23, 2012, 09:41:08 PM

Title: How to show the system time on the desktop.
Post by: Bill Cravener on May 23, 2012, 09:41:08 PM
I've been meaning to post this Masm32 example for several months now but summer came in March here in Northwest PA and I've been enjoying it very much! Well I figured what better time to do so then now when Steve has started up his new Masm32 board.  :biggrin:

Anyway, here is a simple example on how to display the time on your desktop. My plan was to make this a tray utility but as I stated above I've been enjoying the weather. I have several examples on my website page (linked below) that shows how to make a tray utility so it would be a simple deal to make this example as such.


http://www.quickersoft.com/examples/DTClock.zip

Or it can be downloaded from my site link below.
Title: Re: How to show the system time on the desktop.
Post by: hutch-- on May 23, 2012, 11:44:50 PM
Bill,

Are you still riding that Yamaha ?
Title: Re: How to show the system time on the desktop.
Post by: jj2007 on May 24, 2012, 12:10:11 AM
Quote from: Bill Cravener on May 23, 2012, 09:41:08 PM
Or it can be downloaded from my site link below.

The clock is awesome, Bill :t
Title: Re: How to show the system time on the desktop.
Post by: Bill Cravener on May 24, 2012, 12:37:39 AM
Quote from: hutch-- on May 23, 2012, 11:44:50 PM
Bill,

Are you still riding that Yamaha ?

Hi Steve, though I still ride I no longer own the V-Star 1100 Classic, I sold it last year. In fact I don't personally own a motorcycle anymore. When I want to ride, since I often do work for Knievel Cycles and have known the CEO, COO and Employees for so many years, they let me ride one of the display models whenever I feel like riding.

Here's one I road a few times that was built for the University of Georgia. It's a Pro-Street model with a Harley engine, a real go-fast machine (I make all the seats for their bikes). Knievel now has four dealerships, two overseas (one in France, one in Norway), and two here in the states (one in Florida and one in Texas). It's been tough going for the company cause of the economy (their bikes are pretty expensive) but they're hanging in there.

(http://www.quickersoft.com/pictures/georgia.jpg)

Title: Re: How to show the system time on the desktop.
Post by: Bill Cravener on May 24, 2012, 12:39:31 AM
Quote from: jj2007 on May 24, 2012, 12:10:11 AM
The clock is awesome, Bill :t

Thanks Jochen, I appreciate that! :biggrin:
Title: Re: How to show the system time on the desktop.
Post by: dedndave on May 24, 2012, 06:46:50 AM
nice, as always, Bill   :t
Title: Re: How to show the system time on the desktop.
Post by: Bill Cravener on May 24, 2012, 11:39:27 PM
Quote from: dedndave on May 24, 2012, 06:46:50 AM
nice, as always, Bill   :t

Thanks buddy!  :biggrin:
Title: Re: How to show the system time on the desktop.
Post by: hutch-- on May 25, 2012, 12:07:05 AM
Bill,

Years ago in my business I used to refinish Harley parts for the bike guys and got to see a lot of very rare stuff, knuckleheads, and panheads as well as the later shovels and blockheads. I knew this guy who had a panhead chopper that was so PHUKING heavy that it use to flex the 1" handlebars when you grunted it off its side stand.
Title: Re: How to show the system time on the desktop.
Post by: FORTRANS on May 25, 2012, 12:42:25 AM
Hi Bill,

   Very nice!

Thanks,

Steve N.
Title: Re: How to show the system time on the desktop.
Post by: Bill Cravener on May 25, 2012, 08:22:48 PM
Thanks Steve N!  :biggrin:
Title: Re: How to show the system time on the desktop.
Post by: Bill Cravener on May 25, 2012, 08:27:19 PM
Quote from: hutch-- on May 25, 2012, 12:07:05 AM
Bill,

Years ago in my business I used to refinish Harley parts for the bike guys and got to see a lot of very rare stuff, knuckleheads, and panheads as well as the later shovels and blockheads.

Steve,

Here in Sharon PA we have what they call "Bike Night" every Wednesday during the warmer months (started really early this year) and folks ride their bikes to a restaurant called Quaker-Steak and Lube. You'll see hundreds of bikes (mostly Harleys) and some will be restored Old Timers. The old ones and the customs are the most interesting to check out. I've been a rider since I was a kid riding mini-bikes and what I miss the most is the ability to maintain a bike yourself. These days bikes are fuel-injected with complicated electronic ignition systems, highly tuned exhaust systems and computer controlled everything else. It has gotten to the point all you can do on your own with the newer bikes is scratch your head.  :icon_confused:
Title: Re: How to show the system time on the desktop.
Post by: Bill Cravener on May 25, 2012, 09:26:07 PM
I received a friendly private message from the member Antariy about my DTClock example and he pointed out that I forgot that much of the world uses the 24 hour format.

QuoteIt is need to change the code in the TextOut part as following:
Code: [Select]
            invoke lstrlen,ADDR TimeString
            invoke TextOut,hDC,0,0,ADDR TimeString,eax

Because in the countries where regional settings for time using 24-hour format, there is no leading "0" for the hours, so, for 09:12:34AM the GetTimeFormat returns 9:12:34, and when code uses hardcode string length for TextOut, the 8th char to output is zero, which actually printed as square. I.e. the clock on desktop looks like 9:12:34 (I do have a screenshot of it, but PMs didn't seem to have attachment option).

Otherwise very nice and clean example  :t

I've made the suggested change to the little example and it can be downloaded above at my first post.

Thanks Antariy!  :biggrin:

Title: Re: How to show the system time on the desktop.
Post by: dedndave on May 25, 2012, 09:43:54 PM
i think if you use TIME_FORCE24HOURFORMAT, the leading 0 is there   :P
of course, not everyone wants that - lol
i like that flag because it makes the format very predictable
Title: Re: How to show the system time on the desktop.
Post by: Bill Cravener on May 25, 2012, 09:54:14 PM
Well Dave being that you're an ex-military fellow I suppose you feel comfortable with the 24 hour format. I'm old, set in my ways, and prefer standard time thank you.  :biggrin:
Title: Re: How to show the system time on the desktop.
Post by: dedndave on May 25, 2012, 09:59:14 PM
not so much the military
but -  i have been playing with ham radio since i was a kid
we use 24 hour time - and, in fact, most hams use UTC (used to be called GMT) or "Zulu"
that way, we are all using the same clock
we might write a time as: 1330Z, meaning it is 1:30 PM someplace in England   :P
Title: Re: How to show the system time on the desktop.
Post by: dedndave on May 25, 2012, 10:22:16 PM
i might add...
we are compelled to be inside our assigned frequency allocations
so - knowing exactly where you are is a must

we use transmitted standards to calibrate our equipment
there are many such standard transmissions around the world
but, here in the US, it's the national institute of standards and technology
what used to be called the national bureau of standards
they transmit signals on 5, 10, 15, 20 MHz, as well as a few others
the transmitter carrier is phase-locked to an atomic clock - very accurate

besides the accurate carrier frequency, they transmit time information in voice, digital, morse
as well as propogation predictions and other stuff (condition of the ionosphere, etc)
because the time is "paired" with the frequency standard, hams are unnecessarily fascinated with having accurate clocks - lol
you are likely to see a ham's second hand roll over precisely when the beep happens   ::)
Title: Re: How to show the system time on the desktop.
Post by: dedndave on May 25, 2012, 11:23:50 PM
these old Pennwood Numechron clocks used to be very popular with hams
probably because the case was made of bakelite - like many antique radios
and - they were available out of Pittsburg in 24-hour models

(http://www.collectorsweekly.com/assets/stories/LsO2PMvI9Vn7a32m.fB2kg.jpg)
Title: Re: How to show the system time on the desktop.
Post by: Antariy on May 26, 2012, 08:13:18 AM
Quote from: Bill Cravener on May 25, 2012, 09:26:07 PM
I've made the suggested change to the little example and it can be downloaded above at my first post.

Example update is working perfectly :t


Quote from: dedndave on May 25, 2012, 09:43:54 PM
i think if you use TIME_FORCE24HOURFORMAT, the leading 0 is there   :P

No, it will not be there if regional settings do not imply that. But you can use format string with "HH" representing hours for that purpose.
Title: Re: How to show the system time on the desktop.
Post by: Abdel Hamid on January 24, 2019, 11:22:29 PM
i know that this topic is from 2012
does anyone still has these examples from the link below ?

http://www.quickersoft.com/examples

i tried look them up at archive.org and i haven't found anything  :(
Title: Re: How to show the system time on the desktop.
Post by: guga on February 18, 2019, 05:11:41 PM
You mean from Edgar, right ? It was his site, if i remember .

Here they are:

https://drive.google.com/open?id=1kpqgfKWOc-_MM22uyWTZbf0b-LF29Wuf (https://drive.google.com/open?id=1kpqgfKWOc-_MM22uyWTZbf0b-LF29Wuf)