Also ich besitze diesen Bigtower "Cooler Master Cosmos".
Da sind 39 cm Platz bis zu den internen Laufwerken. Eine 30 cm Grafikkarte passt da also locker rein. Netzteil sitzt unten (sehr praktisch, besitzt einen eigenen Lufteinlass von unten).
Lässt sich sehr gut (leise) kühlen.
Mit der Befestigung des Prozessorkühlers ans Gehäuse kann ich Dir nicht weiterhelfen. Wie genau wird der denn dort befestigt?
Beiträge von Oscar
-
-
Warum speichert man etwas in einer Inidatei, wenn man dann die Ini-Funktionen (IniRead, IniWrite) nicht verwendet?
-
Hier die Funktion aus meinen Computer-Info:
Spoiler anzeigen
[autoit]
[/autoit] [autoit][/autoit] [autoit]
#include <Array.au3>
#include <WinAPIMisc.au3>$aDriveInfo = _CI_GetHarddrives()
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
_ArrayDisplay($aDriveInfo)Func _CI_GetHarddrives($strComputer = '.')
[/autoit]
Local $aReturn[1][7] = [[ _
'Bezeichnung:', 'Größe:', 'Anschluss:', 'Bytes/Sektor:', 'Anzahl der Sektoren:', _
'PNPDeviceID:', 'Status:']]
Local $x = 0, $objWMIService, $colItems
$objWMIService = ObjGet('winmgmts:\\' & $strComputer & '\root\cimv2')
If Not IsObj($objWMIService) Then Return SetError(1, 0, 0)
$colItems = $objWMIService.ExecQuery('SELECT * FROM Win32_DiskDrive', 'WQL', 0x30)
If IsObj($colItems) Then
For $objItem In $colItems
$x += 1
ReDim $aReturn[$x + 1][7]
$aReturn[$x][0] = $objItem.Model
$aReturn[$x][1] = _WinAPI_StrFormatByteSize($objItem.Size)
$aReturn[$x][2] = $objItem.InterfaceType
$aReturn[$x][3] = $objItem.BytesPerSector
$aReturn[$x][4] = $objItem.TotalSectors
$aReturn[$x][5] = $objItem.PNPDeviceID
$aReturn[$x][6] = $objItem.Status
Next
EndIf
Return $aReturn
EndFunc ;==>_CI_GetHarddrives -
Das bezeichnet man als Header. Und ja, den kann man auch ausblenden:
[autoit]
[/autoit]
#include <ListViewConstants.au3>
GUICreate('test', 400, 300)
$idListView = GUICtrlCreateListView('A|B|C', 10, 10, 380, 280, $LVS_NOCOLUMNHEADER)
GUICtrlCreateListViewItem('1|2|3', $idListView)
GUICtrlCreateListViewItem('4|5|6', $idListView)
GUISetState()
Do
Until GUIGetMsg() = -3 -
Versuch's mal mit Port "465" und SSL = "1"
GMX und Yahoo nehmen auf Port 25 keine EMails mehr an. Es muss SSL verschlüsselt sein. -
Du könntest von allen Images erstmal die kleinen Icons generieren lassen und diese abspeichern.
Das würde dann einmalig länger dauern, aber das anschließende einlesen geht sehr schnell.
Hier mal meine Variante:Spoiler anzeigen
[autoit]
[/autoit] [autoit][/autoit] [autoit]
#include <File.au3>
#include <FileConstants.au3>
#include <GDIPlus.au3>
#include <GuiImageList.au3>
#include <GuiListView.au3>
#include <WinAPI.au3>
#include <WinAPIGdi.au3>
#include <WinAPIRes.au3>
#include <WinAPISys.au3>$hForm = GUICreate('MyGUI', 400, 400)
[/autoit] [autoit][/autoit] [autoit]
$hListView = GUICtrlCreateListView('', 10, 10, 380, 380)
_GUICtrlListView_AddColumn($hListView, 'Items', 200)
$hImageList = _GUIImageList_Create(120, 90, 5, 1)
_GUICtrlListView_SetImageList($hListView, $hImageList, 1)
GUISetState()$sDir = 'c:\Users\Oscar\Downloads\img\' ; <- Pfad anpassen!
[/autoit] [autoit][/autoit] [autoit]
$aSize = _GUIImageList_GetIconSize($hImageList)ToolTip('Bitte warten!')
[/autoit] [autoit][/autoit] [autoit]
$iTimer = TimerInit()
_ImageFilesToIcons($sDir, '*.jpg', $aSize[0], $aSize[1]) ; <- mit dieser Funktion werden die Icons erstellt
ToolTip('')
MsgBox(0, 'Icons erstellt', 'Benötigte Zeit (s): ' & Round(TimerDiff($iTimer) / 1000, 3))$aFiles = _FileListToArray($sDir, '*.ico', $FLTA_FILES, False) ; <- alle Icondateien in das Array holen
[/autoit] [autoit][/autoit] [autoit]
$hIcon = 0
For $i = 1 To $aFiles[0]
$hIcon = _WinAPI_LoadIconWithScaleDown(0, $sDir & $aFiles[$i], $aSize[0], $aSize[1]) ; Icon laden
_GUIImageList_ReplaceIcon($hImageList, -1, $hIcon) ; in die ImageList einfügen
_WinAPI_DestroyIcon($hIcon) ; Icon zerstören und Speicher freigeben
_GUICtrlListView_AddItem($hListView, $aFiles[$i], $i - 1) ; ListView-Eintrag hinzufügen
NextDo
[/autoit] [autoit][/autoit] [autoit]
Until GUIGetMsg() = -3Func _ImageFilesToIcons($sFilePath, $sFilter = '*', $iWidth = 32, $iHeight = 32)
[/autoit]
Local $aFiles = _FileListToArray($sFilePath, $sFilter, $FLTA_FILES, True)
If @error Then Return SetError(1, 0, 0)
Local $hPic, $hBitmap, $hIcon
_GDIPlus_Startup()
For $i = 1 To $aFiles[0]
$hPic = _GDIPlus_ImageLoadFromFile($aFiles[$i])
If Not @error Then
$hBitmap = _GDIPlus_ImageResize($hPic, $iWidth, $iHeight)
$hIcon = _GDIPlus_HICONCreateFromBitmap($hBitmap)
_GDIPlus_ImageDispose($hPic)
_GDIPlus_BitmapDispose($hBitmap)
_WinAPI_SaveHICONToFile(StringRegExpReplace($aFiles[$i], '(.+\.).+', '$1') & 'ico', $hIcon)
_WinAPI_DestroyIcon($hIcon)
Else
ConsoleWrite('!> "' & $aFiles[$i] & '" konnte nicht geladen werden!' & @CR)
EndIf
Next
_GDIPlus_Shutdown()
EndFunc ;==>_ImageFilesToIcons -
Naja, das passiert, weil AutoIt die Prozentzahlen nicht als Zahlen behandelt, sondern als Strings (diese werden von links nach rechts in ihrer Wertigkeit sortiert).
Prog@ndy hat mal ein NaturalArraySort geschrieben. Wenn man das in die ListView-Sortierung einbaut, dann werden auch Prozentzahlen richtig sortiert:Spoiler anzeigen
[autoit]
[/autoit] [autoit][/autoit] [autoit]
#include <ListViewConstants.au3>
#include <GuiConstantsEx.au3>
#include <GuiListView.au3>GUICreate("ListView SimpleSort Natural", 400, 300)
[/autoit] [autoit][/autoit] [autoit]
$hListView = GUICtrlCreateListView("col1|col2|col3", 2, 2, 394, 268)
GUICtrlSendMsg($hListView, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_GRIDLINES, $LVS_EX_GRIDLINES)
GUICtrlSendMsg($hListView, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_FULLROWSELECT, $LVS_EX_FULLROWSELECT)
GUICtrlCreateListViewItem("line4|5%|more_a", $hListView)
GUICtrlCreateListViewItem("line5|75% |more_c", $hListView)
GUICtrlCreateListViewItem("line5|49% |more_c", $hListView)
GUICtrlCreateListViewItem("line3|23%|more_e", $hListView)
GUICtrlCreateListViewItem("line2|55% |more_d", $hListView)
GUICtrlCreateListViewItem("line1|60% |more_b", $hListView)
GUICtrlCreateListViewItem("line1|98% |more_b", $hListView)
GUICtrlCreateListViewItem("line1|3%|more_b", $hListView)
_GUICtrlListView_SetColumnWidth($hListView, 0, 75)
_GUICtrlListView_SetColumnWidth($hListView, 1, 75)
_GUICtrlListView_SetColumnWidth($hListView, 2, 75)
GUISetState()Global $B_DESCENDING[_GUICtrlListView_GetColumnCount($hListView)]
[/autoit] [autoit][/autoit] [autoit]
_GUICtrlListView_SimpleSortNatural($hListView, $B_DESCENDING, 1) ; 3ter Parameter ist Spalten-Index, NullbasiertDo
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
Until GUIGetMsg() = $GUI_EVENT_CLOSEFunc _GUICtrlListView_SimpleSortNatural($hWnd, ByRef $vSortSense, $iCol, $bToggleSense = True)
[/autoit] [autoit][/autoit] [autoit]
Local $iItemCount = _GUICtrlListView_GetItemCount($hWnd)
If $iItemCount Then
Local $iDescending = 0
If UBound($vSortSense) Then
$iDescending = $vSortSense[$iCol]
Else
$iDescending = $vSortSense
EndIf
Local $vSeparatorChar = Opt('GUIDataSeparatorChar')
Local $iColumnCount = _GUICtrlListView_GetColumnCount($hWnd)
Local Enum $iIndexValue = $iColumnCount, $iItemParam ; Additional columns for the index value and ItemParam
Local $aListViewItems[$iItemCount][$iColumnCount + 2]Local $aSelectedItems = StringSplit(_GUICtrlListView_GetSelectedIndices($hWnd), $vSeparatorChar)
[/autoit] [autoit][/autoit] [autoit]
Local $aCheckedItems = __GUICtrlListView_GetCheckedIndices($hWnd)
Local $sItemText, $iFocused = -1
For $i = 0 To $iItemCount - 1 ; Rows
If $iFocused = -1 Then
If _GUICtrlListView_GetItemFocused($hWnd, $i) Then $iFocused = $i
EndIf
_GUICtrlListView_SetItemSelected($hWnd, $i, False)
_GUICtrlListView_SetItemChecked($hWnd, $i, False)
For $j = 0 To $iColumnCount - 1 ; Columns
$sItemText = StringStripWS(_GUICtrlListView_GetItemText($hWnd, $i, $j), $STR_STRIPTRAILING)
If (StringIsFloat($sItemText) Or StringIsInt($sItemText)) Then
$aListViewItems[$i][$j] = Number($sItemText)
Else
$aListViewItems[$i][$j] = $sItemText
EndIf
Next
$aListViewItems[$i][$iIndexValue] = $i ; Index value
$aListViewItems[$i][$iItemParam] = _GUICtrlListView_GetItemParam($hWnd, $i) ; ItemParam
Next; Sort the ListView array
[/autoit] [autoit][/autoit] [autoit]
_ArrayNaturalSort($aListViewItems, $iDescending, 0, 0, $iCol)For $i = 0 To $iItemCount - 1 ; Rows
[/autoit] [autoit][/autoit] [autoit]
For $j = 0 To $iColumnCount - 1 ; Columns
_GUICtrlListView_SetItemText($hWnd, $i, $aListViewItems[$i][$j], $j)
Next_GUICtrlListView_SetItemParam($hWnd, $i, $aListViewItems[$i][$iItemParam]) ; ItemParam
[/autoit] [autoit][/autoit] [autoit]For $j = 1 To $aSelectedItems[0]
[/autoit] [autoit][/autoit] [autoit]
If $aListViewItems[$i][$iIndexValue] = $aSelectedItems[$j] Then
If $aListViewItems[$i][$iIndexValue] = $iFocused Then
_GUICtrlListView_SetItemSelected($hWnd, $i, True, True)
Else
_GUICtrlListView_SetItemSelected($hWnd, $i, True)
EndIf
ExitLoop
EndIf
Next
For $j = 1 To $aCheckedItems[0]
If $aListViewItems[$i][$iIndexValue] = $aCheckedItems[$j] Then
_GUICtrlListView_SetItemChecked($hWnd, $i, True)
ExitLoop
EndIf
Next
Next
If $bToggleSense Then ; Automatic sort sense toggle
If UBound($vSortSense) Then
$vSortSense[$iCol] = Not $iDescending
Else
$vSortSense = Not $iDescending
EndIf
EndIf
EndIf
EndFunc ;==>_GUICtrlListView_SimpleSortNatural; #FUNCTION# ;===============================================================================
[/autoit] [autoit][/autoit] [autoit]
;
; Name...........: _NaturalCompare
; Description ...: Compare two strings using Natural (Alphabetical) sorting.
; Syntax.........: _NaturalCompare($s1, $s2, $iCase = 0)
; Parameters ....: $s1, $s2 - Strings to compare
; $iCase - Case sensitive or insensitive comparison
; |0 - Case insensitive (default)
; |1 - Case sensitive
; Return values .: Success - One of the following:
; |0 - Strings are equal
; |-1 - $s1 comes before $s2
; |1 - $s1 goes after $s2
; Failure - Returns -2 and Sets @Error:
; |1 - $s1 or $s2 is not a string
; |2 - $iCase is invalid
; Author ........: Erik Pilsits
; Modified.......:
; Remarks .......: Original algorithm by Dave Koelle
; Related .......: StringCompare
; Link ..........: http://www.davekoelle.com/alphanum.html
; Example .......: Yes
;
; ;==========================================================================================
Func _NaturalCompare($s1, $s2, $iCase = 0)
If (Not IsString($s1)) Or (Not IsString($s2)) Then Return SetError(1, 0, -2)
If $iCase <> 0 And $iCase <> 1 Then Return SetError(2, 0, -2)Local $n = 0, $iLen = 1
[/autoit] [autoit][/autoit] [autoit]
Local $s1chunk, $s2chunkWhile $n == 0 ; get next chunk
[/autoit] [autoit][/autoit] [autoit]
; STRING 1
$iLen = 1
If StringIsDigit(StringLeft($s1, 1)) Then
; chunk of digits
For $i = 2 To StringLen($s1)
If StringIsDigit(StringMid($s1, $i, 1)) Then
$iLen += 1
Else
ExitLoop
EndIf
Next
Else
; chunk of letters
For $i = 2 To StringLen($s1)
If Not StringIsDigit(StringMid($s1, $i, 1)) Then
$iLen += 1
Else
ExitLoop
EndIf
Next
EndIf
$s1chunk = StringLeft($s1, $iLen); STRING 2
[/autoit] [autoit][/autoit] [autoit]
$iLen = 1
If StringIsDigit(StringLeft($s2, 1)) Then
; chunk of digits
For $i = 2 To StringLen($s2)
If StringIsDigit(StringMid($s2, $i, 1)) Then
$iLen += 1
Else
ExitLoop
EndIf
Next
Else
; chunk of letters
For $i = 2 To StringLen($s2)
If Not StringIsDigit(StringMid($s2, $i, 1)) Then
$iLen += 1
Else
ExitLoop
EndIf
Next
EndIf
$s2chunk = StringLeft($s2, $iLen); ran out of chunks, strings are the same, return 0
[/autoit] [autoit][/autoit] [autoit]
If $s1chunk == "" And $s2chunk == "" Then Return 0; remove chunks from strings
[/autoit] [autoit][/autoit] [autoit]
$s1 = StringMid($s1, StringLen($s1chunk) + 1)
$s2 = StringMid($s2, StringLen($s2chunk) + 1); Case 1: both chunks contain letters
[/autoit] [autoit][/autoit] [autoit]
If (Not StringIsDigit($s1chunk)) And (Not StringIsDigit($s2chunk)) Then
$n = StringCompare($s1chunk, $s2chunk, $iCase)
Else
; Case 2: both chunks contain numbers
If StringIsDigit($s1chunk) And StringIsDigit($s2chunk) Then
Local $i1chunk = Int($s1chunk)
Local $i2chunk = Int($s2chunk)
If $i1chunk > $i2chunk Then
Return 1
ElseIf $i1chunk < $i2chunk Then
Return -1
EndIf
Else
; Case 3: one chunk has letters, the other has numbers; or one is empty
; if we get here, this should be the last and deciding test, so return the result
Return StringCompare($s1chunk, $s2chunk, $iCase)
EndIf
EndIf
WEndReturn $n
[/autoit] [autoit][/autoit] [autoit]
EndFunc ;==>_NaturalCompare; #FUNCTION# ====================================================================================================================
[/autoit] [autoit][/autoit] [autoit]
; Name...........: _ArrayNaturalSort
; Description ...: Sort a 1D or 2D array on a specific index using the quicksort/insertionsort algorithms.
; Syntax.........: _ArrayNaturalSort(ByRef $avArray[, $iDescending = 0[, $iStart = 0[, $iEnd = 0[, $iSubItem = 0]]]])
; Parameters ....: $avArray - Array to sort
; $iDescending - [optional] If set to 1, sort descendingly
; $iStart - [optional] Index of array to start sorting at
; $iEnd - [optional] Index of array to stop sorting at
; $iSubItem - [optional] Sub-index to sort on in 2D arrays
; Return values .: Success - 1
; Failure - 0, sets @error:
; |1 - $avArray is not an array
; |2 - $iStart is greater than $iEnd
; |3 - $iSubItem is greater than subitem count
; |4 - $avArray has too many dimensions
; Author ........: Jos van der Zande <jdeb at autoitscript dot com>
; Modified.......: LazyCoder - added $iSubItem option, Tylo - implemented stable QuickSort algo, Jos van der Zande - changed logic to correctly Sort arrays with mixed Values and Strings, Ultima - major optimization, code cleanup, removed $i_Dim parameter
; Prog@ndy - natural sort
; Remarks .......:
; Related .......:
; Link ..........;
; Example .......; Yes
; ===============================================================================================================================
Func _ArrayNaturalSort(ByRef $avArray, $iDescending = 0, $iStart = 0, $iEnd = 0, $iSubItem = 0)
If Not IsArray($avArray) Then Return SetError(1, 0, 0)Local $iUBound = UBound($avArray) - 1
[/autoit] [autoit][/autoit] [autoit]; Bounds checking
[/autoit] [autoit][/autoit] [autoit]
If $iEnd < 1 Or $iEnd > $iUBound Then $iEnd = $iUBound
If $iStart < 0 Then $iStart = 0
If $iStart > $iEnd Then Return SetError(2, 0, 0); Sort
[/autoit] [autoit][/autoit] [autoit]
Switch UBound($avArray, 0)
Case 1
__ArrayNaturalQuickSort1D($avArray, $iStart, $iEnd)
If $iDescending Then _ArrayReverse($avArray, $iStart, $iEnd)
Case 2
Local $iSubMax = UBound($avArray, 2) - 1
If $iSubItem > $iSubMax Then Return SetError(3, 0, 0)If $iDescending Then
[/autoit] [autoit][/autoit] [autoit]
$iDescending = -1
Else
$iDescending = 1
EndIf__ArrayNaturalQuickSort2D($avArray, $iDescending, $iStart, $iEnd, $iSubItem, $iSubMax)
[/autoit] [autoit][/autoit] [autoit]
Case Else
Return SetError(4, 0, 0)
EndSwitchReturn 1
[/autoit] [autoit][/autoit] [autoit]
EndFunc ;==>_ArrayNaturalSort; #INTERNAL_USE_ONLY#============================================================================================================
[/autoit] [autoit][/autoit] [autoit]
; Name...........: __ArrayNaturalQuickSort1D
; Description ...: Helper function for sorting 1D arrays
; Syntax.........: __ArrayNaturalQuickSort1D(ByRef $avArray, ByRef $iStart, ByRef $iEnd)
; Parameters ....: $avArray - Array to sort
; $iStart - Index of array to start sorting at
; $iEnd - Index of array to stop sorting at
; Return values .: None
; Author ........: Jos van der Zande, LazyCoder, Tylo, Ultima
; Modified.......: Prog@ndy - natural sort
; Remarks .......: For Internal Use Only
; Related .......:
; Link ..........;
; Example .......;
; ===============================================================================================================================
Func __ArrayNaturalQuickSort1D(ByRef $avArray, ByRef $iStart, ByRef $iEnd)
If $iEnd <= $iStart Then ReturnLocal $vTmp
[/autoit] [autoit][/autoit] [autoit]; InsertionSort (faster for smaller segments)
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
If ($iEnd - $iStart) < 15 Then
Local $i, $j, $vCur
For $i = $iStart + 1 To $iEnd
$vTmp = $avArray[$i]For $j = $i - 1 To $iStart Step -1
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
If (_NaturalCompare($vTmp, $avArray[$j], 1) >= 0) Then ExitLoop
$avArray[$j + 1] = $avArray[$j]
Next$avArray[$j + 1] = $vTmp
[/autoit] [autoit][/autoit] [autoit]
Next
Return
EndIf; QuickSort
[/autoit] [autoit][/autoit] [autoit]
Local $L = $iStart, $R = $iEnd, $vPivot = $avArray[Int(($iStart + $iEnd) / 2)]
Do
While (_NaturalCompare($avArray[$L], $vPivot, 1) < 0)
$L += 1
WEnd
While (_NaturalCompare($avArray[$R], $vPivot, 1) > 0)
$R -= 1
WEnd; Swap
[/autoit] [autoit][/autoit] [autoit]
If $L <= $R Then
$vTmp = $avArray[$L]
$avArray[$L] = $avArray[$R]
$avArray[$R] = $vTmp
$L += 1
$R -= 1
EndIf
Until $L > $R__ArrayNaturalQuickSort1D($avArray, $iStart, $R)
[/autoit] [autoit][/autoit] [autoit]
__ArrayNaturalQuickSort1D($avArray, $L, $iEnd)
EndFunc ;==>__ArrayNaturalQuickSort1D; #INTERNAL_USE_ONLY#============================================================================================================
[/autoit] [autoit][/autoit] [autoit]
; Name...........: __ArrayNaturalQuickSort2D
; Description ...: Helper function for sorting 2D arrays
; Syntax.........: __ArrayNaturalQuickSort2D(ByRef $avArray, ByRef $iStep, ByRef $iStart, ByRef $iEnd, ByRef $iSubItem, ByRef $iSubMax)
; Parameters ....: $avArray - Array to sort
; $iStep - Step size (should be 1 to sort ascending, -1 to sort descending!)
; $iStart - Index of array to start sorting at
; $iEnd - Index of array to stop sorting at
; $iSubItem - Sub-index to sort on in 2D arrays
; $iSubMax - Maximum sub-index that array has
; Return values .: None
; Author ........: Jos van der Zande, LazyCoder, Tylo, Ultima
; Modified.......: Prog@ndy - natural sort
; Remarks .......: For Internal Use Only
; Related .......:
; Link ..........;
; Example .......;
; ===============================================================================================================================
Func __ArrayNaturalQuickSort2D(ByRef $avArray, ByRef $iStep, ByRef $iStart, ByRef $iEnd, ByRef $iSubItem, ByRef $iSubMax)
If $iEnd <= $iStart Then Return; QuickSort
[/autoit] [autoit][/autoit] [autoit]
Local $i, $vTmp, $L = $iStart, $R = $iEnd, $vPivot = $avArray[Int(($iStart + $iEnd) / 2)][$iSubItem]
DoWhile ($iStep * _NaturalCompare($avArray[$L][$iSubItem], $vPivot, 1) < 0)
[/autoit] [autoit][/autoit] [autoit]
$L += 1
WEnd
While ($iStep * _NaturalCompare($avArray[$R][$iSubItem], $vPivot, 1) > 0)
$R -= 1
WEnd; Swap
[/autoit] [autoit][/autoit] [autoit]
If $L <= $R Then
For $i = 0 To $iSubMax
$vTmp = $avArray[$L][$i]
$avArray[$L][$i] = $avArray[$R][$i]
$avArray[$R][$i] = $vTmp
Next
$L += 1
$R -= 1
EndIf
Until $L > $R__ArrayNaturalQuickSort2D($avArray, $iStep, $iStart, $R, $iSubItem, $iSubMax)
[/autoit]
__ArrayNaturalQuickSort2D($avArray, $iStep, $L, $iEnd, $iSubItem, $iSubMax)
EndFunc ;==>__ArrayNaturalQuickSort2D -
Das ist ein Bug!
Von MicroSoft gibt es einen HotFix: http://support.microsoft.com/kb/978155 -
Auch bei Deinem Beispiel finde ich die Switch-Variante übersichtlicher:
Spoiler anzeigen
[autoit]
[/autoit] [autoit][/autoit] [autoit]
#AutoIt3Wrapper_Au3Check_Parameters=-q -d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7
_main()
Func _main()
Local $input, $nMsg, $result, $aBtn[20]
Local $aBtnLbl[20] = ["7", "8", "9", " / ", "4", "5", "6", " * ", "1", "2", "3", " - ", ".", "0", "^", " + ", "(", ")", "Clear", "="]
GUICreate("Mod-TRechner-Tut", 235, 325)
$input = GUICtrlCreateInput("", 10, 10, 215, 30, BitOR(0x0800, 0x0002)) ; $ES_READONLY $ES_RIGHT
For $k = 0 To 19
$aBtn[$k] = GUICtrlCreateButton($aBtnLbl[$k], 10 + Mod($k, 4) * 55, 50 + Int($k / 4) * 55, 50, 50)
NextGUISetState(@SW_SHOW)
[/autoit] [autoit][/autoit] [autoit]Do
[/autoit]
$nMsg = GUIGetMsg()
Switch $nMsg
Case $aBtn[0] To $aBtn[17]
GUICtrlSetData($input, GUICtrlRead($input) & $aBtnLbl[$nMsg - $aBtn[0]])
Case $aBtn[19]
$result = Execute(StringRegExpReplace(GUICtrlRead($input), '[^\.\(\)\*\/\-\+\d]', ''))
If $result == "1.#INF" Or $result == "-1.#IND" Then $result = "Error"
GUICtrlSetData($input, $result)
Case $aBtn[18]
GUICtrlSetData($input, "")
EndSwitch
Until $nMsg = -3
EndFunc ;==>_main
; Ende -
Für die MessageLoop-Schleife könntest Du mit Switch arbeiten:
Spoiler anzeigen
[autoit]
[/autoit]
While 1
$msg = GUIGetMsg()
Switch $msg
Case $array[8] To $array[80]
GUICtrlSetBkColor($array, $COLOR_BLACK)
EndSwitch
WEnd -
Ich dachte mir, die Funktion kann man doch auch etwas internationaler gestalten und da ich das ja schonmal gemacht habe (_DateDayOfWeekML),
habe ich Deine Funktion diesbezüglich noch ein wenig verändert:Spoiler anzeigen
[autoit]
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
ConsoleWrite('Italian: ' & _DateTimeUser('ww DD.MM.YYYY hh:mm:ss', '', '', 2014, 1, 1, 0, 0, 0, "0410") & @CR)
ConsoleWrite('German: ' & _DateTimeUser('ww DD.MM.YYYY hh:mm:ss', '', '', 2014, 1, 1, 0, 0, 0, "0407") & @CR)
ConsoleWrite('English: ' & _DateTimeUser('ww DD.MM.YYYY hh:mm:ss', '', '', 2014, 1, 1, 0, 0, 0, "0409") & @CR)
ConsoleWrite('French: ' & _DateTimeUser('ww DD.MM.YYYY hh:mm:ss', '', '', 2014, 1, 1, 0, 0, 0, "040c") & @CR)
ConsoleWrite('Norwegian: ' & _DateTimeUser('ww DD.MM.YYYY hh:mm:ss', '', '', 2014, 1, 1, 0, 0, 0, "0414") & @CR);===============================================================================
[/autoit]
; Function Name....: _DateTimeUser
; Description......: Nutzergesteuerte Datum- und/oder Zeitausgabe
; Parameter(s).....: $_time_format Nutzerdefiniertes Ausgabeformat
; .................: Makros YYYY / YY - Jahr 4/2 -stellig
; .................: MM / M - Monat 2/1 -stellig
; .................: DD / D - Tag 2/1 -stellig
; .................: hh / h - Stunde 2/1 -stellig
; .................: mm / m - Minute 2/1 -stellig
; .................: ss / s - Sekunde 2/1 -stellig
; .................: ww / w - Wochentag lang/kurz (Montag/Mo)
; .................: Bsp. "YYYY-MM-DD", "YYYYMMDD", "D.M.YY", "DD.MM.YYYY hh:mm:ss" (Standard)
; .................: "ww, DD.MM.YYYY"
; .................: Auch einzelne Werte und beliebige Kombinationen können abgefragt werden. "DD-hh-mm"
; ....[optional]...: $_pre vorangestellter String
; ....[optional]...: $_post nachgestellter String
; Return Value(s)..: Der formatierte Datum/Zeitstring für das heutige Datum
; Author(s)........: BugFix ( [email='bugfix@autoit.de'][/email] )
;===============================================================================
Func _DateTimeUser($_time_format = '', $_pre = '', $_post = '', $iYear = @YEAR, $iMon = @MON, $iDay = @MDAY, $iHour = @HOUR, $iMin = @MIN, $iSec = @SEC, $sLang = @OSLang)
$_time_format = ($_time_format = '') ? 'DD.MM.YYYY hh:mm:ss' : $_time_format
Local $aTime[10][2] = [['MM', $iMon], ['DD', $iDay], ['hh', $iHour], ['mm', $iMin], ['ss', $iSec], _
['M', $iMon], ['D', $iDay], ['h', $iHour], ['m', $iMin], ['s', $iSec]]
StringReplace($_time_format, 'Y', 'Y')
Local $sYear = StringLeft('YYYY', @extended), $output = $_time_format
Local $srepl = (StringLen($sYear) < 4) ? StringRight($iYear, 2) : $iYear
If $sYear <> '' Then _
$output = StringReplace($_time_format, $sYear, $srepl)
Local $sformat
For $i = 0 To 9
$sformat = '%0' & StringLen($aTime[$i][0]) & 'd'
$output = StringReplace($output, $aTime[$i][0], StringFormat($sformat, $aTime[$i][1]), 1, 1)
Next
If StringInStr($output, 'w') Then
Local $sDayFormat = StringInStr($_time_format, 'ww') ? 'dddd' : 'ddd'
Local $tDATE = DllStructCreate('word Year;word Month;word Dow;word Day;word Hour;word Minute;word Second;word MSeconds')
DllStructSetData($tDATE, 'Year', $iYear)
DllStructSetData($tDATE, 'Month', $iMon)
DllStructSetData($tDATE, 'Day', $iDay)
Local $Ret = DllCall('kernel32.dll', 'int', 'GetDateFormatW', 'ulong', Dec($sLang), 'dword', 0, 'ptr', DllStructGetPtr($tDATE), 'wstr', $sDayFormat, 'wstr', '', 'int', 2048)
If @error Or Not $Ret[0] Then Return SetError(1, 0, '')
Local $sWDay = $Ret[5]
$output = StringReplace($output, 'ww', $sWDay, 1, 1)
If Not @extended Then $output = StringReplace($output, 'w', $sWDay, 1, 1)
EndIf
Return $_pre & $output & $_post
EndFunc ;==>_DateTimeUser -
Bei GUISetIcon kannst Du als zweiten Parameter die Icon-ID angeben. Damit wählst Du (bei mehreren Icons) das entsprechende Icon aus.
-
Äh...dafür gibt es doch:
[autoit]Opt('WinTitleMatchMode', 2)
[/autoit] -
Eine schöne Funktion, aber ich würde die Makros nur optional verwenden. Den Aufruf lieber auch mit beliebigen Daten zulassen.
Also so:Spoiler anzeigen
[autoit]
[/autoit] [autoit][/autoit] [autoit]
ConsoleWrite(_DateTimeUser('ww DD.MM.YYYY hh:mm:ss', '', '', 2014, 1, 1, 0, 0, 0) & @CR);===============================================================================
[/autoit]
; Function Name....: _DateTimeUser
; Description......: Nutzergesteuerte Datum- und/oder Zeitausgabe
; Parameter(s).....: $_time_format Nutzerdefiniertes Ausgabeformat
; .................: Makros YYYY / YY - Jahr 4/2 -stellig
; .................: MM / M - Monat 2/1 -stellig
; .................: DD / D - Tag 2/1 -stellig
; .................: hh / h - Stunde 2/1 -stellig
; .................: mm / m - Minute 2/1 -stellig
; .................: ss / s - Sekunde 2/1 -stellig
; .................: ww / w - Wochentag lang/kurz (Montag/Mo)
; .................: Bsp. "YYYY-MM-DD", "YYYYMMDD", "D.M.YY", "DD.MM.YYYY hh:mm:ss" (Standard)
; .................: "ww, DD.MM.YYYY"
; .................: Auch einzelne Werte und beliebige Kombinationen können abgefragt werden. "DD-hh-mm"
; ....[optional]...: $_pre vorangestellter String
; ....[optional]...: $_post nachgestellter String
; Return Value(s)..: Der formatierte Datum/Zeitstring für das heutige Datum
; Author(s)........: BugFix ( [email='bugfix@autoit.de'][/email] )
;===============================================================================
Func _DateTimeUser($_time_format='', $_pre='', $_post='', $iYear = @YEAR, $iMon = @MON, $iDay = @MDAY, $iHour = @HOUR, $iMin = @MIN, $iSec = @SEC)
$_time_format = ($_time_format = '') ? 'DD.MM.YYYY hh:mm:ss' : $_time_format
Local $aTime[10][2] = [['MM', $iMon], ['DD', $iDay], ['hh', $iHour], ['mm', $iMin], ['ss', $iSec], _
['M', $iMon], ['D', $iDay], ['h', $iHour], ['m', $iMin], ['s', $iSec]]
StringReplace($_time_format, 'Y', 'Y')
Local $sYear = StringLeft('YYYY', @extended), $output = $_time_format
Local $srepl = (StringLen($sYear) < 4) ? StringRight($iYear, 2) : $iYear
If $sYear <> '' Then _
$output = StringReplace($_time_format, $sYear, $srepl)
Local $sformat
For $i = 0 To 9
$sformat = '%0' & StringLen($aTime[$i][0]) & 'd'
$output = StringReplace($output, $aTime[$i][0], StringFormat($sformat, $aTime[$i][1]), 1, 1)
Next
If StringInStr($output, 'w') Then
Local $YY = StringRight($iYear, 2), $aMonval[13] = ['',0,3,3,6,1,4,6,2,5,0,3,5], $iDiff
Local $Y_val = Mod(($YY + Int($YY/4)), 7), $M_val = $aMonval[$iMon], $D_val = $iDay
Local $aY_val[7][2] = [[2300,0],[2200,2],[2100,4],[2000,6],[1900,0],[1800,2],[1700,4]]
For $i = 0 To 6
If $iYear >= $aY_val[$i][0] Then
$iDiff = $aY_val[$i][1]
ExitLoop
EndIf
Next
If ((Mod($iYear,400)=0)?1:(Mod($iYear,100)=0)?0:(Mod($iYear,4)=0)?1:0) Then $iDiff -= 1
Local $aWDay[7][2] = [['Sonntag','So'],['Montag','Mo'],['Dienstag','Di'],['Mittwoch','Mi'], _
['Donnerstag','Do'],['Freitag','Fr'],['Samstag','Sa']]
Local $w = Mod($Y_val + $M_val + $D_val + $iDiff, 7)
$output = StringReplace($output, 'ww', $aWDay[$w][0], 1, 1)
If Not @extended Then $output = StringReplace($output, 'w', $aWDay[$w][1], 1, 1)
EndIf
Return $_pre & $output & $_post
EndFunc ;==>_DateTimeUser
[autoit]
Die Zeile 51 habe ich noch umIf Not @extended Then
[/autoit]
ergänzt, weil sonst beim Mittwoch das "w" nochmal durch "Mi" ersetzt wird. -
[verschoben nach "Andere Programmiersprachen"]
-
-
Ich habe das Beispiel-Script noch etwas erweitert und eine Beispiel-Datenbank erstellt.
Siehe Post#1. -
Für die Textausgabe gibt es mehrere Möglichkeiten:
- Label
- Edit
- ListBox
- ListView
- RichEdit
- embedded IE -
Von mir auch noch eine kurze Anmerkung. Das hier:
[autoit]
[/autoit]
for $t=1 to 400
$line = FileReadLine($file,$t)
ist ungünstig, weil es bei großen Dateien sehr lange dauert (es wird jedes Mal vom Anfang der Datei gelesen).
Wenn Du sowieso die ganze Datei zeilenweise abarbeiten willst, dann lasse den Line-Parameter ($t) bei FileReadLine weg.Siehe hierzu auch die Hilfe:
ZitatFrom a performance standpoint it is a bad idea to read line by line specifying "line" parameter whose value is incrementing by one. This forces AutoIt to reread the file from the beginning until it reach the specified line.
-
Wo ist das lauffähige Beispielscript?
Es kommt natürlich darauf an, wo Du die Grafik einbaust.
Wenn sie nur auf einem bestimmten Tab auftauchen soll, dann musst Du sie auch dort erstellen. -
Bei ID und Buttons denke ich immer zuerst an eine AutoIt-GUI.
Jetzt kommst Du mit einer Webseite, schreibst aber wieder nicht um welche Seite es sich handelt.
Wo ist der HTML-Quelltext?
Ein bißchen mehr Informationen und das Problem wäre wohl längst abgehakt.