steve06 Posted October 20, 2010 Share Posted October 20, 2010 Im very new to all this, just trying to figure out how to automate a button click. For example i am just trying to make a GUI with a button that says defrag and then once clicked i want it to open the defrag application and click on the button to start it. This is my case within a while loop: Run('dfrgui.exe') WinWaitActive("Disk Defragmenter") Send("{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{TAB}{ENTER}") This was working but has now stopped for some reason. I would prefer it if there was a way I could simply automate the programme to send a click to 'button 2' ...? Any help would be great. Thanks Link to comment Share on other sites More sharing options...
JohnOne Posted October 20, 2010 Share Posted October 20, 2010 (edited) I'm guessing that defrag has command line switches so I think this would be the wrong way to go about your task.For ideas about how to acheive your goal, take a look at Valuaters MAXOFF program, which I think employs it. Edited October 20, 2010 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans. Link to comment Share on other sites More sharing options...
Tvern Posted October 20, 2010 Share Posted October 20, 2010 I agree with JohnOne, but if you just want to restore the old scripts functionality you should be able to use this: Run('dfrgui.exe') $hWnd = WinWaitActive("Disk Defragmenter") ControlClick($hWnd,"","[CLASSNN:Button3]") Make sure the windows title is "Disk Defragmenter". If it doesn't work, use the au3info tool to confirm the button you want to click has the CLASSNN "Button3". Link to comment Share on other sites More sharing options...
steve06 Posted October 20, 2010 Author Share Posted October 20, 2010 Thanks! This worked perfectly! Link to comment Share on other sites More sharing options...
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