Für meine kenntnisse ist das noch zu hoch, ich begnüge mich erst mal mit GUIDelete()^^
Beiträge von hauke96
-
-
hm naja, also gibts sowas eher nciht, weil mit DLLs brauchst du mir nicht kommen, da versteht ich nichts.^^
nun gut, dann halt mit GUIDelete().danke für die Hilfe.
mfg
hauke96 -
Hallo,
ich habe eine frage, ich möchte bei einer GUI gerne alle darauf befindlichen Controls auf einmal löschen.
Mit GUICtrlDelete() kann man ja nur ein Control löschen und bei so 20 Controls wirds dann schon lang. Geht das nicht anders?mfg
hauke96 -
Hallo,
ja das mit hart, ist ein wenig zu....hart^^. Ich habs mal eingebaut.
Mit dem dauernd neustarten finde ich auch doff, aber ich habs bisher noch nciht hinbekommen, dass er wieder am Vormenü anfängt und man dann von vorne anfangen kann, ich bastel aber weiter.
Das mit der Highscore hatte ich auch schon, kommt auch dem nächst, eventuell online, aber wahrscheinlich nicht.
Der eigen Modi ist eine GENIALE idee, da wäre ich wirkliche nieeee drauf gekommen, mache ich 100%ig.mfg
hauke96 -
genau, das sollten die echt mal machen. xDD
ich hab jetzt noch ein wenig dran rumgebastelt und einen weiteren Schwierigkeitsgrad hinzugefügt: HART, da hat man dann fast keine chance mehr durch zu kommen, aber naja^^.
ich hab außerdem die Bugs behoben und die Strahlen sind nun von Level zu Level unterschiedlich schnell, außerdem hab ich ein Vormenü mit Info Label gemachtviel Spaß

mfg
hauke96 -
musst gucken ob das hier geht:
if schleife, also wenn auf die GUI geklickt wurde, dann --> GuiDelete()
dann gibt es ja wieder das vorherige fenster, welches aktiv war, also müsste auch das wieder aktiv werden.
und dann halt mit wingettitle... das aktive fenster bekommen.ich weiß echt nciht ob das funktioniert, aber wenn ja, dann hast du glück.
den mausklick auf die Gui kannst du mit GUIGetCursorInfo() rausbekommen.
mfg
hauke96ps.: genaueren code evt. morgen
-
ja so eine möglickeit gibt es und zwar mit
[autoit]GUIGetCursorInfo
[/autoit]
damit kannst du gucken über welchem Control sich die maus befindet, guck mal in der hilfe nach.mfg
hauke96 -
:o zu EINFACH!!!! Ich hatte es erst schwerer, aber dachte, dass es zuuuu schwer sei, aber gut, ich werds mal bearbeiten, + ein wenig bux-fixing. Das mit der info ist auch gut, mach ich auch mal
mfg
hauke96 -
Soo, ich hab nu etwas wietergemacht und den Vortschritt im ertsen Beitrag editiert. V1.1 ist nun die neue verison, viel spaß beim ausprobieren

-
danke^^
ich mach da auch noch weiter und das mit den Schwierigkeitsstufen ist eine gute idee! Versuch ich dem nächst mal.
-
Moin,
also das mit dem "Gleiche Zahlen Bug" kann cih dem nächst ändern, aber das manachmal Zahlen größer 49 rauskommen, verstehe ich NICHT, weil ja in Zeile 42-53 alle Zahlen ÜBER 49 verkleinert werden, somit müsste z.B. 50 auch verkleinert werden, aber warum wird 50 nicht verkleinert? ich verstehe es nicht!!!

