Gefällt mir sehr gut! ![]()
Gruß,
UEZ
Gefällt mir sehr gut! ![]()
Gruß,
UEZ
SIC2 liest nur per Registry und WMI aus!
Apropros WMI: du kannst eine Menge an System Infos per WMI abfragen, wie z.B. DeviceBus IDs, etc.
Ein sehr hilfreiches Tools zu WMI ist Scriptomatic! Den Code in AutoIt umzuwandeln ist relativ einfach!
Gruß,
UEZ
So geht es bei mir:
[autoit]
#include <Constants.au3>
Local $line
Local $prg = @ScriptDir & "\devcon.exe "
Local $parameter = "hwids *"
Local $run = Run(@ComSpec & " /c " & $prg & $parameter, @SystemDir, @SW_HIDE, $STDOUT_CHILD)
While 1
$line &= StdoutRead($run)
If @error Then ExitLoop
Wend
MsgBox(0, "", $line)
Gruß,
UEZ
Ich habe mal deinen Code etwas verändert, so dass jetzt mit einem Backbuffer gearbeitet wird, um das Flackern zu verhindern.
#include-once
#include <WindowsConstants.au3>
#include <GUIConstants.au3>
#include <WinAPI.au3>
#include <GDIPlus.au3>
#include <StaticConstants.au3>
$Gui_width = 430
$Gui_height = 236
$Gui_Pos_X = -1
$Gui_Pos_Y = -1
$hGui = GUICreate('', $Gui_width, $Gui_height ,$Gui_Pos_X,$Gui_Pos_y,$WS_POPUP, BitOR($WS_EX_TOOLWINDOW,$WS_EX_TOPMOST))
WinSetTrans($hGui, "",0)
GUISetState()
_GDIPlus_Startup()
$hGraphic = _GDIPlus_GraphicsCreateFromHWND ($hGUI)
$hBitmap = _GDIPlus_BitmapCreateFromGraphics($Gui_width, $Gui_height, $hGraphic)
$hBackbuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap)
$hImage = _SetImagefromResource(0, "hg", "data.dll",2)
_GDIPlus_GraphicsDrawImage($hGraphic, $hImage, 0, 0)
$hBrush_Label = _GDIPlus_BrushCreateSolid (0xFFB0C4DE)
$hBrush_Label2 = _GDIPlus_BrushCreateSolid (0xFF000000)
$hFormat_Label = _GDIPlus_StringFormatCreate ()
$hFamily_Label = _GDIPlus_FontFamilyCreate ("Arial")
$hFont_Label = _GDIPlus_FontCreate ($hFamily_Label, 8, 2)
$tLayout_Label = _GDIPlus_RectFCreate ($Gui_width - 60, 3, 100, 20)
$tLayout_Label2 = _GDIPlus_RectFCreate ($Gui_width - 100, $Gui_height - 50, 100, 80)
_GDIPlus_GraphicsDrawStringEx ($hGraphic, "v. 2.0.1.64", $hFont_Label, $tLayout_Label, $hFormat_Label, $hBrush_Label)
_GDIPlus_GraphicsDrawStringEx ($hGraphic, 'Lizenz: ---' & @CRLF & _
'Beta Version'&@CRLF& _
'C .Schiffer 2010', $hFont_Label, $tLayout_Label2, $hFormat_Label, $hBrush_Label2)
_WinFadeIn($hGui)
Sleep ( 300 )
_StringFadeIn('Starte',50,190)
;--------------------------------------------------------------
; Hier kommt der zu verarbeitende Prozess rein...
Sleep ( 200 )
_StringSetNewText('Starte.',50,190)
Sleep ( 200 )
_StringSetNewText('Starte..',50,190)
Sleep ( 200 )
_StringSetNewText('Starte...',50,190)
Sleep ( 200 )
_StringSetNewText('Starte....',50,190)
Sleep ( 200 )
;--------------------------------------------------------------
_StringFadeOut('Starte....',50,190)
_StringFadeIn('prüfe Daten',50,190)
;--------------------------------------------------------------
; Hier kommt der zu verarbeitende Prozess rein...
Sleep ( 200 )
_StringSetNewText('prüfe Daten.',50,190)
Sleep ( 200 )
_StringSetNewText('prüfe Daten..',50,190)
Sleep ( 200 )
_StringSetNewText('prüfe Daten...',50,190)
Sleep ( 200 )
_StringSetNewText('prüfe Daten....',50,190)
Sleep ( 200 )
;--------------------------------------------------------------
_StringFadeOut('prüfe Daten....',50,190)
_StringFadeIn('starte Server',50,190)
;--------------------------------------------------------------
; Hier kommt der zu verarbeitende Prozess rein...
Sleep ( 200 )
_StringSetNewText('starte Server (15%)',50,190)
Sleep ( 200 )
_StringSetNewText('starte Server (30%)',50,190)
Sleep ( 200 )
_StringSetNewText('starte Server (60%)',50,190)
Sleep ( 200 )
_StringSetNewText('starte Server (85%)',50,190)
Sleep ( 200 )
;--------------------------------------------------------------
_StringFadeOut('starte Server (100%)',50,190)
Sleep (300)
_WinFadeOut($hGui)
_GDIPlus_FontDispose($hFont_Label)
_GDIPlus_FontFamilyDispose($hFamily_Label)
_GDIPlus_StringFormatDispose($hFormat_Label)
_GDIPlus_BrushDispose($hBrush_Label)
_GDIPlus_BrushDispose($hBrush_Label2)
_GDIPlus_ImageDispose($hImage)
_GDIPlus_BitmapDispose($hBitmap)
_GDIPlus_GraphicsDispose($hBackbuffer)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_Shutdown ()
Exit
;-------------------------------------------------------------------------------------------------
; Verändern
;-------------------------------------------------------------------------------------------------
Func _StringSetNewText($sString,$Pos_X,$Pos_Y)
_GDIPlus_GraphicsDrawImage($hBackbuffer, $hImage, 0, 0)
Label()
$hBrush = _GDIPlus_BrushCreateSolid("0x" & Hex(255, 2) & "FFFFFF")
$hFormat = _GDIPlus_StringFormatCreate()
$hFamily = _GDIPlus_FontFamilyCreate("Arial")
$hFont = _GDIPlus_FontCreate($hFamily, 13, 1)
;~ ConsoleWrite ( 14-((255/30)-($i/30))&@CRLF )
$tLayout = _GDIPlus_RectFCreate( $Pos_X, $Pos_Y, 0, 0)
;~ ConsoleWrite ( 190+(255/5)-($i/5)&@CRLF )
$aInfo = _GDIPlus_GraphicsMeasureString($hBackbuffer, $sString, $hFont, $tLayout, $hFormat)
_GDIPlus_GraphicsDrawStringEx($hBackbuffer, $sString, $hFont, $aInfo[0], $hFormat, $hBrush)
_GDIPlus_GraphicsDrawImageRect($hGraphic, $hBitmap, 0, 0, $Gui_width, $Gui_height)
_GDIPlus_BrushDispose($hBrush)
_GDIPlus_StringFormatDispose($hFormat)
_GDIPlus_FontDispose($hFont)
_GDIPlus_FontFamilyDispose($hFamily)
EndFunc
;-------------------------------------------------------------------------------------------------
; String Einblenden
;-------------------------------------------------------------------------------------------------
Func _StringFadeIn($sString,$Pos_X,$Pos_Y,$Step = 25 ,$Time = 20 )
$timerinit = TimerInit()
For $i = 0 To 255 Step $Step
Do
Sleep (1)
Until TimerDiff($timerinit) > $Time
$timerinit = TimerInit()
_GDIPlus_GraphicsDrawImage($hBackbuffer, $hImage, 0, 0)
Label()
$hBrush = _GDIPlus_BrushCreateSolid("0x" & Hex($i, 2) & "FFFFFF")
$hFormat = _GDIPlus_StringFormatCreate()
$hFamily = _GDIPlus_FontFamilyCreate("Arial")
$hFont = _GDIPlus_FontCreate($hFamily, 13-((255/30)-($i/30)), 1)
;~ ConsoleWrite ( 14-((255/30)-($i/30))&@CRLF )
If (255/8)-($i/8) < 2 Then
$Pos_Y_Wert = $Pos_Y+0
Else
$Pos_Y_Wert = $Pos_Y+(255/8)-($i/8)
EndIf
$tLayout = _GDIPlus_RectFCreate( $Pos_X, $Pos_Y_Wert, 0, 0)
;~ ConsoleWrite ( 190+(255/5)-($i/5)&@CRLF )
$aInfo = _GDIPlus_GraphicsMeasureString($hBackbuffer, $sString, $hFont, $tLayout, $hFormat)
_GDIPlus_GraphicsDrawStringEx($hBackbuffer, $sString, $hFont, $aInfo[0], $hFormat, $hBrush)
_GDIPlus_GraphicsDrawImageRect($hGraphic, $hBitmap, 0, 0, $Gui_width, $Gui_height)
_GDIPlus_BrushDispose($hBrush)
_GDIPlus_StringFormatDispose($hFormat)
_GDIPlus_FontDispose($hFont)
_GDIPlus_FontFamilyDispose($hFamily)
Next
EndFunc
;-------------------------------------------------------------------------------------------------
; String Ausblenden
;-------------------------------------------------------------------------------------------------
Func _StringFadeOut($sString,$Pos_X,$Pos_Y,$Step = 25 ,$Time = 15)
$timerinit = TimerInit()
For $i = 255 To 0 Step -$Step
If $i < 11 Then $i = 0
Do
Sleep (1)
Until TimerDiff($timerinit) > $Time
$timerinit = TimerInit()
_GDIPlus_GraphicsDrawImage($hBackbuffer, $hImage, 0, 0)
Label()
$hBrush = _GDIPlus_BrushCreateSolid("0x" & Hex($i, 2) & "FFFFFF")
$hFormat = _GDIPlus_StringFormatCreate()
$hFamily = _GDIPlus_FontFamilyCreate("Arial")
$hFont = _GDIPlus_FontCreate($hFamily, 13-((255/30)-($i/30)), 1)
;~ ConsoleWrite ( 14-((255/30)-($i/30))&@CRLF )
$tLayout = _GDIPlus_RectFCreate($Pos_X, $Pos_Y, 0, 0)
;~ ConsoleWrite ( 190+(255/5)-($i/5)&@CRLF )
$aInfo = _GDIPlus_GraphicsMeasureString($hBackbuffer, $sString, $hFont, $tLayout, $hFormat)
_GDIPlus_GraphicsDrawStringEx($hBackbuffer, $sString, $hFont, $aInfo[0], $hFormat, $hBrush)
_GDIPlus_GraphicsDrawImageRect($hGraphic, $hBitmap, 0, 0, $Gui_width, $Gui_height)
_GDIPlus_BrushDispose($hBrush)
_GDIPlus_StringFormatDispose($hFormat)
_GDIPlus_FontDispose($hFont)
_GDIPlus_FontFamilyDispose($hFamily)
Next
EndFunc
;-------------------------------------------------------------------------------------------------
; Gui Einblenden
;-------------------------------------------------------------------------------------------------
Func _WinFadeIn($hGui,$timertime = 20 ,$blendzize = 1.25 )
WinSetTrans($hGui, "",0)
GUISetState ( @SW_SHOW, $hGui)
$i = 1
$timerinit = TimerInit()
Do
If TimerDiff($timerinit) > $timertime Then
$i = $i*$blendzize
If $i > 255 Then ExitLoop
WinSetTrans($hGui, "",$i)
$timerinit = TimerInit()
EndIf
Until $i > 255
WinSetTrans($hGui, "",255)
EndFunc
;-------------------------------------------------------------------------------------------------
; Gui Ausblenden
;-------------------------------------------------------------------------------------------------
Func _WinFadeOut($hGui,$timertime = 20 ,$blendzize = 0.75 )
WinSetTrans($hGui, "",255)
$i = 255
$timerinit = TimerInit()
Do
If TimerDiff($timerinit) > $timertime Then
$i = $i*$blendzize
If $i < 5 Then ExitLoop
WinSetTrans($hGui, "",$i)
$timerinit = TimerInit()
EndIf
Until $i < 5
WinSetTrans($hGui, "",0)
GUISetState ( @SW_HIDE, $hGui)
EndFunc
;-------------------------------------------------------------------------------------------------
; Image aus dll
;-------------------------------------------------------------------------------------------------
Func _SetImagefromResource($CtrlID, $Resname, $Resfile = -1, $ResType = 10)
Local Const $IMAGE_BITMAP = 0
Local Const $STM_SETIMAGE = 0x0172
Local $hmod, $hwnd, $InfoBlock, $ResSize, $Mem, $pMem, $dll, $dll2, $hData, $pData, $pStream, $ret, $hBitmap, $pBitmap
$hmod = _WinAPI_LoadLibrary($Resfile)
$hBitmap = _GDIPlus_BitmapCreateFromHBITMAP(_WinAPI_LoadImage($hmod, $Resname, $IMAGE_BITMAP, 0, 0, 0))
;~ If $ResType = 2 Then
;~ $hBitmap = _WinAPI_LoadImage($hmod, $Resname, $IMAGE_BITMAP, 0, 0, 0)
;~ If @error Then Return SetError(1, 0, 0)
;~ $hwnd = GUICtrlGetHandle($CtrlID)
;~ If $hwnd = 0 Then Return SetError(2, 0, 0)
;~ DllCall("user32.dll", "hwnd", "SendMessage", "hwnd", $hwnd, "int", $STM_SETIMAGE, "int", $IMAGE_BITMAP, "int", $hBitmap)
;~ If @error Then Return SetError(3, 0, 0)
;~ EndIf
Return $hBitmap
EndFunc
Func Label()
_GDIPlus_GraphicsDrawStringEx ($hBackbuffer, 'v. 2.0.1.64', $hFont_Label, $tLayout_Label, $hFormat_Label, $hBrush_Label)
_GDIPlus_GraphicsDrawStringEx ($hBackbuffer, 'Lizenz: ---' & @CRLF & _
'Beta Version'& @CRLF & _
'C .Schiffer 2010', $hFont_Label, $tLayout_Label2, $hFormat_Label, $hBrush_Label2)
EndFunc
Du solltest dir angewöhnen die GDI+ Ressourcen wieder freizugeben, denn du hast damit ein Speicherfresser erzeugt! [Blockierte Grafik: http://www.autoit.de/wcf/images/smilies/13.gif]
Die Fonts müssen auch nicht immer wieder neu erstellt werden...
Gruß,
UEZ
Meinst du das so?
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <gdiplus.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 625, 625, 192, 124)
$hwnd = wingethandle($Form1)
GUISetBkColor(0x0000)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
_GDIPlus_Startup()
$hGraphic = _GDIPlus_GraphicsCreateFromHWND ($hWnd)
;~ $hGraphic2 = _GDIPlus_GraphicsCreateFromHWND ($hWnd)
$ParticleBitmap = _GDIPlus_BitmapCreateFromGraphics(625, 625, $hgraphic)
$ParticleBitmap2 = _GDIPlus_BitmapCreateFromGraphics(625, 625, $hgraphic)
$ParticleBuffer = _GDIPlus_ImageGetGraphicsContext($ParticleBitmap)
$ParticleBuffer2 = _GDIPlus_ImageGetGraphicsContext($ParticleBitmap2)
$Pen = _GDIPlus_PenCreate(0, 1)
$Pen2 = _GDIPlus_PenCreate(0, 1)
_GDIPlus_GraphicsClear($ParticleBuffer)
_GDIPlus_GraphicsClear($ParticleBuffer2)
$i = 0
$plus = 10
$l = 0
$z = 295
while $i < 900
;_GDIPlus_PenSetColor($Pen, "0xff" & Hex(255, 2) & Hex(($i)/3/10*22, 2) & Hex(0, 2))
_GDIPlus_PenSetColor($Pen, "0xff" & Hex($i/5/10*13, 2) & Hex($i/5/10*13, 2) & Hex($i/5/10*3.5, 2))
_GDIPlus_GraphicsDrawEllipse($particlebuffer, 625/2-$i/2, 625/2-$i/2, $i, $i, $pen)
[/autoit] [autoit][/autoit] [autoit]_GDIPlus_GraphicsDrawImageRect($hGraphic, $ParticleBitmap, 0, 0, 625, 625)
$i +=$plus
sleep(1)
WEnd
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]While 1
[/autoit] [autoit][/autoit] [autoit]$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
_GDIPlus_GraphicsDispose ($hGraphic)
_GDIPlus_BitmapDispose($ParticleBitmap)
_GDIPlus_GraphicsDispose($ParticleBuffer)
;~ _GDIPlus_BrushDispose($Brush)
_GDIPlus_Shutdown ()
Exit
EndSwitch
[/autoit] [autoit][/autoit] [autoit]$z = 295
[/autoit] [autoit][/autoit] [autoit]_GDIPlus_GraphicsDrawImageRect($particlebuffer2, $ParticleBitmap, 0, 0, 625, 625)
_GDIPlus_PenSetColor($Pen2, "0xff" & "00" & Hex(200, 2) & Hex(100, 2))
;_GDIPlus_PenSetColor($Pen, "0xff" & Hex($i/5/10*27, 2) & Hex($i/5/10*27, 2) & Hex($i/5/10*3.5, 2))
_GDIPlus_GraphicsDrawEllipse($particlebuffer2, 625/2-$i/2, 625/2-$i/2, $i, $i, $pen2)
[/autoit] [autoit][/autoit] [autoit]_GDIPlus_GraphicsDrawImageRect($hGraphic, $ParticleBitmap2, 0, 0, 625, 625)
$i +=$plus
sleep(10)
if $i < 900 then
$i +=1
Else
$i = 0
EndIf
sleep(10)
[/autoit] [autoit][/autoit] [autoit]WEnd
[/autoit]Tipp: Schaue dir doch mal die anderen Beispiele an, wie man GDI+ "besser" darstellen kann. Stichwörter: GUISetOnEvent(), GUIRegisterMsg($WM_PAINT, "WM_PAINT"), GUIRegisterMsg($WM_ERASEBKGND, "WM_ERASEBKGND"), etc. 
Gruß,
UEZ
Einen "ausgemalten" Kreis kannst du mit _GDIPlus_GraphicsFillEllipse() erstellen.
Beispiel:
[autoit]
#include <GuiConstantsEx.au3>
#include <GDIPlus.au3>
Opt('MustDeclareVars', 1)
[/autoit][autoit][/autoit][autoit]_Main()
[/autoit][autoit][/autoit][autoit]Func _Main()
Local $hGUI, $hGraphic, $hBrush
; Create GUI
$hGUI = GUICreate("GDI+", 400, 300)
GUISetState()
; Draw an ellipse
_GDIPlus_Startup ()
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI)
_GDIPlus_GraphicsSetSmoothingMode($hGraphic, 2)
$hBrush = _GDIPlus_BrushCreateSolid(0xFFFF0000)
_GDIPlus_GraphicsFillEllipse($hGraphic, 130, 70, 140, 140, $hBrush)
; Loop until user exits
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
; Clean up resources
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_BrushDispose($hBrush)
_GDIPlus_Shutdown ()
EndFunc ;==>_Main
[/autoit]Gruß,
UEZ
Hier ein "fast hack" von mir:
#include <GDIplus.au3>
Opt("GUIOnEventMode", 1)
_GDIPlus_Startup()
Global $Stator = _GDIPlus_BitmapCreateFromFile(@ScriptDir & "\Stator.png")
Global $Rotor = _GDIPlus_BitmapCreateFromFile(@ScriptDir & "\Rotor_small.png")
Global $Schleifkontakte = _GDIPlus_BitmapCreateFromFile(@ScriptDir & "\Schleifkontakte.png")
Global $width = _GDIPlus_ImageGetWidth($Stator)
Global $height = _GDIPlus_ImageGetHeight($Stator)
Global $dx = _GDIPlus_ImageGetWidth($Rotor)
Global $dy = _GDIPlus_ImageGetHeight($Rotor)
Global $i
[/autoit] [autoit][/autoit] [autoit]Global $hWnd = GUICreate("GDI+: Example by UEZ", $width, $height, -1, -1, Default)
GUISetOnEvent(-3, "_Exit")
GUISetState()
Global $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hWnd)
Global $hBitmap = _GDIPlus_BitmapCreateFromGraphics($width, $height, $hGraphics)
Global $hBackbuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap)
Global $hFGBitmap = _GDIPlus_BitmapCreateFromGraphics($dx, $dy, $hGraphics)
Global $hFGBackbuffer = _GDIPlus_ImageGetGraphicsContext($hFGBitmap)
Global $hMatrix = _GDIPlus_MatrixCreate()
_GDIPlus_MatrixTranslate($hMatrix, $dx / 2, $dy / 2)
_GDIPlus_GraphicsClear($hBackbuffer, 0xFFFFFFFF)
Global $FG_x = 165
Global $FG_y = 165
Global $mid_x = $dx * 0.5
Global $mid_y = $dy * 0.5
$i = 5
[/autoit] [autoit][/autoit] [autoit]While Sleep(20)
_GDIPlus_GraphicsDrawImage($hBackbuffer, $Stator, 0, 0) ;draw background
_GDIPlus_GraphicsDrawImage($hBackbuffer, $Schleifkontakte, 0, 185) ;draw background
_GDIPlus_GraphicsClear($hFGBackbuffer, 0xFFFFFFFF) ;clear backbuffer from foreground graphics
_GDIPlus_MatrixRotate($hMatrix, $i, 0) ;rotate foreground graphic
_GDIPlus_GraphicsSetTransform($hFGBackbuffer, $hMatrix)
_GDIPlus_GraphicsDrawImage($hFGBackbuffer, $Rotor, -$mid_x, -$mid_y)
_GDIPlus_GraphicsDrawImageRect($hBackbuffer, $hFGBitmap, $FG_x, $FG_y, $dx, $dy) ;copy foreground backbuffer to main backbuffer
_GDIPlus_GraphicsDrawImageRect($hGraphics, $hBitmap, 0, 0, $width, $height) ;copy full drawn image to main screen
WEnd
Func _Exit()
_GDIPlus_BitmapDispose($Stator)
_GDIPlus_BitmapDispose($Rotor)
_GDIPlus_BitmapDispose($Schleifkontakte)
_GDIPlus_BitmapDispose($hFGBitmap)
_GDIPlus_GraphicsDispose($hFGBackbuffer)
_GDIPlus_MatrixDispose($hMatrix)
_GDIPlus_BitmapDispose($hBitmap)
_GDIPlus_GraphicsDispose($hBackbuffer)
_GDIPlus_GraphicsDispose($hGraphics)
_GDIPlus_Shutdown()
Exit
EndFunc
Gruß,
UEZ
Schaue mal hier nach: http://www.autoitscript.com/forum/index.php?showtopic=97362
Vielleicht kannst du was davon gebrauchen...
Gruß,
UEZ
Schaue mal hier -> http://www.autoitscript.com/forum/index.php?showtopic=97159, ob dir das weiterhilft!
Gruß,
UEZ
Auch von mir Happy Birthday und alles Gute!
Gruß,
UEZ
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=e:\meine programme\test\auto reg\form1.kxf
$Form1_1 = GUICreate("Auto-Reg", 633, 454, 192, 114)
$Radio1 = GUICtrlCreateRadio("Radio1", 16, 48, 17, 25)
GUICtrlSetColor(-1, 0xFFFFE1)
$Label1 = GUICtrlCreateLabel("S/ EP", 48, 46, 120, 34)
GUICtrlSetFont(-1, 13, 400, 0, "Arial Black")
GUICtrlSetColor(-1, 0x0A246A)
$Radio2 = GUICtrlCreateRadio("Radio2", 16, 120, 17, 25)
GUICtrlSetColor(-1, 0xFFFFE1)
$Label2 = GUICtrlCreateLabel("C", 48, 118, 120, 34)
GUICtrlSetFont(-1, 13, 400, 0, "Arial Black")
GUICtrlSetColor(-1, 0x0A246A)
$Radio3 = GUICtrlCreateRadio("Radio3", 16, 192, 17, 25)
GUICtrlSetColor(-1, 0xFFFFE1)
$Label3 = GUICtrlCreateLabel("AD", 49, 191, 120, 34)
GUICtrlSetFont(-1, 13, 400, 0, "Arial Black")
GUICtrlSetColor(-1, 0x0A246A)
$buttonA = GUICtrlCreateButton("A", 200, 48)
GUICtrlSetState(-1, $GUI_HIDE)
$buttonB = GUICtrlCreateButton("B", 250, 48)
GUICtrlSetState(-1, $GUI_HIDE)
$buttonC = GUICtrlCreateButton("C", 300, 48)
GUICtrlSetState(-1, $GUI_HIDE)
$buttonD = GUICtrlCreateButton("D", 200, 120)
GUICtrlSetState(-1, $GUI_HIDE)
$buttonE = GUICtrlCreateButton("E", 250, 120)
GUICtrlSetState(-1, $GUI_HIDE)
$buttonF = GUICtrlCreateButton("F", 300, 120)
GUICtrlSetState(-1, $GUI_HIDE)
$buttonG = GUICtrlCreateButton("G", 200, 192)
GUICtrlSetState(-1, $GUI_HIDE)
$buttonH = GUICtrlCreateButton("H", 250, 192)
GUICtrlSetState(-1, $GUI_HIDE)
$buttonI = GUICtrlCreateButton("I", 300, 192)
GUICtrlSetState(-1, $GUI_HIDE)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Radio1
GUICtrlSetState($buttonA, $GUI_SHOW)
GUICtrlSetState($buttonB, $GUI_SHOW)
GUICtrlSetState($buttonC, $GUI_SHOW)
GUICtrlSetState($buttonD, $GUI_HIDE)
GUICtrlSetState($buttonE, $GUI_HIDE)
GUICtrlSetState($buttonF, $GUI_HIDE)
GUICtrlSetState($buttonG, $GUI_HIDE)
GUICtrlSetState($buttonH, $GUI_HIDE)
GUICtrlSetState($buttonI, $GUI_HIDE)
Case $Radio2
GUICtrlSetState($buttonA, $GUI_HIDE)
GUICtrlSetState($buttonB, $GUI_HIDE)
GUICtrlSetState($buttonC, $GUI_HIDE)
GUICtrlSetState($buttonD, $GUI_SHOW)
GUICtrlSetState($buttonE, $GUI_SHOW)
GUICtrlSetState($buttonF, $GUI_SHOW)
GUICtrlSetState($buttonG, $GUI_HIDE)
GUICtrlSetState($buttonH, $GUI_HIDE)
GUICtrlSetState($buttonI, $GUI_HIDE)
Case $Radio3
GUICtrlSetState($buttonA, $GUI_HIDE)
GUICtrlSetState($buttonB, $GUI_HIDE)
GUICtrlSetState($buttonC, $GUI_HIDE)
GUICtrlSetState($buttonD, $GUI_HIDE)
GUICtrlSetState($buttonE, $GUI_HIDE)
GUICtrlSetState($buttonF, $GUI_HIDE)
GUICtrlSetState($buttonG, $GUI_SHOW)
GUICtrlSetState($buttonH, $GUI_SHOW)
GUICtrlSetState($buttonI, $GUI_SHOW)
EndSwitch
WEnd
So vielleicht?
Gruß,
UEZ
PS: Friede sei mit dir 
Alles Gute zum Geburtstag wünscht euch UEZ 
Eine Exe in SCR umbenennen macht daraus nicht umbedingt einen richtigen Screensaver - das ist ein wenig komplizierter ![]()
Anonsonsten sieht es gut aus ![]()
Gruß,
UEZ
Hier was aus dem engl. Forum: FAF Archive format
Slm,
UEZ
name22, du entwickelst dich ganz gut in Sachen GDI+
Weiter so ![]()
Btw, ich hatte auch mal so was ähnliches geschrieben - > Particle Explosions
In meinem Kopf schwirrt immer noch die Implementierung eines Feuerwerks rum :wacko: Mal sehen, wann ich es umsetzen kann...
Gruß,
UEZ
UEZ
hast du nicht noch ne idee wie man das ganze transparent machen kann?also das die zeit dann aufm desktop ist und man die dortrumwerfen kann?
Also, mein Desktop hat die Auflösung 1920x1200 -> kann langsam werden, wenn man "double buffering" benutzt!
Ja, ich hatte doch mal was mit "Rotating Letters Transparent" veröffentlicht! Dort werden die Buchstaben transparent auf den Desktop dargestellt (nur eine Illusion)!
Schau' mal in meiner Signatur.
Gruß,
UEZ
Nimm doch anstelle der Uhr eine Kugel, die du in der GUI "rumwerfen" kannst, natürlich mit Gravitation. ![]()
Gruß,
UEZ
Sollte mit dieser Funktion sollte es so funktionieren, wie du es willst oder?
[autoit]
...
Func _MenuShow()
_Time("stop")
HotKeySet("{PAUSE}")
Local $iWidth = 200
Local $iHeight = 300
Local $iRadius = 30
Local $iOffset = 3
GUISetState(@SW_DISABLE, $hGui)
Opt("GUIOnEventMode", 0)
$hGuiMenu = GUICreate("Menü", $iWidth + 6, $iHeight + 6, -1, -1, 0, $WS_EX_LAYERED)
$hGuiMenu1 = GUICreate("", 80, 25, -1, -1, $WS_POPUP, $WS_EX_LAYERED + $WS_EX_TOPMOST, $hGuiMenu)
GUISetBkColor(0xF0F0F0)
$hContinue = GUICtrlCreateButton("Weiter", 0, 0, 80, 25)
GUISetState(@SW_SHOW, $hGuiMenu1)
GUISetState(@SW_SHOW, $hGuiMenu)
_WinAPI_SetLayeredWindowAttributes($hGuiMenu1, 0xF0F0F0)
WinSetTrans ($hGuiMenu1, "", 0xC0)
$hGraphicMenu = _GDIPlus_GraphicsCreateFromHWND($hGuiMenu)
$hBitmapMenu = _GDIPlus_BitmapCreateFromGraphics($iWidth + 6, $iHeight + 6, $hGraphicMenu)
$hBufferMenu = _GDIPlus_ImageGetGraphicsContext($hBitmapMenu)
#region
$ScreenDc = _WinAPI_GetDC($hGuiMenu)
$gdibitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmapMenu)
$dc = _WinAPI_CreateCompatibleDC($ScreenDc)
_WinAPI_SelectObject($dc, $gdibitmap)
; _WinAPI_UpdateLayeredWindow parameters
$tSize = DllStructCreate($tagSIZE)
$pSize = DllStructGetPtr($tSize)
DllStructSetData($tSize, "X", $iWidth + 6)
DllStructSetData($tSize, "Y", $iHeight + 6)
$tSource = DllStructCreate($tagPOINT)
$pSource = DllStructGetPtr($tSource)
$tBlend = DllStructCreate($tagBLENDFUNCTION)
$pBlend = DllStructGetPtr($tBlend)
DllStructSetData($tBlend, "Alpha", 0xF0)
DllStructSetData($tBlend, "Format", 1)
$tPoint = DllStructCreate($tagPOINT)
$pPoint = DllStructGetPtr($tPoint)
DllStructSetData($tPoint, "X", 0)
DllStructSetData($tPoint, "Y", 0)
$Brush_BG = _GDIPlus_BrushCreateSolid(0xAAFFA500)
$Pen_BG_Line = _GDIPlus_PenCreate(0xFF000000, 3)
$Pen_BG_Arc = _GDIPlus_PenCreate(0xFF000000, 3)
_GDIPlus_GraphicsFillRect($hBufferMenu, $iOffset, $iRadius + $iOffset, $iRadius, $iHeight - $iRadius * 2, $Brush_BG)
_GDIPlus_GraphicsFillPie($hBufferMenu, $iOffset, $iOffset, $iRadius * 2, $iRadius * 2, 180, 90, $Brush_BG)
_GDIPlus_GraphicsFillRect($hBufferMenu, $iRadius + $iOffset, $iOffset, $iWidth - $iRadius * 2, $iRadius, $Brush_BG)
_GDIPlus_GraphicsFillPie($hBufferMenu, $iWidth - $iRadius * 2 + $iOffset, $iOffset, $iRadius * 2, $iRadius * 2, 270, 90, $Brush_BG)
_GDIPlus_GraphicsFillRect($hBufferMenu, $iWidth - $iRadius + $iOffset, $iRadius + $iOffset, $iRadius, $iHeight - $iRadius * 2, $Brush_BG)
_GDIPlus_GraphicsFillPie($hBufferMenu, $iWidth - $iRadius * 2 + $iOffset, $iHeight - $iRadius * 2 + $iOffset, $iRadius * 2, $iRadius * 2, 0, 90, $Brush_BG)
_GDIPlus_GraphicsFillRect($hBufferMenu, $iRadius + $iOffset, $iHeight - $iRadius + $iOffset, $iWidth - $iRadius * 2, $iRadius, $Brush_BG)
_GDIPlus_GraphicsFillPie($hBufferMenu, $iOffset, $iHeight - $iRadius * 2 + $iOffset, $iRadius * 2, $iRadius * 2, 90, 90, $Brush_BG)
_GDIPlus_GraphicsFillRect($hBufferMenu, $iRadius + $iOffset, $iRadius + $iOffset, $iWidth - $iRadius * 2, $iHeight - $iRadius * 2, $Brush_BG)
_GDIPlus_GraphicsSetSmoothingMode($hBufferMenu, 2)
_GDIPlus_GraphicsDrawLine($hBufferMenu, $iOffset, $iHeight - $iRadius + $iOffset, $iOffset, $iRadius + $iOffset, $Pen_BG_Line)
_GDIPlus_GraphicsDrawArc($hBufferMenu, $iOffset, $iOffset, $iRadius * 2, $iRadius * 2, 180, 90, $Pen_BG_Arc)
_GDIPlus_GraphicsDrawLine($hBufferMenu, $iRadius + $iOffset, $iOffset, $iWidth - $iRadius + $iOffset, $iOffset, $Pen_BG_Line)
_GDIPlus_GraphicsDrawArc($hBufferMenu, $iWidth - $iRadius * 2 + $iOffset, $iOffset, $iRadius * 2, $iRadius * 2, 270, 90, $Pen_BG_Arc)
_GDIPlus_GraphicsDrawLine($hBufferMenu, $iWidth + $iOffset, $iRadius + $iOffset, $iWidth + $iOffset, $iHeight - $iRadius + $iOffset, $Pen_BG_Line)
_GDIPlus_GraphicsDrawArc($hBufferMenu, $iWidth - $iRadius * 2 + $iOffset, $iHeight - $iRadius * 2 + $iOffset, $iRadius * 2, $iRadius * 2, 0, 90, $Pen_BG_Arc)
_GDIPlus_GraphicsDrawLine($hBufferMenu, $iRadius + $iOffset, $iHeight + $iOffset, $iWidth - $iRadius + $iOffset, $iHeight + $iOffset, $Pen_BG_Line)
_GDIPlus_GraphicsDrawArc($hBufferMenu, $iOffset, $iHeight - $iRadius * 2 + $iOffset, $iRadius * 2, $iRadius * 2, 90, 90, $Pen_BG_Arc)
_GDIPlus_GraphicsSetSmoothingMode($hBufferMenu, 2)
$gdibitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmapMenu)
_WinAPI_SelectObject($dc, $gdibitmap)
_WinAPI_UpdateLayeredWindow($hGuiMenu, $ScreenDc, 0, $pSize, $dc, $pSource, 0, $pBlend, 2)
_WinAPI_DeleteObject($gdibitmap)
;~ _GDIPlus_GraphicsDrawImageRect($hGraphicMenu, $hBitmapMenu, 0, 0, $iWidth + 6, $iHeight + 6)
#endregion
While 1
Switch GUIGetMsg()
Case $hContinue
_GDIPlus_PenDispose($Pen_BG_Line)
_GDIPlus_PenDispose($Pen_BG_Arc)
_GDIPlus_BrushDispose($Brush_BG)
_WinAPI_DeleteDC($dc)
_WinAPI_ReleaseDC($hGuiMenu, $ScreenDc)
_GDIPlus_GraphicsDispose($hBufferMenu)
_GDIPlus_BitmapDispose($hBitmapMenu)
$tSize = ""
$tSource = ""
$tBlend = ""
$tPoint = ""
GUISetState(@SW_ENABLE, $hGui)
GUIDelete($hGuiMenu)
GUIDelete($hGuiMenu1)
Opt("GUIOnEventMode", 1)
HotKeySet("{PAUSE}", "_MenuShow")
_Time("start")
Return
EndSwitch
WEnd
EndFunc
...
Gruß,
UEZ
Füge in der Funktion _MenuShow() _WinAPI_SetLayeredWindowAttributes($hGuiMenu, 0xf0f0f0) ein.
[autoit]
...
$hGuiMenu = GUICreate("Menü", $iWidth + 6, $iHeight + 6, Default, Default, $WS_POPUP, $WS_EX_LAYERED, $hGui)
$hContinue = GUICtrlCreateButton("Weiter", 40, 40, 80, 25)
_WinAPI_SetLayeredWindowAttributes($hGuiMenu, 0xf0f0f0)
GUISetState()
...
Dann sollte die GUI transparent sein.
Gruß,
UEZ