Moin ich habe hier mal ne Gui mit mit eig. Rahmen die verschiebbar ist usw.
Mein problem ist. Ich zeichne den hintergrund(Rahmen) mit GDI+ .
Die buttons erstelle ich aus dem grund, damit ich überprüfen kann ob sie angeklick wurden mit GUICtrlCreatePic()
So das Problem ist, wenn ich die gui und den nicht sichtbaren breich verschieben verschwindet mein Rahmen wie bekomme ich das hin, damit das bleibt?
Spoiler anzeigen
#Include <GDIPlus.au3>
#include <GUIConstantsEx.au3>
#include <WinAPI.au3>
#include <WindowsConstants.au3>
#Include <Misc.au3>
$change = 1
$change2 = 1
$title = "Meine GUI"
$test2 = GUICreate($title, 250, 88,@DesktopWidth-250,0,$WS_POPUP)
$winhandle = WinGetHandle($test2)
;GUICtrlCreatePic("bilder/hintergrund3.gif",0,0,250,88)
$test = GUICtrlCreatePic("bilder/button.gif",220,0,28,10)
;GUISetBkColor(0xFF3F5C)
GUISetState()
;WinsetOnTop($test,"",1)
_GDIPlus_Startup()
$hGraphics = _GDIPlus_GraphicsCreateFromHWND($winhandle)
$hImage_hintergrund = _GDIPlus_BitmapCreateFromFile("bilder/hintergrund3.gif")
;$hImage_Button_normal = _GDIPlus_BitmapCreateFromFile("bilder/button.gif")
;$hImage_Button_hover = _GDIPlus_BitmapCreateFromFile("bilder/button2.gif")
_GDIPlus_GraphicsDrawImageRect($hGraphics, $hImage_hintergrund, 0,0,250,88)
;_GDIPlus_GraphicsDrawImageRect($hGraphics, $hImage_Button_normal, 220,0,28,10)
;_GDIPlus_GraphicsDispose($hGraphics)
;$titel = GUICtrlCreateLabel("Nachricht erhalten!",20,3,200,20)
;GUICtrlSetFont($titel,10,400,2,"Comic Sans MS")
;GUICtrlSetColor ($titel, 0xFFFFFF)
;$pen = _GDIPlus_PenCreate(0xFF000000)
;_GDIPlus_GraphicsDrawString($hGraphics, "Nachricht erhalten!", 20, 0, $pen)
$hBrush = _GDIPlus_BrushCreateSolid(0xFFFFFFFF)
$hFormat = _GDIPlus_StringFormatCreate()
$hFamily = _GDIPlus_FontFamilyCreate("Comic Sans MS")
$hFont = _GDIPlus_FontCreate($hFamily, 10, 1)
$tLayout = _GDIPlus_RectFCreate(20, -2, 0, 0)
$aInfo = _GDIPlus_GraphicsMeasureString($hGraphics, "Nachricht erhalten!", $hFont, $tLayout, $hFormat)
_GDIPlus_GraphicsDrawStringEx($hGraphics, "Nachricht erhalten!", $hFont, $aInfo[0], $hFormat, $hBrush)
$hBrush = _GDIPlus_BrushCreateSolid(0xFF000000)
$hFormat = _GDIPlus_StringFormatCreate()
$hFamily = _GDIPlus_FontFamilyCreate("Comic Sans MS")
$hFont = _GDIPlus_FontCreate($hFamily, 10, 2)
$tLayout = _GDIPlus_RectFCreate(20, 50, 0, 0)
$aInfo = _GDIPlus_GraphicsMeasureString($hGraphics, "Nachricht von ... erhalten", $hFont, $tLayout, $hFormat)
_GDIPlus_GraphicsDrawStringEx($hGraphics, "Nachricht von ... erhalten", $hFont, $aInfo[0], $hFormat, $hBrush)
#cs
$y = 0
Do
$y += 2
WinMove("Meine GUI", "", @DesktopWidth-250, @DesktopHeight-$y)
Sleep(5)
Until $y > 130
#ce
While 1
febterfallen()
ohnenamen()
$winpos = WinGetPos($title,"")
if IsArray($winpos) Then
If MouseGetPos(0) > $winpos[0] And MouseGetPos(0) < $winpos[0]+ $winpos[2]-30 And MouseGetPos(1) > $winpos[1] And MouseGetPos(1) < $winpos[1]+20 And _IsPressed(01) Then
;MsgBox(0,"","")
$mouspos = GUIGetCursorInfo()
Do
WinMove($title,"",MouseGetPos(0)-$mouspos[0],MouseGetPos(1)-$mouspos[1])
Until Not _IsPressed(01)
EndIf
EndIf
Sleep(10)
WEnd
Func ohnenamen()
;If MouseGetPos(0) > $winpos[0]+10 And MouseGetPos(0) < $winpos[0]+$winpos[2]-10 And MouseGetPos(1) > $winpos[1]+25 And MouseGetPos(1) < $winpos[1]+$winpos[3]-10 Then
$mouspos = GUIGetCursorInfo()
if IsArray($mouspos) Then
If $test = $mouspos[4] Then
;MsgBox(0,"","")
If $change2 Then
;GUICtrlDelete($test)
$test = GUICtrlCreatePic("bilder/button.gif",220,0,28,10)
;_GDIPlus_GraphicsDrawImageRect($hGraphics, $hImage_Button_normal, 220,0,28,10)
$change = 1
$change2 = 0
EndIf
Else
If $change Then
;GUICtrlDelete($test)
$test = GUICtrlCreatePic("bilder/button2.gif",220,0,28,10)
;_GDIPlus_GraphicsDrawImageRect($hGraphics, $hImage_Button_hover, 220,0,28,10)
$change = 0
$change2 = 1
EndIf
EndIf
If $test = $mouspos[4] And $mouspos[2] Then
Do
$mouspos = GUIGetCursorInfo()
Until not $mouspos[2]
If $test = $mouspos[4] Then Exit
EndIf
EndIf
EndFunc
Func febterfallen()
$t = 30
$i = 0
$winposoben = WinGetPos($title)
$winpos = WinGetPos($title)
If $winpos[1] < (@DesktopHeight - 130) Then
Do
For $r = $winpos[1] to $winpos[1]+2 Step 1/$t
WinMove($title,"",$winpos[0], $r)
;MsgBox(0,"",$r)
$i += $i
$pos = MouseGetPos()
#cs
If $winpos2[0] <> $winpos[0] Then
WinWaitActive ($title,"",5000000)
Sleep(800)
$winpos2 = WinGetPos($title)
WinMove($title,"",$winpos2[0], $winpos2[1])
ExitLoop
EndIf
;If $winpos2[0] <> $winpos[0] Then
; $pos = MouseGetPos()
; WinMove($title,"",$pos[0], $pos[1])
; ExitLoop
;EndIf
#ce
Next
If $t = 7 Then
;MsgBox(0,"","")
Else
$t -= 1/16
;MsgBox(0,"",$t)
EndIf
$winpos = WinGetPos($title)
$winpos2 = WinGetPos($title)
Until $winpos2[1] > (@DesktopHeight - 129)
If (@DesktopHeight - $winposoben[1]) > 800 Then
$winpos = WinGetPos($title)
For $z = 1 to 60 Step 1/50
WinMove($title,"",$winpos[0],$winpos[1]- $z)
Next
$winpos = WinGetPos($title)
For $z = 1 to 20 Step 1/70
WinMove($title,"",$winpos[0],$winpos[1]- $z)
Next
$winpos = WinGetPos($title)
For $z = 1 to 20 Step 1/90
WinMove($title,"",$winpos[0],$winpos[1]- $z)
Next
$winpos = WinGetPos($title)
For $z = 1 to 10 Step 1/150
WinMove($title,"",$winpos[0],$winpos[1]- $z)
Next
$winpos = WinGetPos($title)
For $z = 1 to 10 Step 1/200
WinMove($title,"",$winpos[0],$winpos[1]- $z)
Next
$winpos = WinGetPos($title)
For $z = 1 to 10 Step 1/200
WinMove($title,"",$winpos[0],$winpos[1]+ $z)
Next
$winpos = WinGetPos($title)
For $z = 1 to 10 Step 1/150
WinMove($title,"",$winpos[0],$winpos[1]+ $z)
Next
$winpos = WinGetPos($title)
For $z = 1 to 20 Step 1/90
WinMove($title,"",$winpos[0],$winpos[1]+ $z)
Next
$winpos = WinGetPos($title)
For $z = 1 to 20 Step 1/70
WinMove($title,"",$winpos[0],$winpos[1]+ $z)
Next
$winpos = WinGetPos($title)
For $z = 1 to 66 Step 1/50
WinMove($title,"",$winpos[0],$winpos[1]+ $z)
Next
EndIf
If (@DesktopHeight - $winposoben[1]) > 600 And (@DesktopHeight - $winposoben[1]) < 799 Then
$winpos = WinGetPos($title)
For $z = 1 to 50 Step 1/50
WinMove($title,"",$winpos[0],$winpos[1]- $z)
Next
$winpos = WinGetPos($title)
For $z = 1 to 10 Step 1/70
WinMove($title,"",$winpos[0],$winpos[1]- $z)
Next
$winpos = WinGetPos($title)
For $z = 1 to 15 Step 1/90
WinMove($title,"",$winpos[0],$winpos[1]- $z)
Next
$winpos = WinGetPos($title)
For $z = 1 to 10 Step 1/150
WinMove($title,"",$winpos[0],$winpos[1]- $z)
Next
$winpos = WinGetPos($title)
For $z = 1 to 10 Step 1/200
WinMove($title,"",$winpos[0],$winpos[1]- $z)
Next
$winpos = WinGetPos($title)
For $z = 1 to 10 Step 1/200
WinMove($title,"",$winpos[0],$winpos[1]+ $z)
Next
$winpos = WinGetPos($title)
For $z = 1 to 10 Step 1/150
WinMove($title,"",$winpos[0],$winpos[1]+ $z)
Next
$winpos = WinGetPos($title)
For $z = 1 to 15 Step 1/90
WinMove($title,"",$winpos[0],$winpos[1]+ $z)
Next
$winpos = WinGetPos($title)
For $z = 1 to 10 Step 1/70
WinMove($title,"",$winpos[0],$winpos[1]+ $z)
Next
$winpos = WinGetPos($title)
For $z = 1 to 56 Step 1/50
WinMove($title,"",$winpos[0],$winpos[1]+ $z)
Next
EndIf
If (@DesktopHeight - $winposoben[1]) > 400 And (@DesktopHeight - $winposoben[1]) < 599 Then
$winpos = WinGetPos($title)
For $z = 1 to 40 Step 1/50
WinMove($title,"",$winpos[0],$winpos[1]- $z)
Next
$winpos = WinGetPos($title)
For $z = 1 to 10 Step 1/70
WinMove($title,"",$winpos[0],$winpos[1]- $z)
Next
$winpos = WinGetPos($title)
For $z = 1 to 15 Step 1/90
WinMove($title,"",$winpos[0],$winpos[1]- $z)
Next
$winpos = WinGetPos($title)
For $z = 1 to 10 Step 1/150
WinMove($title,"",$winpos[0],$winpos[1]- $z)
Next
$winpos = WinGetPos($title)
For $z = 1 to 10 Step 1/200
WinMove($title,"",$winpos[0],$winpos[1]- $z)
Next
$winpos = WinGetPos($title)
For $z = 1 to 10 Step 1/200
WinMove($title,"",$winpos[0],$winpos[1]+ $z)
Next
$winpos = WinGetPos($title)
For $z = 1 to 10 Step 1/150
WinMove($title,"",$winpos[0],$winpos[1]+ $z)
Next
$winpos = WinGetPos($title)
For $z = 1 to 15 Step 1/90
WinMove($title,"",$winpos[0],$winpos[1]+ $z)
Next
$winpos = WinGetPos($title)
For $z = 1 to 10 Step 1/70
WinMove($title,"",$winpos[0],$winpos[1]+ $z)
Next
$winpos = WinGetPos($title)
For $z = 1 to 46 Step 1/50
WinMove($title,"",$winpos[0],$winpos[1]+ $z)
Next
EndIf
If (@DesktopHeight - $winposoben[1]) > 200 And (@DesktopHeight - $winposoben[1]) < 399 Then
$winpos = WinGetPos($title)
For $z = 1 to 20 Step 1/50
WinMove($title,"",$winpos[0],$winpos[1]- $z)
Next
$winpos = WinGetPos($title)
For $z = 1 to 10 Step 1/70
WinMove($title,"",$winpos[0],$winpos[1]- $z)
Next
$winpos = WinGetPos($title)
For $z = 1 to 15 Step 1/90
WinMove($title,"",$winpos[0],$winpos[1]- $z)
Next
$winpos = WinGetPos($title)
For $z = 1 to 10 Step 1/150
WinMove($title,"",$winpos[0],$winpos[1]- $z)
Next
$winpos = WinGetPos($title)
For $z = 1 to 10 Step 1/200
WinMove($title,"",$winpos[0],$winpos[1]- $z)
Next
$winpos = WinGetPos($title)
For $z = 1 to 10 Step 1/200
WinMove($title,"",$winpos[0],$winpos[1]+ $z)
Next
$winpos = WinGetPos($title)
For $z = 1 to 10 Step 1/150
WinMove($title,"",$winpos[0],$winpos[1]+ $z)
Next
$winpos = WinGetPos($title)
For $z = 1 to 15 Step 1/90
WinMove($title,"",$winpos[0],$winpos[1]+ $z)
Next
$winpos = WinGetPos($title)
For $z = 1 to 10 Step 1/70
WinMove($title,"",$winpos[0],$winpos[1]+ $z)
Next
$winpos = WinGetPos($title)
For $z = 1 to 26 Step 1/50
WinMove($title,"",$winpos[0],$winpos[1]+ $z)
Next
EndIf
EndIf
EndFunc
bilder hänge ich mal an