ansonsten mit der sortierung etc. kenn ich mich nciht aus. Ich weiß nur es gibt 48 zahlen und wer 6 richtige hat gewinnt n paar Millionen.
mfg
hauke96 -
Hallo,
ich habe einen Algorithmus entwickelt, der die genauen 6 Zahlen für die nächste Lotto ziehung errechnet...^^ nein scherz.
der Vater eines Freundes wollte aus Spaß son programm haben, ich habs ihm gecodet. Am nächsten tag hat er die Zahlen in den Schein eingetragen und hat folgendes gewonnen: ...... nichts xDDalso der erfolg ist nciht garantiert^^
Code:
Spoiler anzeigen
[autoit]#include <GUIConstantsEx.au3>
[/autoit]
Global $Z1 = 1, $Z2 = 42, $Z3 = 26, $Z4 = 18, $Z5 = 39, $Z6 = 8, $msg
GUICreate("Lotto Zahlen", 230, 100)
GUICtrlCreateLabel( "Zahlen für die nächste Lotto Ziehung:", 5, 10)
Global $btn_generic = GUICtrlCreateButton( "Generieren", 10, 30, 100, 20)
Global $btn_beenden = GUIctrlcreatebutton( "Beenden", 116, 30, 100, 20)
$I1 = GUICtrlCreateInput( "", 10, 60, 30, 20)
$I2 = GUICtrlCreateInput( "", 45, 60, 30, 20)
$I3 = GUICtrlCreateInput( "", 80, 60, 30, 20)
$I4 = GUICtrlCreateInput( "", 115, 60, 30, 20)
$I5 = GUICtrlCreateInput( "", 150, 60, 30, 20)
$I6 = GUICtrlCreateInput( "", 185, 60, 30, 20)
GUISetState()
start()
func start()
while 1
$msg = GUIGetMsg()
Select
case $msg = -3
Exit
case $msg = $btn_beenden
Exit
case $msg = $btn_generic
show()
EndSelect
WEnd
EndFunc
func show()
GUICtrlSetData($btn_generic, "Stop")
while 1
$msg = GUIGetMsg()
$Z1 = $Z1 + 1
$Z2 = $Z2 + 2
$Z3 = $Z3 + 3
$Z4 = $Z4 + 8
$Z5 = $Z5 + 3
$Z6 = $Z6 + 9
Select
case $msg = $btn_generic
GUICtrlSetData($btn_generic, "Generieren")
start()
case $Z1 > 49
$Z1 = Random(0, 11, 1)
case $Z2 > 49
$Z2 = Random(5, 21, 1)
case $Z3 > 49
$Z3 = Random(1, 5, 1)
case $Z4 > 49
$Z4 = Random(0, 6, 1)
case $Z5 > 49
$Z5 = Random(11, 28, 1)
case $Z6 > 49
$Z6 = Random(8, 15, 1)
EndSelect
GUICtrlSetData($I1, $Z1)
GUICtrlSetData($I2, $Z2)
GUICtrlSetData($I3, $Z3)
GUICtrlSetData($I4, $Z4)
GUICtrlSetData($I5, $Z5)
GUICtrlSetData($I6, $Z6)
sleep(20)
WEnd
EndFuncIst ein total simples Prinzip. Bitte verbesserungen, kritiken, Tipps etc. nennen, danke!
mfg
hauke96 -
Moin Moin,
ich habe letztens mich mit GDI+ beschäftigt und mein erstes GDI+ Werk erstellt. Es ist eine art Spiel oder so, keine ahnung^^
Damit kann man die Reaktionsfähigkeit von einem testen. Wenn man binnen 500 Millisekunden ab dem erscheinen eines Viereckes keine Pfeiltaste gedrückt hat, so hat man verloren.V1.2:
- Neue schwierigkeitsstufe: HART
- Bug mit dem roten "Laserstrahl" behoben
- Vormenü
- Infos werden im Vormenü angezeigt
- verschiedene Geschwindigkeiten in unterschiedlichen Levels
CodeV1.2:Spoiler anzeigen
[autoit]#include <GDIPlus.au3>
[/autoit]
#include <WindowsConstants.au3>
#include <GuiConstantsEx.au3>
#include <Misc.au3>
Global $aPoints[13][2],$bPoints[13][2], $hWnd, $hGraphic, $wPressed = 0, $gPressed = 0, $iX, $iY, $GO_lbl, $var
_GDIPlus_Startup()
$hWnd = GUICreate("Geschick", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP)
GUISetBkColor(0x343434)
Global $lbl_leicht = GUICtrlCreateLabel(" Leicht", @DesktopWidth / 2 - 200, 200, 400, 60)
GUICtrlSetFont(-1, 30, 750,0, "Courier New")
GUICtrlSetBkColor(-1, 0x000FF00)
Global $lbl_mittel = GUICtrlCreateLabel(" Mittel", @DesktopWidth / 2 - 200, 280, 400, 60)
GUICtrlSetFont(-1, 30, 750,0, "Courier New")
GUICtrlSetBkColor(-1, 0xFFFF00)
Global $lbl_schwer = GUICtrlCreateLabel(" Schwer", @DesktopWidth / 2 - 200, 360, 400, 60)
GUICtrlSetFont(-1, 30, 750,0, "Courier New")
GUICtrlSetBkColor(-1, 0xFF4600)
Global $lbl_hart = GUICtrlCreateLabel(" Hart", @DesktopWidth / 2 - 200, 440, 400, 60)
GUICtrlSetFont(-1, 30, 750,0, "Courier New")
GUICtrlSetBkColor(-1, 0xAA0000)
Global $lbl_beenden = GUICtrlCreateLabel(" Beenden", @DesktopWidth / 2 - 200, 520, 400, 60)
GUICtrlSetFont(-1, 30, 750,0, "Courier New")
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x000000)
$lbl_info = GUICtrlCreateLabel("", @DesktopWidth / 2 + 250, 200, 400, 500)
GUICtrlSetColor(-1, 0x00FF00)
GUICtrlSetFont(-1, 12, 400, 0, "Courier New")
GUISetState()
while 1
$msg = GUIGetMsg()
$cPos = GUIGetCursorInfo()
Select
case $msg = $lbl_leicht
$schwierigkeit = "leicht"
ExitLoop
case $msg = $lbl_mittel
$schwierigkeit = "mittel"
ExitLoop
case $msg = $lbl_schwer
$schwierigkeit = "schwer"
ExitLoop
case $msg = $lbl_hart
$schwierigkeit = "hart"
ExitLoop
case $msg = $lbl_beenden
_exit_noob()
case $cPos[4] = $lbl_leicht And $var <> "leicht"
$info_msg = "INFOS:" & @CRLF & "Stufe: Leicht" & @CRLF & "Verloren nach - 10 - Fehltreffern" & @CRLF & "Gewonnen nach - 20 - Treffern" & @CRLF & "Maximaler Abstand zwischen Viereckgeneratrion: 2000 Millisekunden" & @CRLF & "Maximale Wartezeit: 1000 Millisekunden"
GUICtrlSetData($lbl_info, $info_msg)
$var = "leicht"
case $cPos[4] = $lbl_mittel And $var <> "mittel"
$info_msg = "INFOS:" & @CRLF & "Stufe: Mittel" & @CRLF & "Verloren nach - 7 - Fehltreffern" & @CRLF & "Gewonnen nach - 40 - Treffern" & @CRLF & "Maximaler Abstand zwischen Viereckgeneratrion: 1500 Millisekunden" & @CRLF & "Maximale Wartezeit: 750 Millisekunden"
GUICtrlSetData($lbl_info, $info_msg)
$var = "mittel"
case $cPos[4] = $lbl_schwer And $var <> "schwer"
$info_msg = "INFOS:" & @CRLF & "Stufe: Schwer" & @CRLF & "Verloren nach - 3 - Fehltreffern" & @CRLF & "Gewonnen nach - 60 - Treffern" & @CRLF & "Maximaler Abstand zwischen Viereckgeneratrion: 850 Millisekunden" & @CRLF & "Maximale Wartezeit: 450 Millisekunden" & @CRLF & @CRLF & "ACHTUNG: SCHWER!"
GUICtrlSetData($lbl_info, $info_msg)
$var = "schwer"
case $cPos[4] = $lbl_hart And $var <> "hart"
$info_msg = "INFOS:" & @CRLF & "Stufe: ... Death" & @CRLF & "Verloren nach - 1 - Fehltreffern" & @CRLF & "Gewonnen nach - 70 - Treffern" & @CRLF & "Maximaler Abstand zwischen Viereckgeneratrion: 550 Millisekunden" & @CRLF & "Maximale Wartezeit: 300 Millisekunden" & @CRLF & @CRLF & "VERGISS ES!"
GUICtrlSetData($lbl_info, $info_msg)
$var = "hart"
case $cPos[4] = $lbl_beenden And $var <> "beenden"
GUICtrlSetData($lbl_info, "Willst du schon aufgeben?")
$var = "beenden"
EndSelect
WEnd
GUICtrlDelete($lbl_beenden)
GUICtrlDelete($lbl_leicht)
GUICtrlDelete($lbl_mittel)
GUICtrlDelete($lbl_schwer)
GUICtrlDelete($lbl_hart)
GUICtrlDelete($lbl_info)
if $schwierigkeit = "leicht" Then
$random_speed = 2000
$daneben_speed = 1000
$treffer_gewonnen = 20
$treffer_verloren = 10
$speed = 17
$speed_abstand = 10
EndIf
if $schwierigkeit = "mittel" Then
$random_speed = 1500
$daneben_speed = 750
$treffer_gewonnen = 40
$treffer_verloren = 7
$speed = 5
$speed_abstand = 11
EndIf
if $schwierigkeit = "schwer" Then
$random_speed = 850
$daneben_speed = 450
$treffer_gewonnen = 60
$treffer_verloren = 3
$speed = 1
$speed_abstand = 30
EndIf
if $schwierigkeit = "hart" Then
$random_speed = 550
$daneben_speed = 300
$treffer_gewonnen = 70
$treffer_verloren = 1
$speed = 1
$speed_abstand = 30
EndIf
$fail_lbl = GUICtrlCreateLabel("Daneben: " & $wPressed, 100, 500, 500, 50)
GUICtrlSetFont(-1, 20, 300, 0, "Times New Roman")
GUICtrlSetColor(-1, 0xFF0000)
$good_lbl = GUICtrlCreateLabel( "Getroffen: " & $gPressed, 100, 550, 300, 50)
GUICtrlSetFont(-1, 20, 300, 0, "Times New Roman")
GUICtrlSetColor(-1, 0x00FF00)
Global $GO_lbl = GUICtrlCreateLabel("", 600, 200, 300, 90)
GUICtrlSetColor(-1, 0x1F3FF0)
GUICtrlSetFont(-1, 70, 300, 0, "Arial")
GUICtrlCreateLabel("Hilfe:", 750, 500, 100, 40)
GUICtrlSetFont(-1, 24, 1200, 4, "Courier New")
GUICtrlSetColor(-1, 0xF0F000)
$hilfe_text = "Es erscheinen immer in zufälligen Abständen Gelbe Vierecke an einer der vier Ecken des Kreuzes. Man muss nun die jeweilige Pfeiltaste drücken, die zu dem Viereck zeigt. Wenn das Gelbe viereck nun an der Rechten Ecke des Kreuzes ist, muss man die rechte Pfeiltaste drücken. Wenn man binnen " & $daneben_speed & " Millisekunden Sekunden von erscheinen des Gelben Vierecks keine Pfeiltaste gedrückt hat, hat man verloren. Man gewinnt indem man " & $treffer_gewonnen & " mal die Gelben Vierecke getroffen hat."
GUICtrlCreateLabel($hilfe_text, 750, 550, 300, 200)
GUICtrlSetFont(-1, 10, 550, 0)
GUISetState()
Global $lbl_start = GUICtrlCreateLabel(" Start", 750, 105, 230, 30)
GUICtrlSetFont(-1, 20, 750,0, "Courier New")
GUICtrlSetBkColor(-1, 0x000FF00)
Global $lbl_exit = GUICtrlCreateLabel(" Beenden", 750, 145, 230, 30)
GUICtrlSetFont(-1, 20, 750,0, "Courier New")
GUICtrlSetBkColor(-1, 0x000FF00)
Global $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hWnd)
$aPoints[0][0] = 12
$aPoints[1][0] = 330
$aPoints[1][1] = 230
$aPoints[2][0] = 330
$aPoints[2][1] = 100
$aPoints[3][0] = 370
$aPoints[3][1] = 100
$aPoints[4][0] = 370
$aPoints[4][1] = 230
$aPoints[5][0] = 500
$aPoints[5][1] = 230
$aPoints[6][0] = 500
$aPoints[6][1] = 270
$aPoints[7][0] = 370
$aPoints[7][1] = 270
$aPoints[8][0] = 370
$aPoints[8][1] = 400
$aPoints[9][0] = 330
$aPoints[9][1] = 400
$aPoints[10][0] = 330
$aPoints[10][1] = 270
$aPoints[11][0] = 200
$aPoints[11][1] = 270
$aPoints[12][0] = 200
$aPoints[12][1] = 230
$hPen = _GDIPlus_BrushCreateSolid(0xFF000000)
sleep(1)
_GDIPlus_GraphicsFillPolygon($hGraphic, $aPoints, $hPen)
while 1
$msg = GUIGetMsg()
Select
case $msg = $lbl_exit
Exit
case $msg = $lbl_start
ExitLoop
EndSelect
WEnd
GUICtrlSetData($GO_lbl, "3")
sleep(500)
GUICtrlSetData($GO_lbl, "2")
sleep(500)
GUICtrlSetData($GO_lbl, "1")
sleep(500)
GUICtrlSetData($GO_lbl, "GO!!")
sleep(500)
GUICtrlSetData($GO_lbl, "")
_choose_random_pos()
Func _choose_random_pos()
$iPos = Random(1,4, 1)
Switch $iPos
case 1
_create_P1()
case 2
_create_P2()
case 3
_create_P3()
case 4
_create_P4()
EndSwitch
EndFunc
func _create_P1()
Global $hPen = _GDIPlus_BrushCreateSolid(0xFFFFFF00), $iX = 330, $iY = 60
_GDIPlus_GraphicsFillRect($hGraphic, 330, 60, 40, 40, $hPen)
$timer_start = TimerInit()
While 1
if _IsPressed(26) Then
$gPressed += 1
_schiess("Oben")
Else
if _IsPressed(25) Or _IsPressed(27) Or _IsPressed(28) Then
$wPressed += 1
GUICtrlSetData($fail_lbl, "Daneben: " & $wPressed)
if $wPressed = $treffer_verloren Then _end_Point()
sleep(200)
$timer_start = TimerInit()
EndIf
EndIf
if GUIGetMsg() = $lbl_exit Then Exit
if TimerDiff($timer_start) >= $daneben_speed Then
GUICtrlSetData($fail_lbl, "Daneben: --- Zu lange gewartet ---")
$wPressed = $treffer_verloren
_end_Point()
EndIf
WEnd
EndFunc
func _create_P2()
Global $hPen = _GDIPlus_BrushCreateSolid(0xFFFFFF00), $iX = 500, $iY = 230
_GDIPlus_GraphicsFillRect($hGraphic, 500, 230, 40, 40, $hPen)
$timer_start = TimerInit()
While 1
if _IsPressed(27) Then
$gPressed += 1
_schiess("Rechts")
_end_Point()
Else
if _IsPressed(26) Or _IsPressed(25) Or _IsPressed(28) Then
$wPressed += 1
GUICtrlSetData($fail_lbl, "Daneben: " & $wPressed)
if $wPressed = $treffer_verloren Then _end_Point()
sleep(200)
$timer_start = TimerInit()
EndIf
EndIf
if GUIGetMsg() = $lbl_exit Then Exit
if TimerDiff($timer_start) >= $daneben_speed Then
GUICtrlSetData($fail_lbl, "Daneben: --- Zu lange gewartet ---")
$wPressed = $treffer_verloren
_end_Point()
EndIf
WEnd
EndFunc
func _create_P3()
Global $hPen = _GDIPlus_BrushCreateSolid(0xFFFFFF00), $iX = 330, $iY = 400
_GDIPlus_GraphicsFillRect($hGraphic, 330, 400, 40, 40, $hPen)
$timer_start = TimerInit()
While 1
if _IsPressed(28) Then
$gPressed += 1
_schiess("Unten")
_end_Point()
Else
if _IsPressed(26) Or _IsPressed(27) Or _IsPressed(25) Then
$wPressed += 1
GUICtrlSetData($fail_lbl, "Daneben: " & $wPressed)
if $wPressed = $treffer_verloren Then _end_Point()
sleep(200)
$timer_start = TimerInit()
EndIf
EndIf
if GUIGetMsg() = $lbl_exit Then Exit
if TimerDiff($timer_start) >= $daneben_speed Then
GUICtrlSetData($fail_lbl, "Daneben: --- Zu lange gewartet ---")
$wPressed = $treffer_verloren
_end_Point()
EndIf
WEnd
EndFunc
func _create_P4()
Global $hPen = _GDIPlus_BrushCreateSolid(0xFFFFFF00), $iX = 140, $iY = 230
_GDIPlus_GraphicsFillRect($hGraphic, 160, 230, 40, 40, $hPen)
$timer_start = TimerInit()
While 1
if _IsPressed(25) Then
$gPressed += 1
_schiess("Links")
_end_Point()
Else
if _IsPressed(26) Or _IsPressed(27) Or _IsPressed(28) Then
$wPressed += 1
GUICtrlSetData($fail_lbl, "Daneben: " & $wPressed)
if $wPressed = $treffer_verloren Then _end_Point()
sleep(200)
$timer_start = TimerInit()
EndIf
EndIf
if GUIGetMsg() = $lbl_exit Then Exit
if TimerDiff($timer_start) >= $daneben_speed Then
GUICtrlSetData($fail_lbl, "Daneben: --- Zu lange gewartet ---")
$wPressed = $treffer_verloren
_end_Point()
EndIf
WEnd
EndFunc
func _end_Point()
GUICtrlSetData($good_lbl, "Getroffen: " & $gPressed)
$hPen = _GDIPlus_BrushCreateSolid(0xFF343434)
_GDIPlus_GraphicsFillRect($hGraphic, 330, 40, 40, 60, $hPen); $iX = 330, $iY = 100
_GDIPlus_GraphicsFillRect($hGraphic, 330, 400, 40, 60, $hPen); $iX = 330, $iY = 400
_GDIPlus_GraphicsFillRect($hGraphic, 500, 230, 60, 40, $hPen); $iX = 500, $iY = 230
_GDIPlus_GraphicsFillRect($hGraphic, 140, 230, 60, 40, $hPen); $iX = 160, $iY = 230
if $gPressed = $treffer_gewonnen Then
MsgBox(0, "WIN", "Sie haben gewonnen")
Exit
EndIf
if $wPressed = $treffer_verloren Then
MsgBox(0, "LOOSE", "Sie haben verloren")
Exit
EndIf
$iWait = Random(200, $random_speed, 100)
sleep($iWait)
_choose_random_pos()
EndFunc
func _schiess($Richtung)
$hPen = _GDIPlus_BrushCreateSolid(0xFFFF0000)
$hPen_uebermalen = _GDIPlus_BrushCreateSolid(0xFF000000)
if $Richtung = "Oben" Then
$hX = 345
$hY = 210
while 1
_GDIPlus_GraphicsFillRect($hGraphic, $hX, $hY + $speed_abstand, 10, 40, $hPen_uebermalen)
_GDIPlus_GraphicsFillRect($hGraphic, $hX, $hY, 10, 40, $hPen)
if $hY <= 60 Then _end_Point()
$hY -= $speed_abstand
sleep($speed)
WEnd
EndIf
if $Richtung = "Unten" Then ; $iX = 330, $iY = 400
$hX = 345
$hY = 230
while 1
_GDIPlus_GraphicsFillRect($hGraphic, $hX, $hY - $speed_abstand, 10, 40, $hPen_uebermalen)
_GDIPlus_GraphicsFillRect($hGraphic, $hX, $hY, 10, 40, $hPen)
if $hY >= 400 Then _end_Point()
$hY += $speed_abstand
sleep($speed)
WEnd
EndIf
if $Richtung = "Rechts" Then ; $iX = 500, $iY = 230
$hX = 350
$hY = 245
while 1
_GDIPlus_GraphicsFillRect($hGraphic, $hX - $speed_abstand, $hY, 40, 10, $hPen_uebermalen)
_GDIPlus_GraphicsFillRect($hGraphic, $hX, $hY, 40, 10, $hPen)
if $hX >= 500 Then _end_Point()
$hX += $speed_abstand
sleep($speed)
WEnd
EndIf
if $Richtung = "Links" Then ; $iX = 160, $iY = 230
$hX = 350
$hY = 245
while 1
_GDIPlus_GraphicsFillRect($hGraphic, $hX + $speed_abstand, $hY, 40, 10, $hPen_uebermalen)
_GDIPlus_GraphicsFillRect($hGraphic, $hX, $hY, 40, 10, $hPen)
if $hX <= 160 Then _end_Point()
$hX -= $speed_abstand
sleep($speed)
WEnd
EndIf
EndFunc
func _exit_noob()
GUICtrlDelete($lbl_beenden)
GUICtrlDelete($lbl_leicht)
GUICtrlDelete($lbl_mittel)
GUICtrlDelete($lbl_schwer)
GUICtrlDelete($lbl_hart)
GUICtrlDelete($lbl_info)
GUICtrlCreateLabel("Wusst ichs doch .....", @DesktopWidth / 2 - 400, @DesktopHeight / 2 - 100, 800, 60)
GUICtrlSetFont(-1, 40, 400, 0, "Courier New")
GUICtrlSetColor(-1, 0xFF0000)
sleep(1300)
Exit
EndFunc
V1.1:
- 3 Schwierigkeitsstufen
- Vormenü
- schneller abschießen
CodeV1.1:Spoiler anzeigen
[autoit]#include <GDIPlus.au3>
[/autoit]
#include <WindowsConstants.au3>
#include <GuiConstantsEx.au3>
#include <Misc.au3>
Global $aPoints[13][2],$bPoints[13][2], $hWnd, $hGraphic, $wPressed = 0, $gPressed = 0, $iX, $iY, $GO_lbl
_GDIPlus_Startup()
$hWnd = GUICreate("Geschick", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP)
GUISetBkColor(0x343434)
Global $lbl_leicht = GUICtrlCreateLabel(" Leicht", @DesktopWidth / 2 - 200, 200, 400, 60)
GUICtrlSetFont(-1, 30, 750,0, "Courier New")
GUICtrlSetBkColor(-1, 0x000FF00)
Global $lbl_mittel = GUICtrlCreateLabel(" Mittel", @DesktopWidth / 2 - 200, 280, 400, 60)
GUICtrlSetFont(-1, 30, 750,0, "Courier New")
GUICtrlSetBkColor(-1, 0xFFFF00)
Global $lbl_schwer = GUICtrlCreateLabel(" Schwer", @DesktopWidth / 2 - 200, 360, 400, 60)
GUICtrlSetFont(-1, 30, 750,0, "Courier New")
GUICtrlSetBkColor(-1, 0xFF0000)
Global $lbl_beenden = GUICtrlCreateLabel(" Beenden", @DesktopWidth / 2 - 200, 440, 400, 60)
GUICtrlSetFont(-1, 30, 750,0, "Courier New")
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x000000)
GUISetState()
while 1
$msg = GUIGetMsg()
Select
case $msg = $lbl_leicht
$schwierigkeit = "leicht"
ExitLoop
case $msg = $lbl_mittel
$schwierigkeit = "mittel"
ExitLoop
case $msg = $lbl_schwer
$schwierigkeit = "schwer"
ExitLoop
case $msg = $lbl_beenden
Exit
EndSelect
WEnd
GUICtrlDelete($lbl_beenden)
GUICtrlDelete($lbl_leicht)
GUICtrlDelete($lbl_mittel)
GUICtrlDelete($lbl_schwer)
if $schwierigkeit = "leicht" Then
$random_speed = 2000
$daneben_speed = 1000
$treffer_gewonnen = 20
$treffer_verloren = 10
EndIf
if $schwierigkeit = "mittel" Then
$random_speed = 1500
$daneben_speed = 750
$treffer_gewonnen = 30
$treffer_verloren = 7
EndIf
if $schwierigkeit = "schwer" Then
$random_speed = 1000
$daneben_speed = 500
$treffer_gewonnen = 40
$treffer_verloren = 5
EndIf
$fail_lbl = GUICtrlCreateLabel("Daneben: " & $wPressed, 100, 500, 500, 50)
GUICtrlSetFont(-1, 20, 300, 0, "Times New Roman")
GUICtrlSetColor(-1, 0xFF0000)
$good_lbl = GUICtrlCreateLabel( "Getroffen: " & $gPressed, 100, 550, 300, 50)
GUICtrlSetFont(-1, 20, 300, 0, "Times New Roman")
GUICtrlSetColor(-1, 0x00FF00)
Global $GO_lbl = GUICtrlCreateLabel("", 600, 200, 300, 90)
GUICtrlSetColor(-1, 0x1F3FF0)
GUICtrlSetFont(-1, 70, 300, 0, "Arial")
GUICtrlCreateLabel("Hilfe:", 750, 500, 100, 40)
GUICtrlSetFont(-1, 24, 1200, 4, "Courier New")
GUICtrlSetColor(-1, 0xF0F000)
$hilfe_text = "Es erscheinen immer in zufälligen Abständen Gelbe Vierecke an einer der vier Ecken des Kreuzes. Man muss nun die jeweilige Pfeiltaste drücken, die zu dem Viereck zeigt. Wenn das Gelbe viereck nun an der Rechten Ecke des Kreuzes ist, muss man die rechte Pfeiltaste drücken. Wenn man binnen " & $daneben_speed & " Millisekunden Sekunden von erscheinen des Gelben Vierecks keine Pfeiltaste gedrückt hat, hat man verloren. Man gewinnt indem man " & $treffer_gewonnen & " mal die Gelben Vierecke getroffen hat."
GUICtrlCreateLabel($hilfe_text, 750, 550, 300, 200)
GUICtrlSetFont(-1, 10, 550, 0)
GUISetState()
Global $lbl_start = GUICtrlCreateLabel(" Start", 750, 105, 230, 30)
GUICtrlSetFont(-1, 20, 750,0, "Courier New")
GUICtrlSetBkColor(-1, 0x000FF00)
Global $lbl_exit = GUICtrlCreateLabel(" Beenden", 750, 145, 230, 30)
GUICtrlSetFont(-1, 20, 750,0, "Courier New")
GUICtrlSetBkColor(-1, 0x000FF00)
Global $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hWnd)
$aPoints[0][0] = 12
$aPoints[1][0] = 330
$aPoints[1][1] = 230
$aPoints[2][0] = 330
$aPoints[2][1] = 100
$aPoints[3][0] = 370
$aPoints[3][1] = 100
$aPoints[4][0] = 370
$aPoints[4][1] = 230
$aPoints[5][0] = 500
$aPoints[5][1] = 230
$aPoints[6][0] = 500
$aPoints[6][1] = 270
$aPoints[7][0] = 370
$aPoints[7][1] = 270
$aPoints[8][0] = 370
$aPoints[8][1] = 400
$aPoints[9][0] = 330
$aPoints[9][1] = 400
$aPoints[10][0] = 330
$aPoints[10][1] = 270
$aPoints[11][0] = 200
$aPoints[11][1] = 270
$aPoints[12][0] = 200
$aPoints[12][1] = 230
$hPen = _GDIPlus_BrushCreateSolid(0xFF000000)
sleep(1)
_GDIPlus_GraphicsFillPolygon($hGraphic, $aPoints, $hPen)
while 1
$msg = GUIGetMsg()
Select
case $msg = $lbl_exit
Exit
case $msg = $lbl_start
ExitLoop
EndSelect
WEnd
GUICtrlSetData($GO_lbl, "3")
sleep(500)
GUICtrlSetData($GO_lbl, "2")
sleep(500)
GUICtrlSetData($GO_lbl, "1")
sleep(500)
GUICtrlSetData($GO_lbl, "GO!!")
sleep(500)
GUICtrlSetData($GO_lbl, "")
_choose_random_pos()
Func _choose_random_pos()
$iPos = Random(1,4, 1)
Switch $iPos
case 1
_create_P1()
case 2
_create_P2()
case 3
_create_P3()
case 4
_create_P4()
EndSwitch
EndFunc
func _create_P1()
Global $hPen = _GDIPlus_BrushCreateSolid(0xFFFFFF00), $iX = 330, $iY = 60
_GDIPlus_GraphicsFillRect($hGraphic, 330, 60, 40, 40, $hPen)
$timer_start = TimerInit()
While 1
if _IsPressed(26) Then
$gPressed += 1
_schiess("Oben")
Else
if _IsPressed(25) Or _IsPressed(27) Or _IsPressed(28) Then
$wPressed += 1
GUICtrlSetData($fail_lbl, "Daneben: " & $wPressed)
if $wPressed = $treffer_verloren Then _end_Point()
sleep(200)
$timer_start = TimerInit()
EndIf
EndIf
if GUIGetMsg() = $lbl_exit Then Exit
if TimerDiff($timer_start) >= $daneben_speed Then
GUICtrlSetData($fail_lbl, "Daneben: --- Zu lange gewartet ---")
$wPressed = $treffer_verloren
_end_Point()
EndIf
WEnd
EndFunc
func _create_P2()
Global $hPen = _GDIPlus_BrushCreateSolid(0xFFFFFF00), $iX = 500, $iY = 230
_GDIPlus_GraphicsFillRect($hGraphic, 500, 230, 40, 40, $hPen)
$timer_start = TimerInit()
While 1
if _IsPressed(27) Then
$gPressed += 1
_schiess("Rechts")
_end_Point()
Else
if _IsPressed(26) Or _IsPressed(25) Or _IsPressed(28) Then
$wPressed += 1
GUICtrlSetData($fail_lbl, "Daneben: " & $wPressed)
if $wPressed = $treffer_verloren Then _end_Point()
sleep(200)
$timer_start = TimerInit()
EndIf
EndIf
if GUIGetMsg() = $lbl_exit Then Exit
if TimerDiff($timer_start) >= $daneben_speed Then
GUICtrlSetData($fail_lbl, "Daneben: --- Zu lange gewartet ---")
$wPressed = $treffer_verloren
_end_Point()
EndIf
WEnd
EndFunc
func _create_P3()
Global $hPen = _GDIPlus_BrushCreateSolid(0xFFFFFF00), $iX = 330, $iY = 400
_GDIPlus_GraphicsFillRect($hGraphic, 330, 400, 40, 40, $hPen)
$timer_start = TimerInit()
While 1
if _IsPressed(28) Then
$gPressed += 1
_schiess("Unten")
_end_Point()
Else
if _IsPressed(26) Or _IsPressed(27) Or _IsPressed(25) Then
$wPressed += 1
GUICtrlSetData($fail_lbl, "Daneben: " & $wPressed)
if $wPressed = $treffer_verloren Then _end_Point()
sleep(200)
$timer_start = TimerInit()
EndIf
EndIf
if GUIGetMsg() = $lbl_exit Then Exit
if TimerDiff($timer_start) >= $daneben_speed Then
GUICtrlSetData($fail_lbl, "Daneben: --- Zu lange gewartet ---")
$wPressed = $treffer_verloren
_end_Point()
EndIf
WEnd
EndFunc
func _create_P4()
Global $hPen = _GDIPlus_BrushCreateSolid(0xFFFFFF00), $iX = 160, $iY = 230
_GDIPlus_GraphicsFillRect($hGraphic, 160, 230, 40, 40, $hPen)
$timer_start = TimerInit()
While 1
if _IsPressed(25) Then
$gPressed += 1
_schiess("Links")
_end_Point()
Else
if _IsPressed(26) Or _IsPressed(27) Or _IsPressed(28) Then
$wPressed += 1
GUICtrlSetData($fail_lbl, "Daneben: " & $wPressed)
if $wPressed = $treffer_verloren Then _end_Point()
sleep(200)
$timer_start = TimerInit()
EndIf
EndIf
if GUIGetMsg() = $lbl_exit Then Exit
if TimerDiff($timer_start) >= $daneben_speed Then
GUICtrlSetData($fail_lbl, "Daneben: --- Zu lange gewartet ---")
$wPressed = $treffer_verloren
_end_Point()
EndIf
WEnd
EndFunc
func _end_Point()
GUICtrlSetData($good_lbl, "Getroffen: " & $gPressed)
$hPen = _GDIPlus_BrushCreateSolid(0xFF343434)
_GDIPlus_GraphicsFillRect($hGraphic, $iX, $iY, 40, 60, $hPen)
if $gPressed = $treffer_gewonnen Then
MsgBox(0, "WIN", "Sie haben gewonnen")
Exit
EndIf
if $wPressed = $treffer_verloren Then
MsgBox(0, "LOOSE", "Sie haben verloren")
Exit
EndIf
$iWait = Random(200, $random_speed, 100)
sleep($iWait)
_choose_random_pos()
EndFunc
func _schiess($Richtung)
$hPen = _GDIPlus_BrushCreateSolid(0xFFFF0000)
$hPen_uebermalen = _GDIPlus_BrushCreateSolid(0xFF000000)
$speed = 1
if $Richtung = "Oben" Then
$hX = 345
$hY = 210
while 1
_GDIPlus_GraphicsFillRect($hGraphic, $hX, $hY + 30, 10, 40, $hPen_uebermalen)
_GDIPlus_GraphicsFillRect($hGraphic, $hX, $hY, 10, 40, $hPen)
if $hY <= 60 Then _end_Point()
$hY -= 30
sleep($speed)
WEnd
EndIf
if $Richtung = "Unten" Then ; $iX = 330, $iY = 400
$hX = 345
$hY = 230
while 1
_GDIPlus_GraphicsFillRect($hGraphic, $hX, $hY - 30, 10, 40, $hPen_uebermalen)
_GDIPlus_GraphicsFillRect($hGraphic, $hX, $hY, 10, 40, $hPen)
if $hY >= 400 Then _end_Point()
$hY += 30
sleep($speed)
WEnd
EndIf
if $Richtung = "Rechts" Then ; $iX = 500, $iY = 230
$hX = 350
$hY = 245
while 1
_GDIPlus_GraphicsFillRect($hGraphic, $hX - 30, $hY, 40, 10, $hPen_uebermalen)
_GDIPlus_GraphicsFillRect($hGraphic, $hX, $hY, 40, 10, $hPen)
if $hX >= 500 Then _end_Point()
$hX += 30
sleep($speed)
WEnd
EndIf
if $Richtung = "Links" Then ; $iX = 160, $iY = 230
$hX = 350
$hY = 245
while 1
_GDIPlus_GraphicsFillRect($hGraphic, $hX + 30, $hY, 40, 10, $hPen_uebermalen)
_GDIPlus_GraphicsFillRect($hGraphic, $hX, $hY, 40, 10, $hPen)
if $hX <= 160 Then _end_Point()
$hX -= 30
sleep($speed)
WEnd
EndIf
EndFunc
Code V1.0:Spoiler anzeigen
[autoit]#include <GDIPlus.au3>
[/autoit]
#include <WindowsConstants.au3>
#include <GuiConstantsEx.au3>
#include <Misc.au3>
Global $aPoints[13][2],$bPoints[13][2], $hWnd, $hGraphic, $wPressed = 0, $gPressed = 0, $iX, $iY, $GO_lbl
_GDIPlus_Startup()
$hWnd = GUICreate("Geschick", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP)
GUISetBkColor(0x343434)
$fail_lbl = GUICtrlCreateLabel("Daneben: " & $wPressed, 100, 500, 500, 50)
GUICtrlSetFont(-1, 20, 300, 0, "Times New Roman")
GUICtrlSetColor(-1, 0xFF0000)
$good_lbl = GUICtrlCreateLabel( "Getroffen: " & $gPressed, 100, 550, 300, 50)
GUICtrlSetFont(-1, 20, 300, 0, "Times New Roman")
GUICtrlSetColor(-1, 0x00FF00)
Global $GO_lbl = GUICtrlCreateLabel("", 600, 200, 300, 90)
GUICtrlSetColor(-1, 0x1F3FF0)
GUICtrlSetFont(-1, 70, 300, 0, "Arial")
GUICtrlCreateLabel("Hilfe:", 750, 500, 100, 40)
GUICtrlSetFont(-1, 24, 1200, 4, "Courier New")
GUICtrlSetColor(-1, 0xF0F000)
$hilfe_text = "Es erscheinen immer in zufälligen Abständen Gelbe Vierecke an einer der vier Ecken des Kreuzes. Man muss nun die jeweilige Pfeiltaste drücken, die zu dem Viereck zeigt. Wenn das Gelbe viereck nun an der Rechten Ecke des Kreuzes ist, muss man die rechte Pfeiltaste drücken. Wenn man binnen 500 Millisekunden Sekunden von erscheinen des Gelben Vierecks keine Pfeiltaste gedrückt hat, hat man verloren."
GUICtrlCreateLabel($hilfe_text, 750, 550, 300, 200)
GUICtrlSetFont(-1, 10, 550, 0)
GUISetState()
Global $lbl_start = GUICtrlCreateLabel(" Start", 750, 105, 230, 30)
GUICtrlSetFont(-1, 20, 750,0, "Courier New")
GUICtrlSetBkColor(-1, 0x000FF00)
Global $lbl_exit = GUICtrlCreateLabel(" Beenden", 750, 145, 230, 30)
GUICtrlSetFont(-1, 20, 750,0, "Courier New")
GUICtrlSetBkColor(-1, 0x000FF00)
Global $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hWnd)
$aPoints[0][0] = 12
$aPoints[1][0] = 330
$aPoints[1][1] = 230
$aPoints[2][0] = 330
$aPoints[2][1] = 100
$aPoints[3][0] = 370
$aPoints[3][1] = 100
$aPoints[4][0] = 370
$aPoints[4][1] = 230
$aPoints[5][0] = 500
$aPoints[5][1] = 230
$aPoints[6][0] = 500
$aPoints[6][1] = 270
$aPoints[7][0] = 370
$aPoints[7][1] = 270
$aPoints[8][0] = 370
$aPoints[8][1] = 400
$aPoints[9][0] = 330
$aPoints[9][1] = 400
$aPoints[10][0] = 330
$aPoints[10][1] = 270
$aPoints[11][0] = 200
$aPoints[11][1] = 270
$aPoints[12][0] = 200
$aPoints[12][1] = 230
$hPen = _GDIPlus_BrushCreateSolid(0xFF000000)
sleep(1)
_GDIPlus_GraphicsFillPolygon($hGraphic, $aPoints, $hPen)
while 1
$msg = GUIGetMsg()
Select
case $msg = $lbl_exit
Exit
case $msg = $lbl_start
ExitLoop
EndSelect
WEnd
GUICtrlSetData($GO_lbl, "3")
sleep(500)
GUICtrlSetData($GO_lbl, "2")
sleep(500)
GUICtrlSetData($GO_lbl, "1")
sleep(500)
GUICtrlSetData($GO_lbl, "GO!!")
sleep(500)
GUICtrlSetData($GO_lbl, "")
_choose_random_pos()
Func _choose_random_pos()
$iPos = Random(1,4, 1)
Switch $iPos
case 1
_create_P1()
case 2
_create_P2()
case 3
_create_P3()
case 4
_create_P4()
EndSwitch
EndFunc
func _create_P1()
Global $hPen = _GDIPlus_BrushCreateSolid(0xFFFFFF00), $iX = 330, $iY = 60
_GDIPlus_GraphicsFillRect($hGraphic, 330, 60, 40, 40, $hPen)
$timer_start = TimerInit()
While 1
if _IsPressed(26) Then
$gPressed += 1
_schiess("Oben")
Else
if _IsPressed(25) Or _IsPressed(27) Or _IsPressed(28) Then
$wPressed += 1
GUICtrlSetData($fail_lbl, "Daneben: " & $wPressed)
if $wPressed = 10 Then _end_Point()
sleep(200)
EndIf
EndIf
if GUIGetMsg() = $lbl_exit Then Exit
if TimerDiff($timer_start) >= 500 Then
GUICtrlSetData($fail_lbl, "Daneben: --- Zu lange gewartet ---")
$wPressed = 10
_end_Point()
EndIf
WEnd
EndFunc
func _create_P2()
Global $hPen = _GDIPlus_BrushCreateSolid(0xFFFFFF00), $iX = 500, $iY = 230
_GDIPlus_GraphicsFillRect($hGraphic, 500, 230, 40, 40, $hPen)
$timer_start = TimerInit()
While 1
if _IsPressed(27) Then
$gPressed += 1
_schiess("Rechts")
_end_Point()
Else
if _IsPressed(26) Or _IsPressed(25) Or _IsPressed(28) Then
$wPressed += 1
GUICtrlSetData($fail_lbl, "Daneben: " & $wPressed)
if $wPressed = 10 Then _end_Point()
sleep(200)
EndIf
EndIf
if GUIGetMsg() = $lbl_exit Then Exit
if TimerDiff($timer_start) >= 500 Then
GUICtrlSetData($fail_lbl, "Daneben: --- Zu lange gewartet ---")
$wPressed = 10
_end_Point()
EndIf
WEnd
EndFunc
func _create_P3()
Global $hPen = _GDIPlus_BrushCreateSolid(0xFFFFFF00), $iX = 330, $iY = 400
_GDIPlus_GraphicsFillRect($hGraphic, 330, 400, 40, 40, $hPen)
$timer_start = TimerInit()
While 1
if _IsPressed(28) Then
$gPressed += 1
_schiess("Unten")
_end_Point()
Else
if _IsPressed(26) Or _IsPressed(27) Or _IsPressed(25) Then
$wPressed += 1
GUICtrlSetData($fail_lbl, "Daneben: " & $wPressed)
if $wPressed = 10 Then _end_Point()
sleep(200)
EndIf
EndIf
if GUIGetMsg() = $lbl_exit Then Exit
if TimerDiff($timer_start) >= 500 Then
GUICtrlSetData($fail_lbl, "Daneben: --- Zu lange gewartet ---")
$wPressed = 10
_end_Point()
EndIf
WEnd
EndFunc
func _create_P4()
Global $hPen = _GDIPlus_BrushCreateSolid(0xFFFFFF00), $iX = 160, $iY = 230
_GDIPlus_GraphicsFillRect($hGraphic, 160, 230, 40, 40, $hPen)
$timer_start = TimerInit()
While 1
if _IsPressed(25) Then
$gPressed += 1
_schiess("Links")
_end_Point()
Else
if _IsPressed(26) Or _IsPressed(27) Or _IsPressed(28) Then
$wPressed += 1
GUICtrlSetData($fail_lbl, "Daneben: " & $wPressed)
if $wPressed = 10 Then _end_Point()
sleep(200)
EndIf
EndIf
if GUIGetMsg() = $lbl_exit Then Exit
if TimerDiff($timer_start) >= 500 Then
GUICtrlSetData($fail_lbl, "Daneben: --- Zu lange gewartet ---")
$wPressed = 10
_end_Point()
EndIf
WEnd
EndFunc
func _end_Point()
GUICtrlSetData($good_lbl, "Getroffen: " & $gPressed)
$hPen = _GDIPlus_BrushCreateSolid(0xFF343434)
_GDIPlus_GraphicsFillRect($hGraphic, $iX, $iY, 40, 40, $hPen)
if $gPressed = 20 Then
MsgBox(0, "WIN", "Sie haben gewonnen")
Exit
EndIf
if $wPressed = 10 Then
MsgBox(0, "LOOSE", "Sie haben verloren")
Exit
EndIf
$iWait = Random(200, 2000, 100)
sleep($iWait)
_choose_random_pos()
EndFunc
func _schiess($Richtung)
$hPen = _GDIPlus_BrushCreateSolid(0xFFFF0000)
$hPen_uebermalen = _GDIPlus_BrushCreateSolid(0xFF000000)
$speed = 10
if $Richtung = "Oben" Then
$hX = 345
$hY = 210
while 1
_GDIPlus_GraphicsFillRect($hGraphic, $hX, $hY + 10, 10, 40, $hPen_uebermalen)
_GDIPlus_GraphicsFillRect($hGraphic, $hX, $hY, 10, 40, $hPen)
if $hY <= 60 Then _end_Point()
$hY -= 10
sleep($speed)
WEnd
EndIf
if $Richtung = "Unten" Then ; $iX = 330, $iY = 400
$hX = 345
$hY = 230
while 1
_GDIPlus_GraphicsFillRect($hGraphic, $hX, $hY - 10, 10, 40, $hPen_uebermalen)
_GDIPlus_GraphicsFillRect($hGraphic, $hX, $hY, 10, 40, $hPen)
if $hY >= 400 Then _end_Point()
$hY += 10
sleep($speed)
WEnd
EndIf
if $Richtung = "Rechts" Then ; $iX = 500, $iY = 230
$hX = 350
$hY = 245
while 1
_GDIPlus_GraphicsFillRect($hGraphic, $hX - 10, $hY, 40, 10, $hPen_uebermalen)
_GDIPlus_GraphicsFillRect($hGraphic, $hX, $hY, 40, 10, $hPen)
if $hX >= 500 Then _end_Point()
$hX += 10
sleep($speed)
WEnd
EndIf
if $Richtung = "Links" Then ; $iX = 160, $iY = 230
$hX = 350
$hY = 245
while 1
_GDIPlus_GraphicsFillRect($hGraphic, $hX + 10, $hY, 40, 10, $hPen_uebermalen)
_GDIPlus_GraphicsFillRect($hGraphic, $hX, $hY, 40, 10, $hPen)
if $hX <= 160 Then _end_Point()
$hX -= 10
sleep($speed)
WEnd
EndIf
EndFunc
Für Verbesserungen, etc. bin ich immer offen!mfg
hauke96 -
Jou ist soweit schon mal gut, nur bei mir ist die Sidebar nicht ganz drauf, der Obere Teil ( ab "My Si" ) kann ich nicht mehr sehen, aber wenn ich unter den angezeigten teil gehe, komme sie immernoch "hinaus".
-
mhm mit regedit klar, hätt ich auch drauf kommen können
man kennt ja sogar den Pfad^^
aber einen netten "Virus" ( also ein Nervprogramm ) könnt man damit schon machen..... -
Ich finds cool, kann man bestimmt irgendwann, irgendwo einbringen.
Ist auch gut für eine Kindersicherung oder ähnliches...
... oder Viren und/oder Trojaner.^^
eine Frage habe ich aber: Wie bekommt man das programm nun aus der Registry? Oder soll man das nicht....

