Postada em 22/09/2006 10:11 hs
Coloque em um módulo:
Private Const LOCALE_SSHORTDATE = &H1F 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 Sub Data4Digitos() Dim dwLCID As Long dwLCID = GetSystemDefaultLCID() If SetLocaleInfo(dwLCID, LOCALE_SSHORTDATE, "dd/MM/yyyy") = False Then Exit Sub End If PostMessage HWND_BROADCAST, WM_SETTINGCHANGE, 0, 0 End Sub
Uso na Sub Main() com a qual inicio o programa, chamando diretamente:
Data4Digitos
|