SumTingWong Posted October 25, 2004 Share Posted October 25, 2004 (edited) Hi, This is the code I am trying to run: AutoItSetOption("WinSearchChildren", 1) AdlibEnable("_NoSaveScheme") _SetNoSound() AdlibDisable() Func _SetNoSound() Local $sWork $sWork = @SystemDir & "\RUNDLL32.EXE shell32.dll,Control_RunDLL mmsys.cpl,,1" Run($sWork) If WinWaitActive("Sounds and Audio Devices Properties", "", 10) Then ControlCommand("Sounds and Audio Devices Properties", "", "ComboBox1", "SelectString", "No Sounds") ;ControlClick("Sounds and Audio Devices Properties", "", "Button5") EndIf EndFunc Func _NoSaveScheme() If WinExists("Save Scheme") Then MsgBox(4096,'debug:' , 'WinExists:');### Debug MSGBOX ControlClick("Save Scheme", "", "Button2") EndIf EndFunc Basically, it opens the Sounds and Audio Devices Properties control applet and sets the sound scheme to No Sounds. However, if the active sound scheme has been modified, a modal dialog box pops up prompting you to save the existing scheme. The problem is that this modal dialog box stops even Adlib from working so I can't automatically click on the No button to dismiss it. Could anyone offer a way round this problem please? Many thanks Edited October 25, 2004 by pacman Link to comment Share on other sites More sharing options...
CyberSlug Posted October 25, 2004 Share Posted October 25, 2004 AdlibEnable("_NoSaveScheme") _SetNoSound() AdlibDisable() I think the above code causes the AdlibDisable() to be called sooner than you think... Try adding the following to the last line of your _SetNoSound() function: While WinExists("Sounds and Audio Devices Properties") sleep(100) WEnd Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! 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