mfg
hauke96 -
Hi,
ich habe soetwas auch schon angefangen, habe allerdings die lust verloren.
hier der Code:
Spoiler anzeigen
[autoit]#include <Misc.au3>
[/autoit]
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <GuiMonthCal.au3>
#include <GDIPlus.au3>
Global $Maus_Position[2]
$Fenster = GUICreate("Meine GUI", 172, 500, @DesktopWidth - 172, 1,$WS_POPUP)
WinSetTrans($Fenster, "", 150)
GUISetBkColor(0x00FF00)
GUISetState()
$Kalender = _GUICtrlMonthCal_Create($Fenster, 5,5)
$Uhr_rahmen_1 = GUICtrlCreateGraphic(5, 168, 162, 60);Außen
$Uhr_rahmen_2 = GUICtrlCreateGraphic(7, 170, 158, 56);Innen
GUICtrlSetColor($Uhr_rahmen_1, 0x000000)
GUICtrlSetColor($Uhr_rahmen_2, 0x000000)
$Uhrzeit_Label = GUICtrlCreateLabel(@HOUR & " : " & @MIN & " : " & @SEC, 12, 180, 148, 35)
GUICtrlSetFont($Uhrzeit_Label, 22, 148)
$btn_Einstellungen = GUICtrlCreateButton("Einstellungen", 5, 460, 162, 35)
$con_menu = GUICtrlCreateContextMenu()
$con_menu_beenden = GUICtrlCreateMenuItem("Beenden", $con_menu)
start()
func Start()
$Maus_Position[0] = 0
$Maus_Position[1] = 0
EndFunc
$Breite = 0
$Hoehe = 0
$time = @HOUR & ":" & @MIN & " : " & @SEC
$sec = @SEC
$var = 0
Global $Fenster_Position = WinGetPos("Meine GUI")
Global $Maus_Position = MouseGetPos()
while 1
$msg = GUIGetMsg()
$time_new = @HOUR & " : " & @MIN & " : " & @SEC
Select
case $Breite = $Fenster_Position[2]
$Breite = 0
case $Hoehe = $Fenster_Position[3]
$Hoehe = 0
case _IsPressed(01) And $Fenster_Position[0] + $Breite And $Fenster_Position[1] + $Hoehe
$Maus_Position_Vorher = MouseGetPos()
While _IsPressed(01) = 1
$Maus_Position = MouseGetPos()
WinMove("Meine GUI", "", $Maus_Position[0] - $Maus_Position_Vorher[0] + $Fenster_Position[0], $Maus_Position[1] - $Maus_Position_Vorher[1] + $Fenster_Position[1])
WEnd
case $msg = $GUI_EVENT_CLOSE
Exit
case _IsPressed(02)
$Breite += 1
$Hoehe += 1
case $msg = $con_menu_beenden
Exit
case $time <> $time_new
GUICtrlSetData($Uhrzeit_Label, @HOUR & " : " & @MIN & " : " & @SEC)
$time = $time_new
case $Fenster_Position[0] + $Fenster_Position[2] >= @DesktopWidth + 1
WinMove("Meine GUI", "", @DesktopWidth - 172, $Fenster_Position[1])
case $Fenster_Position[1] + 1 < 0
WinMove("Meine GUI", "",$Fenster_Position[0], 1)
EndSelect
Global $Fenster_Position = WinGetPos("Meine GUI")
Global $Maus_Position = MouseGetPos()
WEnd
Die Gui kannst du auch über die Obere und/oder die Linke Bildschirmkante ziehen, dann "floppt" das Fenster automatisch an die jeweilige Kante/Ecke.Du kannst es ruhig weitermachen, bzw. ein paar sache kopieren, etc. ich mache da jedenfalls nicht mehr weiter, also bedien dich

