n9mfk9 Posted November 26, 2006 Share Posted November 26, 2006 hi all is there a way i can reed to output of the run command from the dos box to a msgbox thanks expandcollapse popup;$Group1 = GUICtrlCreateGroup("", 16, 128, 177, 49) ;$Label1 = GUICtrlCreateLabel("", 24, 144, 163, 25) ;GUICtrlCreateGroup("", -99, -99, 1, 1) ;GUICtrlSetData( $Label1, $readout) $wave="" $ans= "" $Card1= " Playback: "&RegRead("HKEY_CURRENT_USER\Software\Microsoft\Multimedia\Sound Mapper", "Playback") $card2= " Record: "&RegRead("HKEY_CURRENT_USER\Software\Microsoft\Multimedia\Sound Mapper", "Record") $readout= $card1&@CR &$card2 #include <Constants.au3> #include <GUIConstants.au3> #Region ### START Koda GUI section ### Form=c:\documents and settings\beau thompson\my documents\agui.kxf $agui_1 = GUICreate(""&$readout, 366, 264, 217, 113) GUICtrlSetData( $agui_1,$readout) $Button1 = GUICtrlCreateButton("IMIC", 24, 16, 57, 25, 0) $Button2 = GUICtrlCreateButton("AC97", 96, 16, 57, 25, BitOR($BS_CENTER,$WS_GROUP)) $Button3 = GUICtrlCreateButton("IMIC/AC97", 23, 45, 57, 25, 0) $Button4 = GUICtrlCreateButton("A97/IMIC", 95, 45, 57, 25, BitOR($BS_CENTER,$WS_GROUP)) $Button5 = GUICtrlCreateButton("INPUT", 24, 72, 57, 25, 0) $Button6 = GUICtrlCreateButton("OUTPUT", 96, 72, 57, 25, BitOR($BS_CENTER,$WS_GROUP)) $Button7 = GUICtrlCreateButton("WAVE", 23, 100, 57, 25, 0) $Button8 = GUICtrlCreateButton("MASTOR", 95, 100, 57, 25, BitOR($BS_CENTER,$WS_GROUP)) $Group1 = GUICtrlCreateGroup("", 16, 128, 177, 49) $Label1 = GUICtrlCreateLabel("ALabel1", 24, 144, 163, 25) GUICtrlCreateGroup("", -99, -99, 1, 1) $Input1 = GUICtrlCreateInput("AInput1", 16, 200, 41, 21) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### GUICtrlSetData( $Label1, $readout) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit $Card1= " Playback: "&RegRead("HKEY_CURRENT_USER\Software\Microsoft\Multimedia\Sound Mapper", "Playback") $card2= " Record: "&RegRead("HKEY_CURRENT_USER\Software\Microsoft\Multimedia\Sound Mapper", "Record") $readout= $card1&@CR &$card2 Case $Button1 $Playback = "iMic USB audio system" $Record = "iMic USB audio system" RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Multimedia\Sound Mapper", "Playback", "REG_SZ",$Playback) RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Multimedia\Sound Mapper", "Record", "REG_SZ",$Record) $Card1= " Playback: "&RegRead("HKEY_CURRENT_USER\Software\Microsoft\Multimedia\Sound Mapper", "Playback") $card2= " Record: "&RegRead("HKEY_CURRENT_USER\Software\Microsoft\Multimedia\Sound Mapper", "Record") $readout= $card1&@CR &$card2 GUICtrlSetData( $Label1, $readout) ;$Label1 = GUICtrlCreateLabel($readout, 24, 144, 163, 25) Case $Button2 $Playback = "Realtek AC97 Audio" $Record= "Realtek AC97 Audio" RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Multimedia\Sound Mapper", "Playback", "REG_SZ",$Playback) RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Multimedia\Sound Mapper", "Record", "REG_SZ",$Record) $Card1= " Playback: "&RegRead("HKEY_CURRENT_USER\Software\Microsoft\Multimedia\Sound Mapper", "Playback") $card2= " Record: "&RegRead("HKEY_CURRENT_USER\Software\Microsoft\Multimedia\Sound Mapper", "Record") $readout= $card1&@CR &$card2 GUICtrlSetData( $Label1, $readout) Case $Button3 $Playback = "iMic USB audio system" $Record = "Realtek AC97 Audio" RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Multimedia\Sound Mapper", "Playback", "REG_SZ",$Playback) RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Multimedia\Sound Mapper", "Record", "REG_SZ",$Record) $Card1= " Playback: "&RegRead("HKEY_CURRENT_USER\Software\Microsoft\Multimedia\Sound Mapper", "Playback") $card2= " Record: "&RegRead("HKEY_CURRENT_USER\Software\Microsoft\Multimedia\Sound Mapper", "Record") $readout= $card1&@CR &$card2 GUICtrlSetData( $Label1, $readout) Case $Button4 $Playback = "Realtek AC97 Audio" $Record = "iMic USB audio system" RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Multimedia\Sound Mapper", "Playback", "REG_SZ",$Playback) RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Multimedia\Sound Mapper", "Record", "REG_SZ",$Record) $Card1= " Playback: "&RegRead("HKEY_CURRENT_USER\Software\Microsoft\Multimedia\Sound Mapper", "Playback") $card2= " Record: "&RegRead("HKEY_CURRENT_USER\Software\Microsoft\Multimedia\Sound Mapper", "Record") $readout= $card1&@CR &$card2 GUICtrlSetData( $Label1, $readout) Case $Button5 Run("C:\WINDOWS\system32\sndvol32.exe") Case $Button6 Run("C:\WINDOWS\system32\sndvol32.exe -R") Case $Button7 wave() MsgBox(0,"",$ans) $wave= "set:0:0:0: volume:"&$ans $foo= Run("C:\volumeline\volumeline.exe ","",@SW_MAXIMIZE &$wave ) MsgBox(0,"",$wave) $line = StdoutRead($foo) MsgBox(0, "STDOUT read:", $line) Wend Case $Button8 EndSwitch WEnd Func wave() $ans = Round(100*2/3) ;MsgBox(0,"",$ans) If StringInStr ($card1,"Realtek AC97 Audio")Then $wave = "set:0:0:0: volume:$ans" Elseif StringInStr ($card1,"iMic USB audio system")Then EndIf Return EndFunc Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted November 26, 2006 Moderators Share Posted November 26, 2006 $iPID = Run(@Comspec & 'Whatever') $sGather = '' While Not @error $sGather &= stdOutRead($iPID) WEnd MsgBox(64, 'Info', $sGather) Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. 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