Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Cannot update the change of decimal symbol of system
Message
De
26/04/2007 01:18:45
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Titre:
Cannot update the change of decimal symbol of system
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Divers
Thread ID:
01219996
Message ID:
01219996
Vues:
81
Hi all!
I would like to change the decimal symbol of system. The following are my codes to do that. However, after I run these codes, MS Excel does not effect by news decimal symbol. What was wrong? Please help me.
Thanks
*Begin of codes
SET SYSFORMATS ON
DECLARE INTEGER GetLocaleInfo IN Win32API LONG Locale, ;
	LONG LCType, STRING @LpLCData, INTEGER cchData

* GetSystemDefaultLCID retrieves the system default locale identifier
DECLARE LONG GetSystemDefaultLCID IN Win32API
dwLCID = GetSystemDefaultLCID()
DECLARE SetLocaleInfo IN Win32API LONG Locale, LONG LCType, ;
	STRING @LpLCData


*Locale = 1033 &&2048              && For English language.
LpLCData = SPACE(255)      && Address of buffer information.
cchData = LEN(LpLCData)    && Size of buffer, LpLCData.

nretval = 0                && Number returned from API call.
cOlddecimal= ""             && Hold original decimal symbol.

typedecimal = 0x16 && Monetary decimal separator..
typethousand = 0x17 && Monetary thousand separator..

* Obtain decimal symbol
nretval = GetLocaleInfo(dwLCID, typedecimal, @LpLCData, cchData)
IF nretval = 0 THEN
	=MESSAGEBOX ("Could not get information.")
ELSE
	=MESSAGEBOX (LpLCData, 32, "decimal symbol")
ENDIF
RETURN

setdecimal = SetLocaleInfo(dwLCID, typedecimal , "," )
setthounsand = SetLocaleInfo(dwLCID, typethousand , ".")

nretval = GetLocaleInfo(Locale, typedecimal, @LpLCData, cchData)

*update system and others app
DECLARE INTEGER SendMessage IN USER32.DLL ;
	INTEGER HWND, ;
	INTEGER Msg, ;
	INTEGER wParameter, ;
	INTEGER LPARAMETER
#DEFINE HWND_BROADCAST 0xFFFF
#DEFINE WM_FONTCHANGE 0x001D
#DEFINE WM_SETTINGCHANGE 0x001A
=SendMessage(HWND_BROADCAST,WM_SETTINGCHANGE,0,0)
RETURN
* End of code
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform