Results 1 to 2 of 2

Thread: Use API to reset Windows tray clock?

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 1999
    Posts
    1

    Use API to reset Windows tray clock?

    I wrote a DLL in VC++ that accesses an ADC chip through the parallel port and displays a waveform on a VB picturebox. In that DLL, I disable the system interrupts during the waveform sampling period to prevent jitter from mouse movements and whatever else is raising an interrupt at that moment. Anyway, when the interrupts are disabled, the Windows tray clock loses time because it's not getting timer interrupts from the PIT. I can read the CMOS RTC from port 70H and 71H but I tried resetting the clock with the API functions SetSystemTime and SetLocalTime, this however does not update the tray clock. I can't figure it out. Anyone know the secret? Thanks.

    John Voltz

  2. #2
    Frenzied Member
    Join Date
    Aug 2001
    Posts
    1,075
    In VB setting the system time is as easy as

    Time$ = "5:32:24"

    and reading the time is

    Dim sMyTime As String
    sMyTime = Time$

    The tray clock will update but not right away becuase it does not display seconds so there is no need to. I wonder if you got the handle to the tray and used SendMessage or PostMessage to send a WM_PAINT message to the tray to force it to repaint.

    Greg

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