Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Jun Tangunan
  Where is Jun Tangunan?
 Cabanatuan
 Philippines
 Jun Tangunan
 To: Nadir Khan
  Where is Nadir Khan?
 Karachi
 Pakistan
 Nadir Khan
 Tags
Subject: RE: Windows Date Block
Thread ID: 345525 Message ID: 345528 # Views: 116 # Ratings: 3
Version: Visual FoxPro 9 SP2 Category: Forms
Date: Thursday, May 24, 2012 6:23:14 AM         
   


> Dear Experts
>
>
> I made single user application on windows xp i want when user run my application then
> windows date block means user can not change date when use exit my application then
> windows date block open .
>
> how to can i do in visual foxpro 9.
> please give me example.
>
>
> thanks
> nadir


Why not simply control the date of your app so user cannot backdate? Create a table that will hold your app's date and in the login form, create a login date in addition to user name and password. Once a later date has been entered, prevent backdating. In some cases where backdating is really needed, then create a module for admin only to allow system date backdating.

Preventing changing of OS date is not as simple as it looks. Please read this for various ways available to counter what you will do in restricting changing of OS date: http://sandstorm36.blogspot.com/2011/11/restrict-users-from-changing-time-on.html

However, if you really wanted something simple hoping your users are not computer savvy, then a simple manipulation of the control panel applet (.cpl) will work:

* Remove access to control panel date and time either via control panel or double-clicking task bar
Local lcTarget1, lcTarget2, lcTarget3, lcTarget4
lcTarget1 = Addbs(Getenv("windir"))+"system32\dllcache\timedate.cpl"
lcTarget2 = Addbs(Getenv("windir"))+"system32\timedate.cpl"
lcTarget3 = Addbs(Getenv("windir"))+"system32\dllcache\timedate.cpx"
lcTarget4 = Addbs(Getenv("windir"))+"system32\timedate.cpx"
If File(m.lcTarget1)
	Rename (m.lcTarget1)  To (m.lcTarget3)
Endif
If File(m.lcTarget2)
	Rename (m.lcTarget2)  To (m.lcTarget4)
Endif



To bring back its capability, just reverse the process:

* put it back
Local lcTarget1, lcTarget2, lcTarget3, lcTarget4
lcTarget1 = Addbs(Getenv("windir"))+"system32\dllcache\timedate.cpl"
lcTarget2 = Addbs(Getenv("windir"))+"system32\timedate.cpl"
lcTarget3 = Addbs(Getenv("windir"))+"system32\dllcache\timedate.cpx"
lcTarget4 = Addbs(Getenv("windir"))+"system32\timedate.cpx"
If File(m.lcTarget3)
	Rename (m.lcTarget3)  To (m.lcTarget1)
Endif
If File(m.lcTarget4)
	Rename (m.lcTarget4)  To (m.lcTarget2)
Endif



http://sandstorm36.blogspot.com
http://weblogs.foxite.com/sandstorm36

ENTIRE THREAD

Windows Date Block Posted by Nadir Khan @ 5/24/2012 5:56:54 AM
RE: Windows Date Block Posted by Jun Tangunan @ 5/24/2012 6:23:14 AM
RE: Windows Date Block Posted by Nadir Khan @ 5/24/2012 4:14:30 PM
RE: Windows Date Block Posted by Jun Tangunan @ 6/1/2012 12:27:55 AM
RE: Windows Date Block Posted by Muhammad Majid Ali Attari @ 5/24/2012 7:30:50 AM
RE: Windows Date Block Posted by Cetin Basoz @ 5/24/2012 1:27:36 PM
RE: Windows Date Block Posted by Rajesh Malhotra @ 5/25/2012 12:55:43 PM
RE: Windows Date Block Posted by Cetin Basoz @ 5/31/2012 8:46:51 PM