Jump to content
Sign in to follow this  
Dizzy

How to get the handle of a single explorer

Recommended Posts

Dizzy

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

Share this post


Link to post
Share on other sites
peethebee

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

Share this post


Link to post
Share on other sites
Valuater

i have set the title to control it

like this

Run( "explorer.exe " & $temp_folder & "", "", @SW_MAXIMIZE)
        Sleep(500)
        WinWaitActive("")
        WinSetTitle("", "", "*XPClean Menu* - " & $Fname)

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites
peethebee

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

Share this post


Link to post
Share on other sites
Valuater

thats true... when you change "folders" that would change the title

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites
Dizzy

Hi,

i've tried the code of peethebee and it works fine. :P

Thx

Jens

Share this post


Link to post
Share on other sites
peethebee

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

Share this post


Link to post
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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.