Results 1 to 6 of 6

Thread: How to avoid changing date and time?

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2012
    Posts
    35

    How to avoid changing date and time?

    Hello.

    I need to disable windows (XP and Seven) time and date changing by user when my app is running and of course enable it when my app closes.
    How to do that in VB6?

    Thanks.

  2. #2
    PowerPoster Zvoni's Avatar
    Join Date
    Sep 2012
    Location
    To the moon and then left
    Posts
    5,263

    Re: How to avoid changing date and time?


  3. #3
    New Member
    Join Date
    Sep 2012
    Posts
    4

    Re: How to avoid changing date and time?

    This needs to apply restriction on changing datetime on the user from Group Policy. Hence you need to code for that. And depending on the system and user's permission I can't assure that it will work always.

    Alternatively it is better to make your app so that it does not depend on system datetime while it is running. To do that you can read the system datetime at the start of your app. Then start a Timer and create your new datetime assigning it to the initial date plus timer instead of taking datetime from the system while your app running. Let me know if you want to do this process but do not know how to use timer.

    Cheers

  4. #4
    PowerPoster
    Join Date
    Jul 2006
    Location
    Maldon, Essex. UK
    Posts
    6,334

    Re: How to avoid changing date and time?

    This does beg the question - why? - what's so special about your program that requires the Date and Time not to change?

  5. #5

    Thread Starter
    Member
    Join Date
    Feb 2012
    Posts
    35

    Re: How to avoid changing date and time?

    Quote Originally Posted by orchestra View Post
    Alternatively it is better to make your app so that it does not depend on system datetime while it is running. To do that you can read the system datetime at the start of your app. Then start a Timer and create your new datetime assigning it to the initial date plus timer instead of taking datetime from the system while your app running. Let me know if you want to do this process but do not know how to use timer.
    That's a good idea, and yes I know how to use timers. In fact, I'm not the author of the app. Mistakenly I said "my app" but it's not.
    But I need to fix this problem because some data are recorded with local date and time and if user changes these then serious problems happen.
    I'm trying to use FindWindow/CloseWindow and a timer so that I can close "time and date" window when user opens it.]
    Of course it's not the better solution, but it's the only I have at this moment.

  6. #6

    Thread Starter
    Member
    Join Date
    Feb 2012
    Posts
    35

    Re: How to avoid changing date and time?

    Quote Originally Posted by Doogle View Post
    This does beg the question - why? - what's so special about your program that requires the Date and Time not to change?
    Please, read my reply to "Orchestra".
    Thanks.

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