CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Win32 Clock

  1. #1
    Join Date
    Apr 2010
    Posts
    172

    Win32 Clock

    Could some one please help me?

    I have static box that makes the system time appear in hours mintues and seconds but it only refreshes when i move the mouse or other window activitey is there away to allow the clock to refresh freely?

  2. #2
    Join Date
    Jun 2010
    Location
    Germany
    Posts
    2,675

    Re: Win32 Clock

    Set up a Windows timer (with a NULL callback function pointer) and handle the timer messages in your window class' OnTimer() event handler to update the clock display. Have a look at CWnd::SetTimer() in MSDN for instructions on how to do that.

    A timer interval of 1000 ms should be ok for this application in most cases. That way your clock display may be off by a maximum of one second relative to the system clock, but your app wouldn't be too busy handling the timer messages.

    HTH

    BTW, please note that double-posting doesn't get you quicker, better or more answers. But maybe that was an unintentional mistake.
    I was thrown out of college for cheating on the metaphysics exam; I looked into the soul of the boy sitting next to me.

    This is a snakeskin jacket! And for me it's a symbol of my individuality, and my belief... in personal freedom.

  3. #3
    Join Date
    Apr 2010
    Posts
    172

    Talking Re: Win32 Clock

    Thanks and the double post was unfortunate

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured