Olish Posted February 10, 2006 Posted February 10, 2006 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
Valuater Posted February 10, 2006 Posted February 10, 2006 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)
Olish Posted February 10, 2006 Author Posted February 10, 2006 (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 February 10, 2006 by Olish Olivier, from France.Free Wake On LAN script
Valuater Posted February 10, 2006 Posted February 10, 2006 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)
Olish Posted February 10, 2006 Author Posted February 10, 2006 Thank you a lot for helping me. And like it is in French: "Vive AutoIt!" Olivier, from France. Olivier, from France.Free Wake On LAN script
jpm Posted February 14, 2006 Posted February 14, 2006 Thank you a lot for helping me. 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now