Alder Posted January 9, 2006 Share Posted January 9, 2006 I noticed there have been a number of discussions here about modal dialog boxes and how to control thm, so my apologies to readers of the AutoITX group for moving this thread over here. An ActiveX control I have pops open a modal dialog box that I need to control, but I'm having no luck with getting AutoIT to come to the rescue. I need to simulate some mouse clicks or key presses, so tried using the Send method and the ControlFocus/ControlClick methods with the info I collected with the Window Info tool (great stuff, that). My code is in VBScript embedded in an HTML page and run from the button labelled "Print View" on the attached bitmap. The screen displayed there is an HTML Application, not an HTML file. The following code snippet has no apparent effect on the dialog box that I can see. Any ideas? ' "oMap" is the object in the middle frame of the screen shot; ' it's the AutoDesk MapGuide Viewer ActiveX Control ' Set objITX - CreateObject("AutoITX3.Control") Sub cmdPrint_onclick oMap.PageSetupDlg ' simulate click on Print Setup button objITX.Sleep 500 objITX.ControlFocus "Button11", "Print Setup", "11098" objITX.ControlClick "Button11", "&Print Setup", "11098" End Sub Link to comment Share on other sites More sharing options...
seandisanti Posted January 10, 2006 Share Posted January 10, 2006 I noticed there have been a number of discussions here about modal dialog boxes and how to control thm, so my apologies to readers of the AutoITX group for moving this thread over here.An ActiveX control I have pops open a modal dialog box that I need to control, but I'm having no luck with getting AutoIT to come to the rescue. I need to simulate some mouse clicks or key presses, so tried using the Send method and the ControlFocus/ControlClick methods with the info I collected with the Window Info tool (great stuff, that).My code is in VBScript embedded in an HTML page and run from the button labelled "Print View" on the attached bitmap. The screen displayed there is an HTML Application, not an HTML file. The following code snippet has no apparent effect on the dialog box that I can see. Any ideas?' "oMap" is the object in the middle frame of the screen shot;' it's the AutoDesk MapGuide Viewer ActiveX Control'Set objITX - CreateObject("AutoITX3.Control")Sub cmdPrint_onclick oMap.PageSetupDlg ' simulate click on Print Setup button objITX.Sleep 500 objITX.ControlFocus "Button11", "Print Setup", "11098" objITX.ControlClick "Button11", "&Print Setup", "11098"End Subdoes the autoit window info tool give you any details for the window you want to work with? If you could give a screenshot of the window and the window info tool, we'd be better able to help you. So you know though, there is a AutoITX forum also that may have better examples for what you're trying to do. Any solution you get here will probably be in autoit code rather than vb... 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