armoros Posted May 19, 2012 Posted May 19, 2012 (edited) If some one could explain to me what this exactly does and why when i try to insert it in Koda it says there is a fault... i mean the $xwin--$ywin=..... #NoTrayIcon Global $output = "" $xWin = @DesktopWidth * .5 $yWin = @DesktopHeight * .5 $gui = GUICreate("CMD Tool",$xWin,$yWin,-1,-1) $inputbox = GUICtrlCreateInput("VER",$xWin * .025,$yWin * .05,$xWin * .875,$yWin * .05) GUICtrlSetFont (-1,9, 400, 0, "Arial") $outputwin = GUICtrlCreateEdit("",$xWin * .025,$yWin * .15,$xWin * .95,$yWin * .8,2048+2097152) GUICtrlSetFont (-1,9, 400, 0, "Lucida Console") $btnGo = GUICtrlCreateButton("GO",$xWin * .925,$yWin * .05,$xWin * .05,$yWin * .05) GUICtrlSetState(-1,512) GUISetState() This is the complete script.. expandcollapse popup#NoTrayIcon Global $output = "" $xWin = @DesktopWidth * .5 $yWin = @DesktopHeight * .5 $gui = GUICreate("CMD Tool",$xWin,$yWin,-1,-1) $inputbox = GUICtrlCreateInput("VER",$xWin * .025,$yWin * .05,$xWin * .875,$yWin * .05) GUICtrlSetFont (-1,9, 400, 0, "Arial") $outputwin = GUICtrlCreateEdit("",$xWin * .025,$yWin * .15,$xWin * .95,$yWin * .8,2048+2097152) GUICtrlSetFont (-1,9, 400, 0, "Lucida Console") $btnGo = GUICtrlCreateButton("GO",$xWin * .925,$yWin * .05,$xWin * .05,$yWin * .05) GUICtrlSetState(-1,512) GUISetState() While 1 $msg = GUIGetMsg() If $msg = -3 Then ExitLoop If $msg = $btnGo Then $strCMD = GUICtrlRead($inputbox) $CMD = Run(@Comspec & " /c " & $strCMD,"",@SW_HIDE,6) While 1 $line = StdoutRead($CMD) If @error Then ExitLoop If $line = "" then $output &= $line else $output &= $line & @CRLF EndIf WEnd While 1 $line = StdErrRead($CMD) If @error Then ExitLoop If $line = "" then $output &= $line else $output &= $line & @CRLF EndIf WEnd ProcessClose($CMD) $output &= "---------------------------------------------------------------------------------------" & @CRLF & @CRLF GUICtrlSetData($inputbox,"") If StringInstr($output,"") Then GUICtrlSetData($outputwin,"") $output = "" EndIf GuiCtrlSetData($outputwin,$output) GUICtrlSetState($inputbox,256) GUICtrlSetState($btnGo,512) EndIf WEnd Exit Edited May 19, 2012 by armoros [font="verdana, geneva, sans-serif"] [/font]
water Posted May 19, 2012 Posted May 19, 2012 Looks like Koda needs absolute values for position and size. All those calculations are beeing done to make the script work independant of screen resolution. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
armoros Posted May 19, 2012 Author Posted May 19, 2012 Thank you very much Water for the explanation... [font="verdana, geneva, sans-serif"] [/font]
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