Announcement

Collapse
No announcement yet.

Set PC time using time servers (Questions here)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Set PC time using time servers (Questions here)

    http://www.powerbasic.com/support/pb...ad.php?t=24573

    know how to get rid of flicker after setting time?


    ------------------

  • #2
    I get no flicker - WinXP Pro

    What OS do you have?

    ------------------
    Adam Drake
    PowerBASIC

    Comment


    • #3
      Windows 98SE. Didn't try using XP Pro, yet.
      That is good news.

      ------------------

      4/30/05 2:40PM

      This code should be moved up a couple of lines so that
      it only executes when a valid connection was established.
      Updated code in source code forum.
      Code:
       #IF %ConnectionSuccessExit                                    'exit, found server
               EXIT FOR
       #ENDIF



      [This message has been edited by Mike Doty (edited April 30, 2005).]

      Comment


      • #4
        I'm not totally sure then.

        Maybe a Win98 issue with sending a broadcast to all top-level windows where the redraw isn't clean. I unfortunately don't have a 98 box to test on.

        ------------------
        Adam Drake
        PowerBASIC

        Comment


        • #5
          Mike,

          Broadcasting %WM_SETTINGCHANGE always causes flicker, even on my
          WinXP Pro system. For changing the system time, instead broadcast the
          %WM_TIMECHANGE message - that does the same thing, but does not
          cause flicker.


          ------------------
          clay at clayclear dot net

          Comment


          • #6
            %WM_TIMECHANGE= &H1E
            SendMessage %HWND_BROADCAST, %WM_TIMECHANGE, 0&, 0

            Thank you, Clay!
            That fixed it. Corrected the source code.

            ------------------

            Comment


            • #7
              For those that would like to get the time via
              a proxy server, you can use the following code:
              (assumes the standard HTTP proxy port 80)

              TCP OPEN PORT 80 AT "my_proxy_address" AS hSocket TIMEOUT 4000
              TCP PRINT hSocket, "GET <A HREF="HTTP://"" TARGET=_blank>HTTP://"</A> & Site(Count) & ":13/;"


              ------------------
              Nick
              Nick

              Comment


              • #8
                Thanks Mike for a nice piece of work. I copied the first one into
                IDE, hit Compile & Execute without looking at the code, and it ran.

                My Win 98 on ThinkPad screen might have flickered, I was too busy
                watching the time in the lower right corner to notice. (Your timing
                is impecable too! At home I use Tardis/K9 on the LAN to keep the
                PCs showing the same time. I'm on an extended biz trip and the
                ThinkPad was a couple minutes off.)

                Tried your second version and watched the screen. Absolutely no
                flicker. The Tada.wav startled me, then I DID LOOK AT THE CODE. heh he

                Thanks again,

                ------------------
                Dale
                Dale

                Comment


                • #9
                  Thought there was a problem with 64-bit Windows.
                  UTC -6 was set for Central America. It needed to be set UTC -6 for Central America and USA to observe Daylight saving time.
                  Last edited by Mike Doty; 6 May 2009, 10:31 AM. Reason: Change time zone setting

                  Comment

                  Working...
                  X