Jump to content

ProcessExists("Explorer.exe") - PID w/o Shell?


Recommended Posts

Here's a stumper.

>ProcessExists("Explorer.exe") will return a PID even when the shell isn't deployed.

AND

>WinExists("Explorer.exe") will return 0 whether or not the shell is up.

:(

Looking for a way to reliably detect whether or not the Explorer is actually running as the shell (not just set in the system.ini or registry) in Windows with au3.

Any thoughts???

Thanks folks!

[center][font="Courier"][quote]Which end do you put the cheesecake in?[/quote][/font][/center]

Link to comment
Share on other sites

You could try to use one of the windows that explorer (shell) uses constantly. This example shows the taskbar, which displays it to hide for 5 seconds, then show it again. This has been tested on XP Pro.

Opt("WinTitleMatchMode", 4)

$handle = 'classname=Shell_TrayWnd'

If WinExists($handle) Then
    WinSetState($handle, '', @SW_HIDE)
    Sleep(5000)
EndIf

If WinExists($handle) Then
    WinSetState($handle, '', @SW_SHOW)
EndIf

A utility to locate these hidden windows can be found here at Nirsoft.

Link to comment
Share on other sites

Looking for a way to reliably detect whether or not the Explorer is actually running as the shell (not just set in the system.ini or registry) in Windows with au3.

<{POST_SNAPBACK}>

I'd still check the registry and ini keys...

For WinXP, it's $shell = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon", "Shell")

I believe the keys need to be set in order for the shell to work, but I could be wrong. I tried out some shell switcher program a few years ago, but I can't remember the name.

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
Link to comment
Share on other sites

@MHz:

Thanks for the tip . . .

Question: Why do we need to hide and then show the taskbar (if the shell is dead, the taskbar process should not exist???) to determine if it is viable?

Wouldn't this work as reliably:

Opt("WinTitleMatchMode", 4)

$handle = 'classname=Shell_TrayWnd'

If WinExists($handle) Then
   ;Do something to let the world know that Mr. Gates is on the prowl...
EndIf

???

Thanks for the terrific input!

@CyberSlug:

Already got that in the code ... can change that (shell) value on the fly after boot -- Explorer may or may not have been invoked by the time a read is done :(

Thanks for the help!

[center][font="Courier"][quote]Which end do you put the cheesecake in?[/quote][/font][/center]

Link to comment
Share on other sites

With the new beta you can use COM to get a collection of the shell objects and then figure out all sorts of things about them:

Dim $ObjShell = ObjCreate("Shell.Application")
Dim $ObjShellWindows = $ObjShell.Windows(); collection of all ShellWindows (IE and File Explorer)
For $item = 0 to ($ObjShellWindows.count - 1)
    $ObjIE = $ObjShellWindows.item($item); this is an InternetExplorer object
etc.
More information of the properties of the returned objects here: http://msdn.microsoft.com/library/default....netexplorer.asp

Dale

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y

Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Link to comment
Share on other sites

Thanks, Dale!

Looks like there's good stuff in that litterbox.

Need to get out my copy of the beta and scruff it up a bit :(

BTW -- Any ETA on the final???

[center][font="Courier"][quote]Which end do you put the cheesecake in?[/quote][/font][/center]

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...