Author Topic: How to show the system time on the desktop.  (Read 14255 times)

Bill Cravener

  • Guest
How to show the system time on the desktop.
« 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.

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 6752
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: How to show the system time on the desktop.
« Reply #1 on: May 23, 2012, 11:44:50 PM »
Bill,

Are you still riding that Yamaha ?
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

jj2007

  • Member
  • *****
  • Posts: 9786
  • Assembler is fun ;-)
    • MasmBasic
Re: How to show the system time on the desktop.
« Reply #2 on: May 24, 2012, 12:10:11 AM »
Or it can be downloaded from my site link below.

The clock is awesome, Bill :t

Bill Cravener

  • Guest
Re: How to show the system time on the desktop.
« Reply #3 on: May 24, 2012, 12:37:39 AM »
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.




Bill Cravener

  • Guest
Re: How to show the system time on the desktop.
« Reply #4 on: May 24, 2012, 12:39:31 AM »
The clock is awesome, Bill :t

Thanks Jochen, I appreciate that! :biggrin:

dedndave

  • Member
  • *****
  • Posts: 8823
  • Still using Abacus 2.0
    • DednDave
Re: How to show the system time on the desktop.
« Reply #5 on: May 24, 2012, 06:46:50 AM »
nice, as always, Bill   :t

Bill Cravener

  • Guest
Re: How to show the system time on the desktop.
« Reply #6 on: May 24, 2012, 11:39:27 PM »
nice, as always, Bill   :t

Thanks buddy!  :biggrin:

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 6752
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: How to show the system time on the desktop.
« Reply #7 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.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

FORTRANS

  • Member
  • *****
  • Posts: 1057
Re: How to show the system time on the desktop.
« Reply #8 on: May 25, 2012, 12:42:25 AM »
Hi Bill,

   Very nice!

Thanks,

Steve N.

Bill Cravener

  • Guest
Re: How to show the system time on the desktop.
« Reply #9 on: May 25, 2012, 08:22:48 PM »
Thanks Steve N!  :biggrin:

Bill Cravener

  • Guest
Re: How to show the system time on the desktop.
« Reply #10 on: May 25, 2012, 08:27:19 PM »
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:

Bill Cravener

  • Guest
Re: How to show the system time on the desktop.
« Reply #11 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.

Quote
It 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:


dedndave

  • Member
  • *****
  • Posts: 8823
  • Still using Abacus 2.0
    • DednDave
Re: How to show the system time on the desktop.
« Reply #12 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

Bill Cravener

  • Guest
Re: How to show the system time on the desktop.
« Reply #13 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:

dedndave

  • Member
  • *****
  • Posts: 8823
  • Still using Abacus 2.0
    • DednDave
Re: How to show the system time on the desktop.
« Reply #14 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