|
-
September 22nd, 2001, 01:24 AM
#1
want to get the system date format
can any one pls give the api code for
getting the system date format.
ie. dd/mm/yyyy or mm/dd/yyyy etc...
thanking u.
harish.
-
September 22nd, 2001, 01:47 AM
#2
Solution
Hi harishKS
Use this to get the short date format of ur system.The format will be on strformattype variable
on Error GoTo dataerror1
Dim strformattype As String
ret = RegOpenKey(HKEY_CURRENT_USER, "Control Panel\International", RETVAL)
ret = RegQueryValueEx(RETVAL, "sShortDate", 0, 0, ByVal 0, lDataBufSize)
strformattype = String(lDataBufSize, Chr$(0))
ret = RegQueryValueEx(RETVAL, "sShortDate", 0, 0, ByVal strformattype, lDataBufSize)
dataerror1:
-
September 22nd, 2001, 01:58 AM
#3
sorry
sorry icouldnt run it..
as it was showing the error
saying that no sub or funtion defined.
harish.
-
September 22nd, 2001, 02:08 AM
#4
Include the declaration
Const HKEY_CURRENT_USER = &H80000001
Private Declare Function RegQueryValueEx Lib "advapi32.dll" Alias "RegQueryValueExA" (ByVal hKey As Long, ByVal lpValueName As String, ByVal lpReserved As Long, lpType As Long, lpData As Any, lpcbData As Long) As Long ' Note that if you declare the lpData parameter as String, you must pass it By Value.
Private Declare Function RegOpenKey Lib "advapi32.dll" Alias "RegOpenKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
-
September 22nd, 2001, 02:11 AM
#5
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|