If ist keine SChleife!
Beiträge von Jam00
-
-
Eine Func darf nicht in eine Schleife!
Spoiler anzeigen
[autoit]for $x =0 to UBound($aPingAll) -1 ;
[/autoit] [autoit][/autoit] [autoit]
$IP = $aPingAll[$x]
;MsgBox("","$IP",$IP)
next
for $z =0 to UBound($ip) -1$Port = 31758
[/autoit]
$ConnectedSocket = TCPConnect($IP, $Port)
If $ConnectedSocket = -1 Then
MsgBox(16, "Error", "Es ist bei dem Verbindungsversuch ein Fehler aufgetreten, vermutlich ist kein Server gestartet!")
Exit
EndIf
call ("_senden")
;HotKeySet("^s", "_Senden") ; ctrg + s
While 1
$Empfang = TCPRecv($ConnectedSocket, 9999)
If $Empfang <> "" Then
MsgBox(0, "Nachricht", $Empfang)
EndIf
Sleep(500)
WEnd
next
Func _Senden()
$Nachricht = InputBox("Nachricht senden Client", "Schreibe deine Nachricht")
If $Nachricht <> "" Then
TCPSend($ConnectedSocket, $Nachricht)
EndIf
EndFunc ;==>_Senden -
@Deepred
Das ist irgendwie ein bischen komischSpoiler anzeigen
If WinExists ("FensterName")
$Pos = WinGetPos ("FensterName")
$XPosition = $Pos[0] - 161
$YPosition = $Pos[1] - 161 -
stell mal genaue fragen!
-
du kanst so viele schleifen rein machen wie du willst!
[autoit]For $1 = 1 To 5
[/autoit]
For $2 = 1 To 5
MsgBox (0,"",$1 & "," & $2,1)
Next
Next -
Ja und, was ist das für ein Problem? Dann mach doch einfachh ein Schleife rein!
-
das soll doch so
In die Mitte kommt ja dann halbt das was in die Gui soll, ein normales Fenster kann man doch auch nur am Ramen verschieben! -
Ich hab es jetzt so gemacht!
Spoiler anzeigen
[autoit]#include <GUIConstantsEx.au3>
[/autoit]
#include <WindowsConstants.au3>
$Ramen = GUICreate ("Transparenter Ramen",400,400,400,400,$WS_POPUP)
GUISetBkColor (0x0077FF,$Ramen)
;~ GUICtrlCreatePic (@ScriptDir & "\Data\1.bmp",0,0,400,400,$WS_CLIPSIBLINGS)
GUICtrlCreateLabel ("",0,0,400,400,$WS_EX_TRANSPARENT,$GUI_WS_EX_PARENTDRAG)
GUICtrlSetBkColor (-1,$GUI_BKCOLOR_TRANSPARENT)
$Pos = WinGetPos ($Ramen)
$Innen = GUICreate("", $Pos[2] -15, $Pos[3] -35, 5,25,$WS_POPUP,$WS_EX_MDICHILD, $Ramen);
GUISetBkColor (0x00FF00,$Innen)
GUISetState (@SW_SHOW,$Ramen)
GUISetState (@SW_SHOW,$Innen)
WinSetTrans ($Ramen,"",150)
_Ecken($Ramen,0,0,10,10)
GUIRegisterMsg($WM_MOVE, "_Move")
While 1
Sleep (100)
WEnd
Func _Ecken($h_win, $i_x1, $i_y1, $i_x3, $i_y3)
Local $XS_pos, $XS_ret, $XS_ret2
$XS_pos = WinGetPos($h_win)
$XS_ret = DllCall("gdi32.dll", "long", "CreateRoundRectRgn", "long", $i_x1, "long", $i_y1, "long", $XS_pos[2], "long", $XS_pos[3], "long", $i_x3, "long", $i_y3)
If $XS_ret[0] Then
$XS_ret2 = DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $h_win, "long", $XS_ret[0], "int", 1)
EndIf
EndFunc ;==>_GuiRoundCorners
Func _Move()
GUISetState (@SW_LOCK)
GUISetState (@SW_UNLOCK)
EndFunc -
Also ich find es irgendwie uach ein Bischen blöde, die beste lösung wird verboten, das ist doch bekloppt^^ Warum soll man sich mehr arbeit machen als sein muss, und wenn es dann warscheinlich auch noch besser geht

-
-
@Padmak
WinXP
Oscar
Hmm...aber warum geht das dann bei den Buttons ohne diese Funktion? -
Raupi
Doch, das ist gut, nur verstehe ich nicht warum es bei meinem nicht geht, weil es bei den Buttons doch auch geht!Kannst du vieleicht mir mal erklären was ich ändern muss, nur um zu wissen wie es geht, ist dann nicht schlimm wenn das mit der Transparent nicht geht, nur kapier ich halbt nich was da anders ist
@Padmak
Ich mach mal 2 Bilder rein, damit du es kapierst!
1. Bild
So wie es aussehen soll!
2. Bild
Was pasiert wenn man es verschiebt! -
@Padmak
Wie aufmunternd

