Hi Everybody,
Is it possible to change the system date to "dd/mm/yyyy" and time to "HH:mm:ss" format through vb code? If so please let me know how!!!! And Is It possible to deny access to the control panel of windows 9x versions through vb?
Printable View
Hi Everybody,
Is it possible to change the system date to "dd/mm/yyyy" and time to "HH:mm:ss" format through vb code? If so please let me know how!!!! And Is It possible to deny access to the control panel of windows 9x versions through vb?
SetLocaleInfo, can be used to set a wide range of regional settings.
Add the following in the declarations section of our project's code module:
Public Const LOCALE_SSHORTDATE = &H1F
Public Declare Function GetSystemDefaultLCID _
Lib "kernel32" () As Long
Public Declare Function SetLocaleInfo Lib _
"kernel32" Alias "SetLocaleInfoA" ( _
ByVal Locale As Long, _
ByVal LCType As Long, _
ByVal lpLCData As String) As Boolean
Private Sub Main()
Dim lngLocale As Long
lngLocale = GetSystemDefaultLCID()
If SetLocaleInfo(lngLocale, _
LOCALE_SSHORTDATE, _
"MM/dd/yyyy") = _
False Then
' Handle error, possibly by writing it
' to a server error log
End If
End Sub
I hope the above code will help as I was also strugling on the net to find its solution.
Enjoy,
Neeraj Matta.