How to detect programmatically that Internet Explorer is switched off?
What would be the easiest way to programmatically check that Internet Explorer is switched off from Windows Features? Some registry key?
I'm trying to customize a dialo开发者_运维技巧gue shown to user based on whether IE is installed or not and whether IE is enabled or not.
Get a list of processes running, and check for iexplore.exe . If it is present in the list, then IE is running. If not, not.
how you get the list of processes depends on your programming environment.
This approach doesn't detect apps that host the IE browser control.
Try this from the Windows Command line in windows 7.
Dism /online /Get-Features
http://technet.microsoft.com/en-us/library/hh824822.aspx#BKMK_find
-I
On older versions of windows you could use sysocmgr.exe to install/remove optional components, it was replaced by pkgmgr.exe on Vista+ IIRC. You could open them in Dependency Walker and look at their list of imported API's, but I'm guessing it would just lead you to parts of the Setup API and lots of undocumented stuff.
On my XP machine, sysocmgr seems to use OCMANAGE.DLL ("Optional Component Manager Library") and none of its exported functions are documented AFAIK (The export named OcComponentState really jumps out at me)
If you're asking about whether IE is switched off on your own company's computers, then the best way would be not to ask, but rather to require that it not be turned off. Group Policy can be used for this purpose.
If you're asking about whether IE is switched off on your customer's computers that you might be installing some software on, then the best way to do it would be to document that IE must not be switched off, then to let the customer use Group Policy to make sure that IE is not switched off.
If neither of these scenarios are what you're looking for, then please update your question with more information, including why you're trying to accomplish this.
精彩评论