@Pennywise
Also ich find es für den Anfang eigentlich ganz gut!NUr schreib nicht so großspurig, hört sich nicht gut an
-
Jo, das Desing ist cool! Aber Siro, ich würde die sachen erst Posten wenns auch halbwegs funktionier

-
Also das soll geschenen berfor sich einer Anmledet? Das könnte gehen, wenn du das als Dienst machst! Also als Windows Dienst, ich glaube die starten nähmlich vorher schon!
-
Ja, das hab, ich hab es auch einfach mal so gemacht, wie es bei den Buttons ist, aber dann geht es auch nicht!
-
was müsste ich denn machen, damit es eine richtiges CIELD-Fentser ist?
-
Okay, aber warum es bei mir nicht geht weißt du nicht? Das Problem ist ja nur das es nicht Aktualisiert wird! Warum geht es dann bei den Buttons?
Und dann hab ich es mal so gemacht, das geht fast, aber eben nur fast^^Spoiler anzeigen
[autoit]#include <GUIConstantsEx.au3>
[/autoit]
#include <WindowsConstants.au3>
$Ramen = GUICreate ("Transparenter Ramen",400,400,400,400,$WS_POPUP)
GUISetBkColor (0x0077FF,$Ramen)
GUICtrlCreateLabel ("",0,0,400,400,$WS_EX_TRANSPARENT,$GUI_WS_EX_PARENTDRAG)
$Pos = WinGetPos ($Ramen)
$Innen = GUICreate("", $Pos[2] -15, $Pos[3] -35, 5,25,$WS_POPUP,$WS_EX_MDICHILD, $Ramen);
GUISetBkColor (0x00FF00,$Innen)
GUISetState (@SW_SHOW,$Ramen)
GUISetState (@SW_SHOW,$Innen)
WinSetTrans ($Ramen,"",200)
While 1
GUISetState (@SW_LOCk,$Innen)
Sleep (100)
GUISetState (@SW_UNLOCK,$Innen)
WEnd -
Hi Leute, da binn ich mal wieder^^
Ich habe folgendes Problem:
Ich habe ein Schript geschreiben, in dem ich versuchen wollte einen Transparenten Ramen zu machen, und hab es mit CHILD-Fentser gemacht!
Allerdings wir das Fenster nicht aktualisiert
Ich muss erst ein Fenster drüberzeihen oder es Minimieren und wieder maximieren.
Ist das bei euch uach so?
Ich verstehe nucht warum das so ist! Ich habe das bei den Runde Buttons doch genaueso gemacht, und es geht!Mein versuch
[autoit]#include <GUIConstantsEx.au3>
[/autoit]
#include <WindowsConstants.au3>
$Ramen = GUICreate ("Transparenter Ramen",400,400,400,400,$WS_POPUP)
GUISetBkColor (0x0077FF,$Ramen)
GUICtrlCreateLabel ("",0,0,400,400,$WS_EX_TRANSPARENT,$GUI_WS_EX_PARENTDRAG)
$Pos = WinGetPos ($Ramen)
$Innen = GUICreate("", $Pos[2] -15, $Pos[3] -35, 5,25,$WS_POPUP,$WS_EX_MDICHILD, $Ramen);
GUISetBkColor (0x00FF00,$Innen)
GUISetState (@SW_SHOW,$Ramen)
GUISetState (@SW_SHOW,$Innen)
WinSetTrans ($Ramen,"",200)
While 1
Sleep (100)
WEndHier mal das mit den Buttons
[autoit]#include <GUIConstantsEx.au3>
[/autoit] [autoit][/autoit] [autoit]
#include <StaticConstants.au3>
#include <WindowsConstants.au3>Dim $Button[2],$Icon[2]
[/autoit]
#Region ### START Koda GUI section ### Form=C:\Dokumente und Einstellungen\Hendrik\Favoriten\Eigene Dateien\AutoIt\Übungen\XSkin\Oberfläche\XSkin.kxf
$Titel = "INC"
$Form2 = GUICreate($Titel, 555, 532, 303, 219,$WS_POPUP)
GUISetBkColor (0x00FF00)
$Pic1 = GUICtrlCreatePic(@ScriptDir & "\Data\1.bmp", 0, 0, 555, 532, $WS_CLIPSIBLINGS)
$Label1 = GUICtrlCreateLabel(" "& $Titel, 0, 0, 555, 32,$WS_EX_TRANSPARENT, $GUI_WS_EX_PARENTDRAG)
GUICtrlSetBkColor (-1,$GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetColor (-1,0xFF0A000)
GUICtrlSetFont (-1,12,550,0,"Arial")
$Button[0] = GUICreate("", 16, 16, 525, 3, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_MDICHILD), $Form2);
$Icon[0] = GUICtrlCreatePic(@ScriptDir & "\Data\X.gif",0, 0, 16, 16, BitOR($SS_NOTIFY,$WS_GROUP))
$Button[1] = GUICreate("", 16, 16, 500, 3, $WS_POPUP, BitOR($WS_EX_LAYERED, $WS_EX_MDICHILD), $Form2);
$Icon[1] = GUICtrlCreatePic(@ScriptDir & "\Data\_.gif",0, 0, 16, 16, BitOR($SS_NOTIFY,$WS_GROUP))
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $Form2, "int", 400, "long", 0x00040010);Slide von unten ein
GUISetState(@SW_SHOW,$Button[0])
GUISetState(@SW_SHOW,$Button[1])
GUISetState(@SW_SHOW,$Form2)
#EndRegion ### END Koda GUI section ###
Dim $Pfad[2][2],$Status[2]
$Pfad[0][0] = @ScriptDir & "\Data\X.gif"
$Pfad[0][1] = @ScriptDir & "\Data\X1.gif"
$Pfad[1][0] = @ScriptDir & "\Data\_.gif"
$Pfad[1][1] = @ScriptDir & "\Data\_1.gif"
$Status[0] = False
$Status[1] = False
_Ecken($Form2,0,0,10,10)
While 1
$iOldOpt = Opt("MouseCoordMode", 2)
$aPos = MouseGetPos()
$aPos3 = WinGetPos($Form2)
For $A = 0 To 1
$aPos2 = WinGetPos($Button[$A])
If IsArray ($aPos2) Then
$Point = _PointInEllipse($aPos[0], $aPos[1],$aPos2[0] - $aPos3[0] , $aPos2[1] - $aPos3[1], 16, 16)
_Pic($Icon[$A],$A)
EndIf
Next
Opt("MouseCoordMode", $iOldOpt)
$MSG = GUIGetMsg (1)
Switch $MSG[1]
Case $Button[0]
Switch $MSG[0]
Case $Icon[0]
GUIDelete ($Button[0])
GUIDelete ($Button[1])
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $Form2, "int", 400, "long", 0x00050010);Slide nach unten aus
Exit
EndSwitch
Case $Button[1]
Switch $MSG[0]
Case $Icon[1]
DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $Form2, "int", 400, "long", 0x00050005);Slide nach unten aus
GUISetState(@SW_MINIMIZE)
EndSwitch
EndSwitch
WEnd
Func _Ecken($h_win, $i_x1, $i_y1, $i_x3, $i_y3)
Local $XS_pos, $XS_ret, $XS_ret2
$XS_pos = WinGetPos($h_win)
$XS_ret = DllCall("gdi32.dll", "long", "CreateRoundRectRgn", "long", $i_x1, "long", $i_y1, "long", $XS_pos[2], "long", $XS_pos[3], "long", $i_x3, "long", $i_y3)
If $XS_ret[0] Then
$XS_ret2 = DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $h_win, "long", $XS_ret[0], "int", 1)
EndIf
EndFunc ;==>_GuiRoundCorners
Func _PointInEllipse($xPt, $yPt, $xTL, $yTL, $w, $h)
Local $bInside = False, $a = $w / 2, $b = $h / 2
Local $c1X, $c2X, $dist, $xc = $xTL + $a, $yc = $yTL + $b
$c1X = $xc - ($a ^ 2 - $b ^ 2) ^ (1 / 2); 1st focal point x position
$c2X = $xc + ($a ^ 2 - $b ^ 2) ^ (1 / 2); 2nd focal point x position
$dist = (($xPt - $c1X) ^ 2 + ($yPt - $yc) ^ 2) ^ 0.5 + (($xPt - $c2X) ^ 2 + ($yPt - $yc) ^ 2) ^ 0.5
If $dist <= $w Then $bInside = Not $bInside
Return $bInside
EndFunc ;==>_PointInEllipse
Func _Pic($hHandel,$Zahl)
If $Status[$Zahl] <> $Point Then
$Status[$Zahl] = $Point
If $Status[$Zahl] = True Then
GUICtrlSetImage ($hHandel,$Pfad[$Zahl][1])
ElseIf $Status[$Zahl] = False Then
GUICtrlSetImage ($hHandel,$Pfad[$Zahl][0])
EndIf
EndIf
EndFunc -
du kanst auch einfach ganz oben in dein script das hier schreiben:
Spoiler anzeigen
[autoit]#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
[/autoit]
#AutoIt3Wrapper_icon=1.ico ;hier pfad zum Icon
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****