Sieht jetzt gut aus! ![]()
Gruß,
UEZ
Sieht jetzt gut aus! ![]()
Gruß,
UEZ
Sieht sehr gut aus - gefällt mir!
Weiter so!
Gruß,
UEZ
Ich habe noch Probleme mit meinen 2 Skripten gefunden:
Eilt nicht, da du ja heute Geburtstag hast ![]()
Gruß,
UEZ
Ich war mal so frei und habe deinen Code etwas verkürzt!
#NoTrayIcon
#include <Date.au3>
#include <GDIPlus.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Opt("TrayMenuMode", 1)
$Form1 = GUICreate("GDI+ Summencode-Led Uhr", 215, 250, @DesktopWidth-215, @DesktopHeight-280, $WS_POPUP, $WS_EX_TOPMOST)
GUISetBkColor(0x000000)
$Label1 = GUICtrlCreateLabel("", 0, 0, 215, 250, Default, $GUI_WS_EX_PARENTDRAG)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUISetState(@SW_SHOW)
$context = GUICtrlCreateContextMenu($Label1)
$hide = GUICtrlCreateMenuItem("Ausblenden", $context)
GUICtrlCreateMenuItem("", $context)
$exit = GUICtrlCreateMenuItem("Beenden", $context)
$show = TrayCreateItem("Anzeigen")
TrayCreateItem("")
$exittray = TrayCreateItem("Exit")
_GDIPlus_Startup()
$grafik = _GDIPlus_GraphicsCreateFromHWND($Form1)
$brushledoff = _GDIPlus_BrushCreateSolid(0xFF441A00)
$brushledon =_GDIPlus_BrushCreateSolid(0xFFFFA100)
Do
$msg = GUIGetMsg()
$tmsg = TrayGetMsg()
Select
Case $msg = $hide
WinMove($Form1, "", @DesktopWidth, @DesktopHeight-280, Default, Default, 5)
TraySetState(1)
GUISetState(@SW_HIDE)
Case $msg = $exit
Ende()
Case $tmsg = $exittray
Ende()
Case $tmsg = $show
GUISetState(@SW_Show)
WinMove($Form1, "", @DesktopWidth-215, @DesktopHeight-280, Default, Default, 5)
TraySetState(2)
EndSelect
$stu1 = Stringmid(_Nowtime(), 1, 1)
$stu2 = Stringmid(_Nowtime(), 2, 1)
$min1 = Stringmid(_Nowtime(), 4, 1)
$min2 = Stringmid(_Nowtime(), 5, 1)
$sek1 = Stringmid(_Nowtime(), 7, 1)
$sek2 = Stringmid(_Nowtime(), 8, 1)
_LedColDrawActive(30, $stu1)
_LedColDrawActive(50, $stu2)
_LedColDrawActive(90, $min1)
_LedColDrawActive(110, $min2)
_LedColDrawActive(150, $sek1)
_LedColDrawActive(170, $sek2)
Until $msg = $GUI_EVENT_CLOSE
Ende()
Func Ende()
_GDIPlus_GraphicsDispose($grafik)
_GDIPlus_BrushDispose($brushledoff)
_GDIPlus_BrushDispose($brushledon)
Exit
EndFunc
Func _Update()
$mp = WinGetPos("GDI+ Summencode-Led Uhr")
While $mp[0] And $mp[1] < -10
$mp = WinGetPos("GDI+ Summencode-Led Uhr")
$stu1 = Stringmid(_Nowtime(), 1, 1)
$stu2 = Stringmid(_Nowtime(), 2, 1)
$min1 = Stringmid(_Nowtime(), 4, 1)
$min2 = Stringmid(_Nowtime(), 5, 1)
$sek1 = Stringmid(_Nowtime(), 7, 1)
$sek2 = Stringmid(_Nowtime(), 8, 1)
_LedColDrawActive(30, $stu1)
_LedColDrawActive(50, $stu2)
_LedColDrawActive(90, $min1)
_LedColDrawActive(110, $min2)
_LedColDrawActive(150, $sek1)
_LedColDrawActive(170, $sek2)
WEnd
EndFunc
Func _LedColDrawActive($x, $num)
[/autoit] [autoit][/autoit] [autoit]Switch $num
Case 0
Zeichne_Ellipse("000000000", $x)
Case 1
Zeichne_Ellipse("000000001", $x)
case 2
Zeichne_Ellipse("000000011", $x)
case 3
Zeichne_Ellipse("000000111", $x)
case 4
Zeichne_Ellipse("000001111", $x)
case 5
Zeichne_Ellipse("000011111", $x)
case 6
Zeichne_Ellipse("000111111", $x)
case 7
Zeichne_Ellipse("001111111", $x)
case 8
Zeichne_Ellipse("011111111", $x)
case 9
Zeichne_Ellipse("111111111", $x)
EndSwitch
EndFunc
Func Zeichne_Ellipse($bits, $x)
Local $aBits = StringSplit($bits, "", 2), $c
For $c = 0 To UBound($aBits) - 1
If $aBits[$c] = 0 Then
_GDIPlus_GraphicsFillEllipse($grafik, $x, 40+(20*$c), 12, 12, $brushledoff)
Else
_GDIPlus_GraphicsFillEllipse($grafik, $x, 40+(20*$c), 12, 12, $brushledon)
EndIf
Next
EndFunc
Gruß,
UEZ
Herzlichen Glückwunsch zum Geburtstag und alles Gute GDI+ Meister ![]()
Gruß,
UEZ
Danke für das Update!
Ich finde 2 farbig schöner:
1stColor=0xFFFFFF
2ndColor=0xF0F0F0
Ist Geschmack Sache!
Aber könnten die Farben nicht durchgehend sein? Ein Raster a la Excel wäre auch noch schön!
Apropos schön: Tooltip finde ich auch super!
Ein Export in CSV könnte auch hilfreich sein, bzw. Import von einer CSV (Semikon getrennt)!
Gruß,
UEZ
Nette Umsetzung!
Was mir fehlt, ist ein Kontextmenu und Key Shortcuts, um schneller Daten hinzuzufügen bzw. zu löschen! Um die Einträge besser zu unterscheiden, wären farbliche Zeilen (2 Farben sollten reichen) von Vorteil.
Gruß,
UEZ
Hier der verbesserte Code bzgl.>= Win7:
#AutoIt3Wrapper_UseX64=y
#AutoIt3Wrapper_Change2CUI=y
Global $PID
Global Const $Process_All_Access = 0x1F0FFF
$PID = ProcessExists(@AutoItPID)
If $PID = 0 Then
ConsoleWrite(@CRLF & "ERROR! Process " & $PID & " not found! Aborting..." & @CRLF)
Exit
EndIf
$ProcHandle = DllCall("kernel32.dll", "hwnd", "OpenProcess", "dword", $Process_All_Access, "int", False, "dword", $PID)
$ProcHandle = $ProcHandle[0]
MsgBox(0, "PrivateUsage Size", Round(_ProcessGetMem($ProcHandle) / 1024, 0) & " kb")
[/autoit] [autoit][/autoit] [autoit]DllCall("psapi.dll", "int", "CloseHandle", "hwnd", $ProcHandle)
DllCall("kernel32.dll", "int", "CloseHandle", "int", $ProcHandle)
Exit
Func _ProcessGetMem($ProcessHandle) ;get physical memory of the process -> http://msdn.microsoft.com/en-us/library/…28VS.85%29.aspx
Local $structPROCESS_MEMORY_COUNTERS, $structPROCESS_MEMORY_COUNTERS_EX, $nSize, $aRet
If @OSBuild < 7600 Then
$structPROCESS_MEMORY_COUNTERS = DllStructCreate("dword cb; dword PageFaultCount; dword_ptr PeakWorkingSetSize; ulong_ptr WorkingSetSize; " & _
"dword_ptr QuotaPeakPagedPoolUsage; dword_ptr QuotaPagedPoolUsage; dword_ptr QuotaPeakNonPagedPoolUsage; " & _
"dword_ptr QuotaNonPagePoolUsage; dword_ptr PagefileUsage; dword_ptr PeakPagefileUsage") ;http://msdn.microsoft.com/en-us/library/…28VS.85%29.aspx
$nSize = DllStructGetSize($structPROCESS_MEMORY_COUNTERS)
$aRet = DllCall("psapi.dll", "int", "GetProcessMemoryInfo", "hwnd", $ProcessHandle, "ptr", DllStructGetPtr($structPROCESS_MEMORY_COUNTERS), "dword", $nSize) ;call GetProcessMemoryInfo
If $aRet[0] = 0 Then
ConsoleWrite("(" & @ScriptLineNumber & ") : = Error in GetProcessMemoryInfo call" & @LF)
SetError(1, 0, $aRet[0])
EndIf
Return DllStructGetData($structPROCESS_MEMORY_COUNTERS, "WorkingSetSize")
Else
$structPROCESS_MEMORY_COUNTERS_EX = DllStructCreate("dword cb; dword PageFaultCount; dword_ptr PeakWorkingSetSize; dword_ptr WorkingSetSize; " & _
"dword_ptr QuotaPeakPagedPoolUsage; dword_ptr QuotaPagedPoolUsage; dword_ptr QuotaPeakNonPagedPoolUsage; " & _
"dword_ptr QuotaNonPagePoolUsage; dword_ptr PagefileUsage; dword_ptr PeakPagefileUsage; " & _
"ulong_ptr PrivateUsage") ;http://msdn.microsoft.com/en-us/library/…28VS.85%29.aspx
$nSize = DllStructGetSize($structPROCESS_MEMORY_COUNTERS_EX)
$aRet = DllCall("Kernel32.dll", "int", "K32GetProcessMemoryInfo", "hwnd", $ProcessHandle, "ptr", DllStructGetPtr($structPROCESS_MEMORY_COUNTERS_EX), "dword", $nSize) ;call GetProcessMemoryInfo
If $aRet[0] = 0 Then
ConsoleWrite("(" & @ScriptLineNumber & ") : = Error in GetProcessMemoryInfo call" & @LF)
SetError(1, 0, $aRet[0])
EndIf
ConsoleWrite("WorkingSetSize: " & Round(DllStructGetData($structPROCESS_MEMORY_COUNTERS_EX, "WorkingSetSize"), 0) & @CRLF & _
"PageFaultCount: " & Round(DllStructGetData($structPROCESS_MEMORY_COUNTERS_EX, "PageFaultCount"), 0) & @CRLF & _
"PeakWorkingSetSize: " & Round(DllStructGetData($structPROCESS_MEMORY_COUNTERS_EX, "PeakWorkingSetSize"), 0) & @CRLF & _
"QuotaPeakPagedPoolUsage: " & Round(DllStructGetData($structPROCESS_MEMORY_COUNTERS_EX, "QuotaPeakPagedPoolUsage"), 0) & @CRLF & _
"QuotaPagedPoolUsage: " & Round(DllStructGetData($structPROCESS_MEMORY_COUNTERS_EX, "QuotaPagedPoolUsage"), 0) & @CRLF & _
"QuotaPeakNonPagedPoolUsage: " & Round(DllStructGetData($structPROCESS_MEMORY_COUNTERS_EX, "QuotaPeakNonPagedPoolUsage"), 0) & @CRLF & _
"QuotaNonPagePoolUsage: " & Round(DllStructGetData($structPROCESS_MEMORY_COUNTERS_EX, "QuotaNonPagePoolUsage"), 0) & @CRLF & _
"PagefileUsage: " & Round(DllStructGetData($structPROCESS_MEMORY_COUNTERS_EX, "PagefileUsage"), 0) & @CRLF & _
"PeakPagefileUsage: " & Round(DllStructGetData($structPROCESS_MEMORY_COUNTERS_EX, "PeakPagefileUsage"), 0) & @CRLF & _
"PrivateUsage: " & Round(DllStructGetData($structPROCESS_MEMORY_COUNTERS_EX, "PrivateUsage"), 0) & @CRLF & @CRLF)
Return DllStructGetData($structPROCESS_MEMORY_COUNTERS_EX, "PrivateUsage")
EndIf
EndFunc ;==>_ProcessGetMem
Nichts desto trotz liefert PrivateUsage nicht den Speicher zurück, der im Taskmanager (WS Private) erscheint!
Die Suche geht weiter nach einer nicht WMI Lösung...
Gruß,
UEZ
;Example by UEZ
;#NoTrayIcon
#include <GDIPlus.au3>
#include <Misc.au3>
Opt("GUIOnEventMode", 1)
[/autoit] [autoit][/autoit] [autoit]Global $hWnd, $hGraphic, $hBitmap, $hBackbuffer, $hImage
Global $ScreenDc, $dc, $tSize, $pSize, $tSource, $pSource, $tBlend, $pBlend, $tPoint, $pPoint, $gdibitmap
Global $title = "GDI+ Beispiel: Text spiegeln", _
$width = 500, _
$height = 130
Global $reflect, $MousePos
[/autoit] [autoit][/autoit] [autoit]$hWnd = GUICreate($title, $width, $height, -1, -1, 0x80000000, BitOR(0x00000080, 0x00080000, 0x00000008))
[/autoit] [autoit][/autoit] [autoit]_Startup()
_GDIPlus_GraphicsClear($hBackbuffer, 0x00000000)
Draw_Text($hBackbuffer, "Spiegel Schrift", $width, $height)
_GDIPlus_GraphicsReflectImageRect($hBackbuffer, $hBitmap, 0, 60, -1, 40, 0)
[/autoit] [autoit][/autoit] [autoit]$gdibitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap)
_WinAPI_SelectObject($dc, $gdibitmap)
_WinAPI_UpdateLayeredWindow($hWnd, $ScreenDc, 0, $pSize, $dc, $pSource, 0, $pBlend, 2)
_WinAPI_DeleteObject($gdibitmap)
_GDIClose()
GUISetOnEvent(-3, "_Close")
GUISetState()
While Sleep(100000)
WEnd
Func Draw_Text($hGFX, $text, $w, $h, $fs = 40, $fn = "Comic Sans MS", $fc = 0xFF0000A0, $fa = 1)
$hBrush = _GDIPlus_BrushCreateSolid($fc)
$hFamily = _GDIPlus_FontFamilyCreate($fn)
$hFont = _GDIPlus_FontCreate($hFamily, $fs)
$hLayout = _GDIPlus_RectFCreate(0, 0, $w, $h)
$hStringFormat = _GDIPlus_StringFormatCreate()
_GDIPlus_StringFormatSetAlign($hStringFormat, $fa)
_GDIPlus_GraphicsDrawStringEx($hGFX, $text, $hFont, $hLayout, $hStringFormat, $hBrush)
_GDIPlus_BrushDispose($hBrush)
_GDIPlus_FontFamilyDispose($hFamily)
_GDIPlus_FontDispose($hFont)
_GDIPlus_StringFormatDispose($hStringFormat)
EndFunc
Func _Startup()
_GDIPlus_Startup()
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($hWnd)
$hBitmap = _GDIPlus_BitmapCreateFromGraphics($width, $height, $hGraphic)
$hBackbuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap)
_GDIPlus_GraphicsSetSmoothingMode($hBackbuffer, 2)
$ScreenDc = _WinAPI_GetDC($hWnd)
$dc = _WinAPI_CreateCompatibleDC($ScreenDc)
$tSize = DllStructCreate($tagSIZE)
$pSize = DllStructGetPtr($tSize)
DllStructSetData($tSize, "X", $width)
DllStructSetData($tSize, "Y", $height)
$tSource = DllStructCreate($tagPOINT)
$pSource = DllStructGetPtr($tSource)
$tBlend = DllStructCreate($tagBLENDFUNCTION)
$pBlend = DllStructGetPtr($tBlend)
DllStructSetData($tBlend, "Alpha", 0xFF)
DllStructSetData($tBlend, "Format", 1)
$tPoint = DllStructCreate($tagPOINT)
$pPoint = DllStructGetPtr($tPoint)
DllStructSetData($tPoint, "X", 0)
DllStructSetData($tPoint, "Y", 0)
EndFunc
Func _GDIClose()
_GDIPlus_ImageDispose($hImage)
_GDIPlus_GraphicsDispose($hBackbuffer)
_GDIPlus_BitmapDispose($hBitmap)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_Shutdown()
EndFunc
Func _Close()
Exit
EndFunc
; #FUNCTION# ==========================================================================================================
; Name...........: _GDIPlus_GraphicsReflectImageRect
; Description ...: Spiegelt ein Bildobjekt mit abfallender Transparents und einstellbarer Schräge.
; Syntax.........: _GDIPlus_GraphicsReflectImageRect($hGraphic, $hImage, $xpos, $ypos, [$dwidth, [$dheight, [$divx]]])
; Parameters ....: $hGraphics - Handle zu einem Graphicobjekt
; $hImage - Handle zu einem Bildobjekt
; $xpos - Die X Koordinate des Startzeichenpunktes
; $ypos - Die Y Koordinate des Startzeichenpunktes
; $dwidth - Breite des zu zeichnenden Bildes
; $dheight - Höhe des zu zeichnenden Bildes (!FEHLERHAFT)
; $divx - Die Anzahl der Pixel, die pro Zeile nach links eingerückt werden
; Return values .: Success - True
; Failure - @error
; Author ........: h2112
; Remarks .......: Die Funktion _GDIPlus_GraphicsDrawImageRectRectTrans wird benötigt
;======================================================================================================================
Func _GDIPlus_GraphicsReflectImageRect($hGraphic, $hImage, $xpos, $ypos, $dwidth = -1, $dheight = -1, $divx = 0.7)
Local $height, $width, $clone, $stat, $check
Local $divy, $divtrans, $trans, $x, $y, $olddivy
$height = _GDIPlus_ImageGetHeight($hImage)
$width = _GDIPlus_ImageGetWidth($hImage)
If $dheight = -1 Then $dheight = $height
If $dwidth = -1 Then $dwidth = $width
$divtrans = 255 / $height
$divy = $dheight / $height
For $i = $height To 0 Step -1
$trans = 1 / 255 * $divtrans * $i
$x = $divx * ($height - $i)
$y = $divy * ($height - $i)
If Int($y) <> Int($divy) * ($height - $i) + $stat Then
$stat += 1
$check = 1
$olddivy = $divy
$divy += Int($y) - Int($divy) * ($height - $i) + $stat
EndIf
$clone = _GDIPlus_BitmapCloneArea($hImage, 0, $i, $width, 1, $GDIP_PXF64PARGB)
_GDIPlus_GraphicsDrawImageRectRectTrans($hGraphic, $clone, 0, 0, $width, $height, $xpos - $x, $y + $ypos, $dwidth, $divy, "", $trans)
If $check = 1 Then
$divy = $olddivy
$check = 0
EndIf
Next
If Not @error Then
Return True
Else
Return @error
EndIf
EndFunc
; #FUNCTION# ===================================================================================================
; Name...........: _GDIPlus_GraphicsDrawImageRectRectTrans
; Description ...: Draw an Image object with transparency
; Syntax.........: _GDIPlus_GraphicsDrawImageRectRect($hGraphics, $hImage, $iSrcX, $iSrcY, [$iSrcWidth, _
; [$iSrcHeight, [$iDstX, [$iDstY, [$iDstWidth, [$iDstHeight[, [$iUnit = 2]]]]]]])
; Parameters ....: $hGraphics - Handle to a Graphics object
; $hImage - Handle to an Image object
; $iSrcX - The X coordinate of the upper left corner of the source image
; $iSrcY - The Y coordinate of the upper left corner of the source image
; $iSrcWidth - Width of the source image
; $iSrcHeight - Height of the source image
; $iDstX - The X coordinate of the upper left corner of the destination image
; $iDstY - The Y coordinate of the upper left corner of the destination image
; $iDstWidth - Width of the destination image
; $iDstHeight - Height of the destination image
; $iUnit - Specifies the unit of measure for the image
; $nTrans - Value range from 0 (Zero for invisible) to 1.0 (fully opaque)
; Return values .: Success - True
; Failure - False
; Author ........: Siao
; Modified.......: Malkey
; Remarks .......:
; Related .......:
; Link ..........; http://www.autoitscript.com/forum/index.ph…ndpost&p=517195
; Example .......; Yes
Func _GDIPlus_GraphicsDrawImageRectRectTrans($hGraphics, $hImage, $iSrcX, $iSrcY, $iSrcWidth = "", $iSrcHeight = "", _
$iDstX = "", $iDstY = "", $iDstWidth = "" , $iDstHeight = "", $iUnit = 2, $nTrans = 1)
Local $tColorMatrix, $x, $hImgAttrib, $iW = _GDIPlus_ImageGetWidth($hImage), $iH = _GDIPlus_ImageGetHeight($hImage)
If $iSrcWidth = 0 or $iSrcWidth = "" Then $iSrcWidth = $iW
If $iSrcHeight = 0 or $iSrcHeight = "" Then $iSrcHeight = $iH
If $iDstX = "" Then $iDstX = $iSrcX
If $iDstY = "" Then $iDstY = $iSrcY
If $iDstWidth = "" Then $iDstWidth = $iSrcWidth
If $iDstHeight = "" Then $iDstHeight = $iSrcHeight
If $iUnit = "" Then $iUnit = 2
;;create color matrix data
$tColorMatrix = DllStructCreate("float[5];float[5];float[5];float[5];float[5]")
;blending values:
$x = DllStructSetData($tColorMatrix, 1, 1, 1) * DllStructSetData($tColorMatrix, 2, 1, 2) * DllStructSetData($tColorMatrix, 3, 1, 3) * _
DllStructSetData($tColorMatrix, 4, $nTrans, 4) * DllStructSetData($tColorMatrix, 5, 1, 5)
;;create an image attributes object and update its color matrix
$hImgAttrib = DllCall($ghGDIPDll, "int", "GdipCreateImageAttributes", "ptr*", 0)
$hImgAttrib = $hImgAttrib[1]
DllCall($ghGDIPDll, "int", "GdipSetImageAttributesColorMatrix", "ptr", $hImgAttrib, "int", 1, _
"int", 1, "ptr", DllStructGetPtr($tColorMatrix), "ptr", 0, "int", 0)
;;draw image into graphic object with alpha blend
DllCall($ghGDIPDll, "int", "GdipDrawImageRectRectI", "hwnd", $hGraphics, "hwnd", $hImage, "int", $iDstX, "int", _
$iDstY, "int", $iDstWidth, "int", $iDstHeight, "int", $iSrcX, "int", $iSrcY, "int", $iSrcWidth, "int", _
$iSrcHeight, "int", $iUnit, "ptr", $hImgAttrib, "int", 0, "int", 0)
;;clean up
DllCall($ghGDIPDll, "int", "GdipDisposeImageAttributes", "ptr", $hImgAttrib)
Return
EndFunc ;==>_GDIPlus_GraphicsDrawImageRectRectTrans
Ist eine Modifikation des Beispiels von H2112: _GDIPlus_GraphicsReflectImageRect
Gruß,
UEZ ![]()
Freut mich, dass ich dir helfen konnte! ![]()
Gruß,
UEZ ![]()
Alles anzeigenHallo UEZ,
Funktioniert das jetzt besser auf deinem Dual-Monitor?Spoiler anzeigen
[autoit]#include <Array.au3>
[/autoit] [autoit][/autoit] [autoit]
#include <WindowsConstants.au3>
HotKeySet("{ESC}", "_Exit") ; Set the Hotkey to exit.
$hDLL = DllOpen("user32.dll") ; Open the DLL for _WinIsHovered() (faster with DLL-handle)$h_Left = GUICreate("SlideGUI left", 155, 350, -1, -1, -1, $WS_EX_TOPMOST)
[/autoit] [autoit][/autoit] [autoit]
$_Button1 = GUICtrlCreateButton("Example Button", 40, 40, 100, 30)
GUICtrlCreateEdit("Sample Edit...", 20, 90, 120, 200)
$h_Right = GUICreate("SlideGUI Right", 155, 350, -1, -1, -1, $WS_EX_TOPMOST)
GUICtrlCreateEdit("Sample Edit...", 20, 20, 150, 300)
$h_Bottom = GUICreate("SlideGUI Bottom", 350, 155, -1, -1, -1, $WS_EX_TOPMOST)
GUICtrlCreateCheckbox("Sample Checkbox", 40, 30)
GUICtrlCreateCombo("Combo", 140, 50)
$h_Top = GUICreate("SlideGUI Top", 350, 155, -1, -1, -1, $WS_EX_TOPMOST)
$_ListView = GUICtrlCreateListView("Columnd 1|Column 2", 5, 5, 340, 145)
GUICtrlCreateListViewItem("Item 1_1|Item 1_2",$_ListView)
GUICtrlCreateListViewItem("Item 2_1|Item 2_2",$_ListView)
GUICtrlCreateListViewItem("Item 3_1|Item 3_2",$_ListView); Move GUI's to the right place and set the Variables State to False
[/autoit] [autoit][/autoit] [autoit]
Global $LEFT_IN = False, $RIGHT_IN = False, $BOTTOM_IN = False, $TOP_IN = False
_SlideWin($h_Left, "out", "left")
_SlideWin($h_Right, "out", "right")
_SlideWin($h_Bottom, "out", "bottom")
_SlideWin($h_Top, "out", "top"); Show GUI's
[/autoit] [autoit][/autoit] [autoit]
GUISetState(@SW_SHOWNOACTIVATE, $h_Left)
GUISetState(@SW_SHOWNOACTIVATE, $h_Right)
GUISetState(@SW_SHOWNOACTIVATE, $h_Bottom)
GUISetState(@SW_SHOWNOACTIVATE, $h_Top)While 1 * Sleep(10)
[/autoit] [autoit][/autoit] [autoit]
$nMsg = GUIGetMsg(1)
Select
Case $nMsg[0] = -3
Exit
Case $nMsg[0] = $_Button1
MsgBox(0, "", "Example Button clicked.")
Case _WinIsHovered($h_Left, $hDLL) ; Check if we need to Slide in a GUI.
If Not $LEFT_IN Then ; If not already slide-in,
_SlideWin($h_Left, "in", "left") ; Slide in GUI
$LEFT_IN = True ; Set var to True.
EndIf
Case _WinIsHovered($h_Right, $hDLL)
If Not $RIGHT_IN Then
_SlideWin($h_Right, "in", "right")
$RIGHT_IN = True
EndIf
Case _WinIsHovered($h_Bottom, $hDLL)
If Not $BOTTOM_IN Then
_SlideWin($h_Bottom, "in", "bottom")
$BOTTOM_IN = True
EndIf
Case _WinIsHovered($h_Top, $hDLL)
If Not $TOP_IN Then
_SlideWin($h_Top, "in", "top")
$TOP_IN = True
EndIf
Case Else ; No window is hovered. Check if we need to Slide out a GUI.
Select
Case $LEFT_IN
_SlideWin($h_Left, "out", "left")
$LEFT_IN = False
Case $RIGHT_IN
_SlideWin($h_Right, "out", "right")
$RIGHT_IN = False
Case $TOP_IN
_SlideWin($h_Top, "out", "top")
$TOP_IN = False
Case $BOTTOM_IN
_SlideWin($h_Bottom, "out", "bottom")
$BOTTOM_IN = False
EndSelect
EndSelect
WEndFunc _SlideWin($hWnd, $sMode, $sSide)
[/autoit] [autoit][/autoit] [autoit]
;$hWnd = Window to slide.
;$sMode = Slide-In or -out (in|out)
;$sSide = Side where you want the GUI to slide. (left|right|top|bottom)
Local $aScreen_Res = WinGetPos(WinGetHandle("Program Manager"))
Local $aWPos = WinGetPos($hWnd), $m = 0 - ($sMode = "in") + ($sMode = "out")
Local $h = 0 - ($sSide = "left") + ($sSide = "right"), $v = 0 - ($sSide = "top") + ($sSide = "bottom")WinMove($hWnd, "", _ ; Move GUI according to $sMode and $sSide.
[/autoit] [autoit][/autoit] [autoit]
0 - (($h = -1) * ($m = -1) * ($aWPos[2] - 10)) _
+ (($h = 1) * (($h = 1) * $aScreen_Res[2] - (10 * ($m = -1)) - ($m <> -1) * $aWPos[2])) _
+ (($h = 0) * (($h = 0) * ($aScreen_Res[2] / 2) - ($aWPos[2] / 2))) _
, _
0 - (($v = -1) * ($m = -1) * ($aWPos[3] - 10)) _
+ (($v = 1) * (($v = 1) * $aScreen_Res[3] - (10 * ($m = -1)) - ($m <> -1) * $aWPos[3])) _
+ (($v = 0) * (($v = 0) * ($aScreen_Res[3] / 2) - ($aWPos[3] / 2))) _
)$aWPos = WinGetPos($hWnd)
[/autoit] [autoit][/autoit] [autoit]
; Slide GUI.
Switch $sSide
Case "left", "right"
Local $STEP = (((($h = 1) And ($m = 1)) Or (($h = -1) And ($m = -1))) - ((($h = -1) And ($m = 1)) Or (($h = 1) And ($m = -1)))) * 10
Local $FROM = $aWPos[0], $TO = $aWPos[0] _
+ (((($h = 1) And ($m = 1)) Or (($h = -1) And ($m = -1))) * ($aWPos[2])) _
- (((($h = 1) And ($m = -1)) Or (($h = -1) And ($m = 1))) * ($aWPos[2])) - $STEP
For $i = $aWPos[0] To $TO Step $STEP
WinMove($hWnd, "", $i, $aWPos[1])
Sleep(10)
Next
Case "top", "bottom"
Local $STEP = (((($v = 1) And ($m = 1)) Or (($v = -1) And ($m = -1))) - ((($v = -1) And ($m = 1)) Or (($v = 1) And ($m = -1)))) * 10
Local $FROM = $aWPos[1], $TO = $aWPos[1] _
+ (((($v = 1) And ($m = 1)) Or (($v = -1) And ($m = -1))) * ($aWPos[3])) _
- (((($v = 1) And ($m = -1)) Or (($v = -1) And ($m = 1))) * ($aWPos[3])) - $STEP
For $i = $aWPos[1] To $TO Step $STEP
WinMove($hWnd, "", $aWPos[0], $i)
Sleep(10)
Next
EndSwitch
EndFunc ;==>_SlideWinFunc _WinIsHovered($hWnd, $vDLL = "User32.dll")
[/autoit] [autoit][/autoit] [autoit]
Local $aResult, $aWPos = WinGetPos($hWnd), $aMPos = MouseGetPos()
Local $tRect = DllStructCreate("int Left;int Top;int Right;int Bottom")
Local $iLeft = $aWPos[0], $iTop = $aWPos[1], $iWidth = $aWPos[2], $iHeight = $aWPos[3]
Local $iX = $aMPos[0], $iY = $aMPos[1]
DllStructSetData($tRect, "Left", $iLeft)
DllStructSetData($tRect, "Top", $iTop)
DllStructSetData($tRect, "Right", $iLeft + $iWidth)
DllStructSetData($tRect, "Bottom", $iTop + $iHeight)$aResult = DllCall($vDLL, "int", "PtInRect", "ptr", DllStructGetPtr($tRect), "int", $iX, "int", $iY)
[/autoit] [autoit][/autoit] [autoit]
If @error Then Return SetError(@error, 0, False)Return $aResult[0] <> 0
[/autoit] [autoit][/autoit] [autoit]
EndFunc ;==>_WinIsHoveredFunc _Exit()
[/autoit]
DllClose($hDLL) ; Dont forget to close your DLL-Handle
Exit
EndFunc ;==>_Exit
Ist die selbe falsche Darstellung. Meine Laptop hat die Auflösung 1920x1200 und mein 2.ter Monitor 1280x1024 => 1920x2224! Laptop unten, Monitor oben!
Display Array:
[0]: 0
[1]: -1024
[2]: 1920
[3]: 2224
Gruß,
UEZ
Nun ja für eine handvoll ist die Laufzeit -> O(n^2) ja noch akzeptable! Aber versuche es doch mal mit den 9999 Daten ![]()
Intern wird ja Quicksort benutzt, das im schlechtesten Fall auch quadratische Laufzeit hat, wenn man nicht irgendwelche Tricks benutzt!
Gruß,
UEZ
Wollte ich eigentlich auch, habe ich aber auf die schnelle nicht hinbekommen. Werde ich bei nächster Gelegenheit umsetzen.
Jetzt muss ich mir nur noch überlegen, wie ich das umsetzen kann / soll!?
Natürlich. Nimm dir was du brauchen kannst.
Hier mit dem Index:
[autoit]
Func _Array1DTo2D($a1D, $sDelim = ";", $iSeveral = 0)
;funkey 17.02.2010
Local $iUbound = UBound($a1D) - 1
Local $iTemp = 0, $iColumn = 0
For $i = 0 To $iUbound
If $iSeveral Then
$iTemp = UBound(StringRegExp($a1D[$i], $sDelim & "+", 3))
Else
$iTemp = UBound(StringSplit($a1D[$i], $sDelim, 3))
EndIf
If $iTemp > $iColumn Then $iColumn = $iTemp
Next
Local $a2D[UBound($a1D)][$iColumn + 2]
Local $aTemp
For $i = 0 To $iUbound
If $iSeveral Then
$aTemp = StringSplit(StringRegExpReplace($a1D[$i], $sDelim & "+", $sDelim), $sDelim, 3)
Else
$aTemp = StringSplit($a1D[$i], $sDelim, 3)
EndIf
For $j = 0 To UBound($aTemp) - 1
$a2D[$i][0] = $i
$a2D[$i][$j + 1] = $aTemp[$j]
Next
$a2D[0][0] = "Index"
Next
Return SetExtended($iColumn, $a2D)
EndFunc ;==>_Array1DTo2D
Für SIC2 wollte ich dein Tools komplett dazu tun (nicht in SIC2 integrieren), damit man die CSV's sich anschauen kann!
Mache mich gleich an die Farben...
Gruß,
UEZ
#include <Array.au3>
Global $hScreen = WinGetHandle("Program Manager")
Global $aScreen_Res = WinGetPos($hScreen)
#cs
$array[0] = X position
$array[1] = Y position
$array[2] = Width
$array[3] = Height
#ce
_ArrayDisplay($aScreen_Res)
Exit
Gruß,
UEZ
Vielen Dank für die Vorschläge. Habe weitere Verbesserungen eingebaut! Siehe Post#1
Update auf Version 0.4
--> Farbe für das Listview (zum selber auswählen)
--> Optionales OnTop-Fenster
--> Drag and drop von Dateien in das Listview
--> Resizing des Fensters
--> HTML-Export
Bei den Farben dachte ich eher daran, das z.B. ungerade Zeilen eine andere farben haben als gerade Zeilen (zur besseren Übersicht) wie in dem HTML Export!
Nette Idee mit dem HTML Export!
Ein fortlaufender Index ganz links wäre auch nicht schlecht!
Darf ich dein Tool mit in SIC2 packen? Passt nämlich wunderbar!
Gruß,
UEZ
Nette Idee, aber bei Multimonitoren funzt es nicht richtig!
Gruß,
UEZ