Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Cannot update the change of decimal symbol of system
Message
 
 
À
26/04/2007 01:18:45
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Divers
Thread ID:
01219996
Message ID:
01220114
Vues:
18
Which Excel version you're talking here? I think Excel has mind of its own and sometimes it's impossible to change its regional settings. See this discussion, for example:

http://www.excelforum.com/showthread.php?t=385185

>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
>
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform