Results 1 to 4 of 4

Thread: VB Guru's - Here's a difficult one for ya...

  1. #1
    Guest

    Post

    I am trying to capture when a user click on the "Adjust Date/Time" item in the SysTray's menu. I don't want them to be able to see the Date/Time Properties. I want to show my own custm one instead. If anyone know how to do this I would very grateful. So far, I haven't been able to fond anyone who does. Thanks!

  2. #2
    Member
    Join Date
    Feb 1999
    Location
    NY
    Posts
    45

    Post

    I gave it a thought, said to myself: "no, it can't be done." Gave it a second thought, and then the code just poured into my head :-)

    The way im thinking of doing this, the user will see the window for a brief moment, and you will close it, pop up your own window, and everything's dandy.

    I hope you are handy with the API text viewer, because its a little too involved to write an example (either that or im just too lazy) but i WILL plan out what you need to do.

    You are going to need the API functions GetWindow, FindWindow as well as the others that are in this that i forgot about.

    On a timer, with an interval of how fast you want it to refresh, will be the code to find the date/time window. Use the FindWindow API, to search for it's handle. That function works by giving FindWindow the title of the Window and if the handle is not 0, then the window is available.

    You can do one of two things to close it. Either SendKeys "{ESC}", the cheap way, or use the SendMessage API (which i am very not familiar with) to close it. After that's done, simply open your window up in place.

    ------------------
    -Mystiq

  3. #3
    Member
    Join Date
    Nov 1999
    Location
    Kansas, USA
    Posts
    58

    Post

    An explanation on how to close windows using SendMessage can be found at http://www.vb-world.net/tips/tip2.html.

    Another option would be to replace the Timedate.cpl Control Panel in the Windows folder with your own custom Control Panel. I'm not really sure how to make Control Panels, but I'm sure there is someone out there who knows.

    ------------------
    Mike Wellems
    PowerQuery


    [This message has been edited by mwdelta (edited 12-02-1999).]

  4. #4
    Guest

    Post

    Actually, you are both correct. However, unfortunately, I am already using this method currently. It's kind of a clunky way of doing it though, since you actually see the Date/Time properties box flash on the screen real quick and then go away. Also, I don't use the SendKeys API, I use the CloseWindowsHandle function to take care of it. It finds the Windows Hwnd and then closes it. What I was really looking for was a better way of doing this, or a way to possibly make it quicker so the user doesn't see the Date/Time properties Window flash on the screen. Does anyone have any other further suggestions? Thanks!

    [This message has been edited by swhitlow (edited 12-03-1999).]

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