User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Visual Basic 4 / 5 / 6 section within the Software Development category of DaniWeb, a massive community of 402,637 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,301 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums
Feb 26th, 2006
Views: 9,414
Uses the API to get the regional short date format from the PC
visualbasic Syntax
  1. 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
  2.  
  3.  
  4. Public Function getRegionalDateFormat() As String
  5. Dim strSecName As String
  6. Dim strKeyName As String
  7. Dim varSuccess As Variant
  8. Dim strRetDate As String
  9. Dim strRetSep As String
  10. Dim strChar As String * 1
  11.  
  12. strSecName = "Intl"
  13. strKeyName = "sShortDate"
  14. strRetDate = String$(11, 0)
  15. varSuccess = GetProfileString(strSecName, strKeyName, "", strRetDate, Len(strRetDate))
  16. strSecName = "Intl"
  17. strKeyName = "sDate"
  18. strRetSep = String$(2, 0)
  19. varSuccess = GetProfileString(strSecName, strKeyName, "", strRetSep, Len(strRetSep))
  20. strRetSep = Left$(strRetSep, 1)
  21. strChar = UCase$(Left$(strRetDate, 1))
  22. strRetDate = Left(strRetDate, Len(strRetDate) - 1)
  23. getRegionalDateFormat = strRetDate
  24. End Function
Comments (Newest First)
tzatziki | Newbie Poster | Oct 10th, 2007
try
    Dim DecimalCharacter As String
    DecimalCharacter = Mid(Format(0, "0.0"), 2, Len(Format(0, "0.0")) - 2)
karthik_02 | Newbie Poster | Mar 4th, 2007
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..
Post Comment

Only community members can submit or comment on code snippets. You must register or log in to contribute.

DaniWeb Marketplace (Sponsored Links)
All times are GMT -4. The time now is 2:13 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC