Hi Manuel,
Sorry, I do not have these localized version of Windows for testing. I
assume that the *Display Name* for these services on the localized Windows
will be different from the English Windows. However, I suspect the "Service
Name" of these services will still use the english name. You may use
Services.msc on these localized Windows to help me to confirm this.
If my suspect is correct, we can just enumerate all the services and
compare *Service Name* with stored english service name. Once one is found,
we can get its "Display Name" for ServicesDependedOn usage. To enumerate
all the serivces and get the *Service Name*, you may use the following code
snippet:
Dim sc As ServiceController() = ServiceController.GetServices()
Dim i As Integer
For i = 0 To sc.Length - 1
If(sc(i).ServiceName) = "Spooler" Then
.....
End If
Next i
If my suspect is incorrect, that is, the *Service Name* is also localized
to non-english name, then we have to use the service binary file name as
the information to identify the service we want.
To get this done, we have to enumerate all the services on the system, and
for each service, we have to p/invoke OpenService win32 API to get the
handle to the this service, finally, we can p/invoke QueryServiceConfig API
to query the full information of this service now. The retrieved
QUERY_SERVICE_CONFIG structure has a field of lpBinaryPathName, which
contains the full binary path of the service. You may use this full binary
path for comparison and identify the service you want. The reason that we
have to p/invoke win32 API to get this done is that .Net did not
encapsulate this function currently.
Hope this helps.
Best regards,
Jeffrey Tan
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.