Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Detect if Windows Services window is running?


2 replies to this topic

koden

koden
  • Members
  • 3 posts

Posted 28 October 2005 - 22:59

I need to check OnFirstUIBefore and OnMaintUIBefore if the Windows Services window is still running. I tried the List applications example on the website, but that only checks for processname.exe. In this case it uses mmc.exe, but that's not specific to just Windows Services. Is there a way to check this?

I know that you can do FindWindow("", "Services") and check if that is NULL or not. NULL being it doesn't exist, but what if you open Computer Management and select services? I'll need to detect that. Also if you open mmc and then "add" a snap-in, you also miss that since the caption is not always "Services" in those cases.

Is there way I can use MMC API to enumerate what's active in mmc and then check for Services? I can't figure it out looking at the API. Any suggestions would be great.

Thanks

Edited by koden, 29 October 2005 - 00:24.


Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

Posted 29 October 2005 - 02:41

I see that you've since edited the post to identify some of the added complications of fully/correctly deteting this situation.

Therefore, in my opinion, simply requiring one to close all instances of mmc.exe, while overkill, would be reasonable.

I'm not familiar with the MMC API calls, so I tried an alternative approaching of quickly looking at the DLLs in use by MMC for possible service-specific entries. However, I don't see any obvious ones.


user posted image

koden

koden
  • Members
  • 3 posts

Posted 02 November 2005 - 19:21

I can't just have them kill every mmc.exe, because in some cases it will depend on those to be open. All I need to make sure, is that services only is not running.

Here are the scenarios:
1) mmc.exe is run directly with windows services, so window name is "Services"
2) mmc.exe is run, then Services is a snap-in, which it won't say "Services"
3) Computer Management console shows services.

I need to check the last two cases. Can anyone help?