CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 12 of 12
  1. #1
    Join Date
    Sep 2011
    Posts
    3

    How to lock the system clock

    I have developed the vb6 application.in this application , i want to lock the system clock when ma application .exe running & my application closed then unlock the system clock.

  2. #2
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: How to lock the system clock

    If you stop the clock, you'll probably need to use DOS. Explain what you mean.

    If you want to prevent altering the time, use an external time source (like the web) and check it...
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  3. #3
    Join Date
    Sep 2011
    Posts
    3

    Re: How to lock the system clock

    if my application is running then user can not change the date & time .

  4. #4
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: How to lock the system clock

    I am not aware of any way to lock the system clock. You can set the time, you can sync the time you can even do it in a timer if need be so any changes get set back to the proper time when the timer fires but locking it would seem to have little purpose so I doubt there is a method provided to do so.
    Always use [code][/code] tags when posting code.

  5. #5
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: How to lock the system clock

    Think about it. Remove battery, unplug, and unplug network card. You want PC to self-destruct?
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  6. #6
    Join Date
    Jun 2005
    Location
    JHB South Africa
    Posts
    3,772

    Re: How to lock the system clock

    Quote Originally Posted by vrushalikatkade View Post
    if my application is running then user can not change the date & time .
    WHY??

    is there any Specific reason for this...
    Articles VB6 : Break the 2G limit - Animation 1, 2 VB.NET : 2005/8 : Moving Images , Animation 1 , 2 , 3 , User Controls
    WPF Articles : 3D Animation 1 , 2 , 3
    Code snips: VB6 Hex Edit, IP Chat, Copy Prot., Crop, Zoom : .NET IP Chat (V4), Adv. ContextMenus, click Hotspot, Scroll Controls
    Find me in ASP.NET., VB6., VB.NET , Writing Articles, My Genealogy, Forum
    All VS.NET: posts refer to VS.NET 2008 (Pro) unless otherwise stated.

  7. #7
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,283

    Re: How to lock the system clock

    Quote Originally Posted by vrushalikatkade View Post
    I have developed the vb6 application.in this application , i want to lock the system clock when ma application .exe running & my application closed then unlock the system clock.
    You could always hide the clock. I'd do that, especially if you do not want users to be able to change the time while your app is running.

  8. #8
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: How to lock the system clock

    Quote Originally Posted by dglienna View Post
    Think about it. Remove battery, unplug, and unplug network card. You want PC to self-destruct?
    Ahh, only problem is that would terminate the program
    Always use [code][/code] tags when posting code.

  9. #9
    Join Date
    Mar 2001
    Posts
    2,529

    Re: How to lock the system clock

    I think you can make windows rights so restrictive, users can't change the time anyway.
    ahoodin
    To keep the plot moving, that's why.

  10. #10
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: How to lock the system clock

    That's what a SERVER is for. Active Directory can run ONLY your app on the desktop when someone logs in. As soon as they QUIT the app, they're logged off. Microsoft called the demo JOE LOCK-OUT when Windows 2000 was new
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  11. #11
    Join Date
    Mar 2001
    Posts
    2,529

    Re: How to lock the system clock

    Yeah or using a timeserver based on an atomic clock. I would say there is no point to writing an app to lock the system clock, the functionality is already in Windows, and TimeServer Functionality overrides it too. Apologies.
    ahoodin
    To keep the plot moving, that's why.

  12. #12
    Join Date
    Oct 2006
    Posts
    327

    Re: How to lock the system clock

    Hello,

    I would :

    Insert a sysinfocontrol
    and use its TimeChanged() event

    It will let me know any attempt to change the date/time ===>> I would then (and only then) decide to restablish or not (trough the web) the right date and time.

Tags for this Thread

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

Featured