Jump to content

How to get the handle of a single explorer


Dizzy
 Share

Recommended Posts

Hi,

i'm looking for a way to get the control id or better the handle of a specific explorer window (not IE).

I would start a new local explorer (run ("explorer")) but i have no unique title.

So can i give or get the handle just at the start?

If i say "kill explorer" i will close all other explorer :P

Is there a little peace of code? :lmao:

Thx

Jens

Link to comment
Share on other sites

Hi!

2 points:

1. you can change the Windows Explorer's settings in the options to start a new process for every new window.

2. check the Return vlaue of the Run function:

...

Return Value

Success: The PID of the process that was launched.

...

Source: The official help file. You should have a look at it a bit more often...

The solution looks e.g. like this:

$my_explorer = Run("explorer.exe")
sleep(5000)
ProcessClose($myexplorer)

Code not tested.

I hope, it helps you,

peethebee

vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvGerman Forums: http://www.autoit.deGerman Help File: http://autoit.de/hilfe vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

Link to comment
Share on other sites

Hi!

@Valuater:

Does the Exporer not show the actual path in the title bar? This would mean, that changing the dir would reset your title modiffication. Moreover my solution is more secure. But nevertheless in many other cases your one would do it perfectly, Valuater.

peethebee

vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvGerman Forums: http://www.autoit.deGerman Help File: http://autoit.de/hilfe vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

Link to comment
Share on other sites

Hi!

I'm pleased that I could help.

Reading the help file completely could have probably avoided this question...

But anyway, stay with AutoIt.

peethebee

vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvGerman Forums: http://www.autoit.deGerman Help File: http://autoit.de/hilfe vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

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...