SetUserGeoID function

Sets the geographical location identifier for the user. This identifier should have one of the values described in Table of Geographical Locations.


BOOL SetUserGeoID(
  _In_ GEOID GeoId


GeoId [in]

Identifier for the geographical location of the user.

Return value

Returns TRUE if successful or FALSE otherwise.

Windows XP, Windows Server 2003: This function does not supply extended error information. Thus it is not appropriate for an application to call GetLastError after this function. If the application does call GetLastError, it can return a value set by some previously called function.

If this function does not succeed, the application can call GetLastError, which can return one of the following error codes:

  • ERROR_ACCESS_DISABLED_BY_POLICY. The group policy of the computer or the user has forbidden this operation.
  • ERROR_INTERNAL_ERROR. An unexpected error occurred in the function.
  • ERROR_INVALID_PARAMETER. Any of the parameter values was invalid.


This function writes to the registry the geographical location for a particular user instead of a particular application. This action affects the behavior of other applications run by the user. As a rule, the application should call this function only when the user has explicitly requested changes, but not for purely application-specific reasons.


Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]


Winnls.h (include Windows.h)





See also

National Language Support
National Language Support Functions
Table of Geographical Locations