mfg
hauke96 -
- Weil manche die Kombi Win + L nicht kennen.
- Weil man dann auch auf andere Konten sich anmelden kann.
- Weil man einfach mal aus interesse dieses Programm ausprobieren kann.
- Weil Windows doof ist.
- Weil Ich finde, dass mein programm besser aussieht ( scherz
)noch mehr?

nein im ernst: Keine ahnung, eigentlich nichts, aber wie gesagt ich hatte schlicht weg langeweile xD
-
Moin moin,
Ich habe letztens langeweile gehabt und eine Art Bildschirm Sperrung entwickelt. Sie funktioniert noch nicht gaaanz, aber wenn ein Leie an die Sperrung kommt, ist diese relativ sicher.
Code:
Spoiler anzeigen
[autoit]#include <WindowsConstants.au3>
[/autoit]
#include <Misc.au3>
#include <GUIConstantsEx.au3>
#include <EditConstants.au3>
Global $i = 1, $var = 0, $Input, $lbl, $falsches_pass = 0
Global $Fenster = GUICreate("Screen Lock", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP)
GUISetBkColor(0x323232)
Global $lbl = GUICtrlCreateLabel("Passwort wählen: ", @DesktopWidth / 2 - 330, @DesktopHeight / 2 - 103, 300, 30)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetFont(-1, 18, 100, 0,"Courier New")
Global $Input = GUICtrlCreateInput("", @DesktopWidth / 2 - 70, @DesktopHeight / 2 - 100, 250, 20, $ES_PASSWORD)
GUICtrlSetFont(-1, 12, 100, 0,"Courier New")
GUISetState()
while 1
Global $Passwort = GUICtrlRead($Input)
$msg = GUIGetMsg()
Select
case _IsPressed("0D")
GUICtrlDelete($Input)
save()
case _IsPressed("1B")
Global $maus_pos = MouseGetPos()
$Black_Win = GUICreate("", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP)
GUISetBkColor(0x000000)
GUISetCursor(16)
GUISetState()
Do
$maus_pos_new = MouseGetPos()
Until $maus_pos[1] <> $maus_pos_new[1] And $maus_pos[0] <> $maus_pos_new[0]
GUIDelete()
Case $msg = $Input
GUICtrlSetStyle($Input, $ES_PASSWORD)
EndSelect
WEnd
func save()
Global $Input_neu = GUICtrlCreateInput("", @DesktopWidth / 2 - 70, @DesktopHeight / 2 - 100, 250, 20, $ES_PASSWORD)
GUICtrlSetFont(-1, 12, 100, 0,"Courier New")
GUICtrlSetState(-1, $GUI_FOCUS)
GUICtrlSetData($lbl, "Passwort eingeben: ")
$min = @SEC
sleep(200)
while 1
GUISetState(@SW_MAXIMIZE)
$Passwort_eingabe = GUICtrlRead($Input_neu)
Select
case _IsPressed("0D") And $Passwort = $Passwort_eingabe
Exit
case _IsPressed("0D") And $Passwort <> $Passwort_eingabe
GUICtrlCreateLabel("Falsches Passwort", @DesktopWidth / 2 - 70, @DesktopHeight / 2 - 70, 200, 30)
GUICtrlSetFont(-1, 14, 200, 2, "Courier New")
GUICtrlSetColor(-1, 0xFF0000)
$falsches_pass += 1
GUICtrlSetData($Input_neu, "")
sleep(100)
case _IsPressed("1B")
Global $maus_pos = MouseGetPos()
$Black_Win = GUICreate("", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP)
GUISetBkColor(0x000000)
GUISetCursor(16)
GUISetState()
Do
$maus_pos_new = MouseGetPos()
Until $maus_pos[1] <> $maus_pos_new[1] And $maus_pos[0] <> $maus_pos_new[0]
GUIDelete()
case $falsches_pass >= 3
$Black_Win = GUICreate("", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP)
GUISetBkColor(0x000000)
GUISetCursor(16)
GUISetState()
Do
$var += 1
sleep(100)
GUISetState(@SW_MAXIMIZE, $Black_Win)
Until $var = 100
GUIDelete()
$falsches_pass = 0
EndSelect
WEnd
EndFunc
Für Verbesserungen, Meinungen, Kritiken, etc. bin ich immer offen.mfg
hauke96 -
Hi,
also das mit dem "verschwinden" z.B. bei den Einstellungen, das soll so, weil es halt zu viel arbeit wäre das so zu machen, dass man dann zwischen den Fenstern hin und her schalten kann. Gut das mit dem "nicht anklickbar"-Effekt stimmt, da arbeite ich gerade dran, dass man IMMER zurück zum desktop wechseln kann.
Zudem kommt noch eine Leiste ganz unten hin, damit man immer weiß wo man gerade ist, das erleichtert einem auch die Naviagtion.GDI+ kann ich leider nur ein weeenig und kenne mich bis jetzt noch nicht so damit aus, ist mir momentan auch noch ein wenig zu kompliziert und ich brauche es NOCH nicht wirklick drinegend, weshalb ich es noch nicht ausgiebig gelernt habe.
demnächst kommen auch die Icons auf die Button beim desktop.
mfg
hauke96