Num modulo novo, cole e salve;
'*************************************************************************
Option Explicit
Private Const LOCALE_SDATE = &H1F
Private Const LOCALE_STIMEFORMAT = &H1003
Private Const WM_SETTINGCHANGE = &H1A
Private Const HWND_BROADCAST = &HFFFF&
Private Declare Function SetLocaleInfo Lib "kernel32" Alias "SetLocaleInfoA" (ByVal Locale As Long, ByVal LCType As Long, ByVal lpLCData As String) As Boolean
Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Private Declare Function GetSystemDefaultLCID Lib "kernel32" () As Long
Private Declare Function GetLocaleInfo Lib "kernel32" Alias "GetLocaleInfoA" (ByVal Locale As Long, ByVal LCType As Long, ByVal lpLCData As String, ByVal cchData As Long) As Long
Public Function SetDateTime() As Boolean
'função que altera os formatos da data e hora do Regional Settings do Windows
Dim dwLCID As Long
dwLCID = GetSystemDefaultLCID()
'aqui você altera o formato da data para o que desejar "dd-MM-yyyy"
If SetLocaleInfo(dwLCID, LOCALE_SDATE, "dd-MM-yyyy") = False Then
SetDateTime = False
Exit Function
End If
'aqui você altera o formato das horas para o que desejar "HH:mm:ss"
If SetLocaleInfo(dwLCID, LOCALE_STIMEFORMAT, "HH:mm:ss") = False Then
SetDateTime = False
Exit Function
End If
PostMessage HWND_BROADCAST, WM_SETTINGCHANGE, 0, 0
SetDateTime = True
End Function
'*************************************************************************
Para chamar a função, por exemplo no abrir do fomulario principal;
Private Sub Form_Open(Cancel As Integer)
Call SetDateTime
End Sub