Getting the Regional Short Date Format

mnemtsas 0 Tallied Votes 271 Views Share

Uses the API to get the regional short date format from the PC

Private Declare Function GetProfileString Lib "kernel32" Alias "GetProfileStringA" (ByVal lpAppName As String, ByVal lpKeyName As String, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long) As Long


Public Function getRegionalDateFormat() As String
  Dim strSecName As String
  Dim strKeyName As String
  Dim varSuccess As Variant
  Dim strRetDate As String
  Dim strRetSep As String
  Dim strChar As String * 1
  
  strSecName = "Intl"
  strKeyName = "sShortDate"
  strRetDate = String$(11, 0)
  varSuccess = GetProfileString(strSecName, strKeyName, "", strRetDate, Len(strRetDate))
  strSecName = "Intl"
  strKeyName = "sDate"
  strRetSep = String$(2, 0)
  varSuccess = GetProfileString(strSecName, strKeyName, "", strRetSep, Len(strRetSep))
  strRetSep = Left$(strRetSep, 1)
  strChar = UCase$(Left$(strRetDate, 1))
  strRetDate = Left(strRetDate, Len(strRetDate) - 1)
  getRegionalDateFormat = strRetDate
End Function
karthik_02 0 Newbie Poster

can any one tell me how to set windows desktop wallpaper using windows api in vb.

i tried with the code systemparametresinfo , but its not working..

also how to use win api and declarations in vb..

tzatziki 0 Newbie Poster

try

Dim DecimalCharacter As String
    DecimalCharacter = Mid(Format(0, "0.0"), 2, Len(Format(0, "0.0")) - 2)
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.