I have a C# (.NET 4) Windows Service running as LocalSystem.
One of its functions is to spawn processes (which also run as LocalSystem). These processes appear on the desktop of a given session (eg SessionID 1 or SessionID 2, winlogon screen, etc).
When processes are created in this way, calling Thread.CurrentThread.CurrentUICulture within the process always returns 'en-US', rather than the culture of the logged in user for the given session.
I need a way to determine the culture of the logged in user. The closest thing I've found is a windows API 'GetProcessPreferredUILanguages' which I was hoping to use to get the language of the 'explorer' process of the given Session, but I'm not clear if this is a viable option.
Any assistance is appreciated. Thanks in advance!