Results 1 to 3 of 3

Thread: Accessing Windows Timer

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2006
    Posts
    1

    Accessing Windows Timer

    Does anyone know anything about the Windows Timer?... The one that sits in the taskbar and shows you the time... and you can check the date and whatnot?... Can be found in the control panel under "Date and Time" also is a file in the windows/system32 directory as "timedate.cpl" Well anyways...

    I was wondering if there was anyway I could "freeze/stop" this timer using a command or series of commands in visual basic. I want to simply stop the timer, not shut it down, not hide it, like freeze the time... I want to stop the windows timer from ticking and just stay at ie... "11:24" even if an hour passes...

    Thanks in advance for any help on this topic.

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Accessing Windows Timer

    Moved from the CodeBank

  3. #3
    PoorPoster iPrank's Avatar
    Join Date
    Oct 2005
    Location
    In a black hole
    Posts
    2,729

    Re: Accessing Windows Timer

    Hi ! Welcome to VBForums !

    Yes. You can do it. (but may not be very easy)
    I don't have VB right now. So can't post any code.

    Better Method:
    First get the clock's picture by BitBlt API.

    Then hook into the tray clock (search codebank for moeur's hooking dll) and listen to WM_PAINT message. When you get this message, discard it, and draw the saved picture on the clock's DC.

    Easier Method:
    First get the clock's picture by BitBlt API.
    Then add a timer with very small interval...say 1 milisecond.
    From this Timer1_Timer, draw the saved picture on the clock's DC.

    You can get TrayClock's DC by GetDC API.
    You can paint on TrayClock's DC by using similar code that I posted here.
    Last edited by iPrank; Jun 12th, 2006 at 06:50 AM.
    Usefull VBF Threads/Posts I Found . My flickr page .
    "I love being married. It's so great to find that one special person you want to annoy for the rest of your life." - Rita Rudner


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