#RequireAdmin #include Local $oGraphic, $Null = _MakeObj($oGraphic) GUICreate("Test der Object-Funktionen") $oGraphic.StartUp() For $x = -500 To 500 Step 8 $oGraphic.Line($x, 0, $x + 500, 500) $oGraphic.Line($x, 500, $x + 500, 0) Next GUISetState() While GUIGetMsg() <> -3 WEnd Func __o_StartUp() Global $hCan = GUICtrlCreateGraphic(0,0) EndFunc Func __o_Line($x, $y, $x1, $y1) $aParameters = _($oGraphic.Line_Parameters) GUICtrlSetGraphic($hCan, 6, $aParameters[1], $aParameters[2]) GUICtrlSetGraphic($hCan, 2, $aParameters[3], $aParameters[4]) EndFunc ; #FUNCTION# ==================================================================================================================== ; Name ..........: _MakeObj ; Description ...: Creates & registers a system object fireing events wich start the functions given ; Syntax ........: _Object_CreateFromFunctions(Byref $obj, $Array) ; Parameters ....: $obj - A previously declared Variable to write the object to ; $Array - Array of function names and parameter counts ; Authors .......: minx, BugFix ; Remarks .......: [Heute, 01:08] Von name22: Mir fällt kein expliziter Verwendungszweck ein, aber es ist auf jeden Fall ziemlich cool. ; =============================================================================================================================== Func _MakeObj(ByRef $obj) Local $_=StringSplit("Func\s+__o_([\w_]+)\(([$\w_\s=,]+)?\)|$|(\$\w+)|"&Random(1000,9999,1)&'|||||',"|",2),$aFunc=StringRegExp(FileRead(@ScriptFullPath),$_[0],3),$Array[UBound($aFunc)][2],$n,$k=@TempDir&'\'&$_[3]&'.wsc' If Not IsDeclared("objContainer") Then Global $objContainer[1]=[$_[3]+OnAutoItExitRegister("_del_")] For $i = 0 To UBound($aFunc)-1 If StringLeft($aFunc[$i], 1)=$_[1] Then ContinueLoop $Array[$n][0] = $aFunc[$i] If StringLeft($aFunc[$i+1],1)=$_[1] Then $Array[$n][1]=UBound(StringRegExp($aFunc[$i+1],$_[2],3)) EndIf $n += 1 Next ReDim $Array[UBound($Array)-1][2] For $i = 0 To UBound($Array)-1 $_[16] &= $_[4]&$Array[$i][0]&'"/>'&@lf&$_[5]&$Array[$i][0]&$_[6]&'"/>'&@lf&$_[7]&$Array[$i][0]&$_[8]&$i&'"/>'&@lf $_[17] &= $_[10]&' '&$Array[$i][0]&'('&_f($Array[$i][1],",")&')'&@lf&$Array[$i][0]&$_[6]&'='&_f($Array[$i][1],'&"|"&',1)&@lf&$_[9]&$Array[$i][0]&'")'&@lf&'End '&$_[10]&@lf Next Global $oAU3Error = ObjEvent("AutoIt.Error","_er") BitOR(FileDelete($k),FileWrite($k, "<"&$_[11]&@lf&$_[12]&$_[3]&'"/>'&@lf&'<'&$_[13]&@lf&$_[16]&@lf&' An error occurred ("&$oAU3Error.description&")"&@LF) EndFunc Func _del_() For $i=0 To UBound($objContainer)-1 ConsoleWrite("-> Delete Objects (Return: "&FileDelete(@TempDir&"\"&$objContainer[$i]&".wsc")&"). Did it even exist: "&FileExists(@TempDir&"\"&$objContainer[$i]&".wsc")&@LF) Next EndFunc