Sign in to follow this  
Followers 0
Olish

WinActivate doesn't activate dfrg.msc window!

6 posts in this topic

Hello everybody,

I'm trying to activate the dfrg.msc window with WinActivate() or WinWaitActive and its title "Défragmenteur de disque". It works for the other windows but NOT for dfrg.msc window. Did someone incountered this problem?

Thank you in advance for helping me.

Olivier, from France.


Olivier, from France.Free Wake On LAN script

Share this post


Link to post
Share on other sites



i wrote *XPClean Menu* ( in my signature below)

and after careful thought, i realized that NOTHING should be open if you are going to use the defragmenter... not evn *XPClean Menu*,

so it closes when the defrag window appears

if you think of the defragments utility, you will agree

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

I find how to activate the dfrg.msc window. It was just the syntax tha was incorrect.

Before: WinActivate("Défragmenteur")

After: "WinActivate("Défragmenteur", "")

Thank you.

Olivier, from France.

Edited by Olish

Olivier, from France.Free Wake On LAN script

Share this post


Link to post
Share on other sites

got it

$Title = "Disk Defragmenter"; "MMCMainFrame"


$PID = Run("mmc Dfrg.msc", @SystemDir)
sleep(3000)

; click other window to put on top for testing 

ControlClick( $Title, "", "msctls_statusbar321")

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

Thank you a lot for helping me.

:o

And like it is in French:

"Vive AutoIt!"

Olivier, from France.


Olivier, from France.Free Wake On LAN script

Share this post


Link to post
Share on other sites

Thank you a lot for helping me.

:geek:

And like it is in French:

"Vive AutoIt!"

Olivier, from France.

I don't think the explanation was right WinActivate("title") and WinActivate("title","") do the same.

The problem can come from the fact you nedd to wait that the windows exist before activating it if needed.

$Title = "Défragmenteur de disque"; "MMCMainFrame"


$PID = Run("mmc Dfrg.msc", @SystemDir)
WinWait($Title)
$n=WinActivate($Title)
MsgBox(262144,'Debug line ~42','Selection:' & @lf & '$n' & @lf & @lf & 'Return:' & @lf & $n & @lf & @lf & '@Error:' & @lf & @Error);### Debug MSGBOX

try this code Thanks :o

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  
Followers 0