Hallo liebe AutoIt Com
Mal wieder hab ich was kleines gebastelt, ob es nützlich ist, naja, für den einen vll schon, für den anderen wohl eher nicht
Was dass Info Toll kann / macht:
- (Group: Maus / Cursor) - Gibt die x-y Pos des Cursors aus.
- (Group: Cliboard) - Zeigt was in deiner Zwischenablage ist.
- Clipboard Gui: Inerhalb dieser Gui kann man den inhalt der Zwischenablage Editieren (Nicht vergessen Ctrl+v oder "Copy to Clipboard" zu machen) und man kann url's zu Verlinkten Namen für die SB bereitstellen
- Die Hardware Group:
Hardware Group Elemente
3a: Physikalischer RAM
3a1: Eine Progressbar welche die Physikalische RAM angibt die in gebrauch ist.
3a2: Ein Label welches die RAM die gerade in gebrauch ist und die Gesamte Physische RAM angibt. (in GB)
3b: Auslagerungs Datei
3b1: Eine Progressbar welche die Auslagerungs Datei angibt die in gebrauch ist.
3b2: Ein Label welches die Auslagerungs Datei die in gebrauch ist und die Gesamt Grösse der Auslagerungs Datei angibt. (in GB)
3c: Virtueller RAM
3c1: Eine Prograssbar welche die Virtuelle RAM angibt die in gebrauch ist.
3c2: Ein Label welches die Vituelle RAM die in gebrauch ist und die Gesamte Virtuelle RAM angibt. (in GB)
3d: CPU Auslastung (Gesamt)
3d1: Eine Progressbar welche die Gesamte CPU auslasstung wiedergibt
3d2: Ein Label welches die Gesamt CPU auslastung in % angibt.
3e: Die auslastung der einzelnen CPU Kerne
3e1: Progressbar die die Auslastung der einzelnen CPU Kern auslastung wiedergibt.
3e2: Label mit % angaben der einzelnen CPU Kern auslastung in %.
(Dies ist aufgrund der auslessung NICHT genau zu 100% richtig,abweichung etwa bei 2-3% (Bei Dual-Core))
*Note*
Ich kann nicht zu 100% Garantieren dass die CPU Kern auflistung (Core0 bis Core3 (Quad-Core)) richtig erfolgt. Da ich selbst nur Besitzer eines Dual-Core's bin, deswegen hoffe ich auf Rückmeldung (Mit evt Screen) ob bei Tri-Core / Quad-Core / Hexa-Core & Octa-Core die ausgabe Richtig erfolg, sprich, ob alle Kerne angegeben werden und auch "Funktionieren".
Some Screen Maybe?
[Blockierte Grafik: https://dl.dropbox.com/u/49201990/Aut…Info%20Tool.jpg]
Und hier der Code, nichts besonderes :3
Info Tool.au3
#cs ----------------------------------------------------------------------------
AutoIt Version: 3.3.8.1
Author: Skilkor (Pascal Vollenweider)
Script Function:
Einfaches Info Tool :3
#ce ----------------------------------------------------------------------------
#region ### #include ###
#include <GUIConstantsEx.au3>
#include <Constants.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>
#include <Array.au3>
#include <Misc.au3>
#include 'usage.au3' ;Danke an Bitboy für die 'usage.au3'UDF
#include '_GetGlobalResolution.au3' ;Dank an Oscar
#endregion ### #include ###
;==========
#region ### Global ###
Global $hGui, $eGui
;~
Global $WGP = WinGetPos($hGui)
;~
Global $dll = DllOpen("user32.dll")
;~
Global $aRes = _GetGlobalResolution()
Global $CPU = _GetCPUUsage()
Global $RAM = MemGetStats()
;~
Global $CPU[3] = [2, 1, 1]
;~
Global $width = 400
Global $heigth = 250 + $CPU[0] * 20
Global $left = @DesktopWidth / 2 - 215
Global $top = @DesktopHeight / 2 - 120
;~
Global $Hware_Group_heigth = 105 + $CPU[0] * 20
;~
Global $Cleft = 15
Global $Ctop[8] = [235, 255, 275, 295, 315, 335, 355, 375]
Global $Cwidth = 215
Global $Cheight = 20
;~
Global $CoreProgress[8] = ['1', '2', '3', '4', '5', '6', '7', '8']
Global $CoreProz[8] = ['1', '2', '3', '4', '5', '6', '7', '8']
Global $CPleft = 135
Global $CPwidth = 140
;~
Global $CLleft = 285
Global $CLwidth = 100
;~
Global $eGui_Style = BitOR($WS_SYSMENU, $WS_POPUP, $WS_POPUPWINDOW, $WS_BORDER)
Global $eGui_ExStyle = $WS_EX_WINDOWEDGE
Global $Label_Style = $SS_CENTER
Global $Label_ExStyle = $SS_BLACKFRAME
;~
Global $AdLibFunk[8] = ['_ClipGet', '_Cursor', '_WinPos', '_While', '_Core', '_MemUsedRead','_SB','_Pressed']
Global $Pressed[2] = ['7A','7B']
Global $aFunktions[2] = ['_Free', '_Trap']
#endregion ### Global ###
;==========
#region ### hGui ###
$hGui = GUICreate('Info Tool', $width, $heigth, $left, $top)
#region ### Maus / Cursor Group ###
GUICtrlCreateGroup('Maus / Cursor', 5, 5, 170, 125)
$x = GUICtrlCreateLabel('0', 15, 20, 150, 20, $Label_Style, $Label_ExStyle)
$y = GUICtrlCreateLabel('0', 15, 40, 150, 20, $Label_Style, $Label_ExStyle)
GUICtrlCreateLabel('Cursor Trapen = F12', 15, 80, 150, 20, $Label_Style, $Label_ExStyle)
GUICtrlCreateLabel('Cursor Loslassen = F11', 15, 100, 150, 20, $Label_Style, $Label_ExStyle)
#endregion ### Maus / Cursor Group ###
;~
#region ### Clibboard Group ###
GUICtrlCreateGroup('Clipboard', 175, 5, 220, 125)
$Clipboard = GUICtrlCreateLabel('', 185, 20, 200, 80, '', $Label_ExStyle)
$Show_All_Clipbiard = GUICtrlCreateLabel('Zeige ganzes Clipboard', 185, 100, 200, 20, $Label_Style, $Label_ExStyle)
#endregion ### Clibboard Group ###
;~
#region ### Hardware Group ###
GUICtrlCreateGroup('Hardware', 5, 140, 390, $Hware_Group_heigth)
GUICtrlCreateLabel('Physikalischer RAM', 15, 155, 120, 20, $Label_Style, $Label_ExStyle)
GUICtrlCreateLabel('Auslagerungs Datei', 15, 175, 120, 20, $Label_Style, $Label_ExStyle)
GUICtrlCreateLabel('Virtueler RAM', 15, 195, 120, 20, $Label_Style, $Label_ExStyle)
GUICtrlCreateLabel('CPU Auslastung', 15, 215, 120, 20, $Label_Style, $Label_ExStyle)
;~
$UsePhysRAMProgress = GUICtrlCreateProgress(135, 155, 150, 20)
$UsePhysRAM = GUICtrlCreateLabel('', 285, 155, 100, 20, $Label_Style, $Label_ExStyle)
;~
$Used_PageFile_Progress = GUICtrlCreateProgress(135, 175, 150, 20)
$Used_PageFile = GUICtrlCreateLabel('', 285, 175, 100, 20, $Label_Style, $Label_ExStyle)
;~
$Used_Virtual_RAM_Progress = GUICtrlCreateProgress(135, 195, 150, 20)
$Used_Virtual_RAM = GUICtrlCreateLabel('', 285, 195, 100, 20, $Label_Style, $Label_ExStyle)
;~
$CPU_Ges_Progress = GUICtrlCreateProgress(135, 215, 150, 20)
$CPU_Ges = GUICtrlCreateLabel('', 285, 215, 100, 20, $Label_Style, $Label_ExStyle)
;~
For $i = 0 To $CPU[0] - 1
GUICtrlCreateLabel('Core ' & $i, 15, $Ctop[$i], 120, 20, $Label_Style, $Label_ExStyle)
$CoreProgress[$i] = GUICtrlCreateProgress(135, $Ctop[$i], 150, 20)
$CoreProz[$i] = GUICtrlCreateLabel('', 285, $Ctop[$i], 100, 20, $Label_Style, $Label_ExStyle)
Next
;~
#endregion ### Hardware Group ###
;~
#region ### eGui ###
$eGui = GUICreate('', 400, 255, $left, $top - 4, $eGui_Style, $eGui_ExStyle)
$Edit = GUICtrlCreateEdit(ClipGet(), 0, 0, 400, 200)
;~
GUICtrlCreateGroup('', 10, 205, 375, 45)
$Back = GUICtrlCreateLabel('Close', 20, 220, 100, 20, $Label_Style, $Label_ExStyle)
$Copy_Cliboard = GUICtrlCreateLabel('Copy to Cliboard', 145, 220, 100, 20, $Label_Style, $Label_ExStyle)
$SB_Link = GUICtrlCreateLabel('SB URL Kürzung', 265, 220, 100, 20, $SS_CENTER, $SS_BLACKFRAME)
#endregion ### eGui ###
;~
#endregion ### hGui ###
GUISetState(@SW_HIDE, $eGui)
GUISetState(@SW_SHOW, $hGui)
#endregion ### #include ###
For $i = 0 To UBound($AdLibFunk) - 1
AdlibRegister($AdLibFunk[$i])
Next
While 1
$nMsg = GUIGetMsg($hGui)
Switch $nMsg
Case $GUI_EVENT_CLOSE
DllClose($dll)
Exit
Case $Back
GUISetState(@SW_HIDE, $eGui)
Case $Show_All_Clipbiard
GUISetState(@SW_SHOW, $eGui)
Case $Copy_Cliboard
ClipPut(GUICtrlRead($Edit))
Case $SB_Link
_SB_Link()
EndSwitch
WEnd
#region ### _While() ###
Func _While()
While 1
$WGP = WinGetPos($hGui)
$RAM = MemGetStats()
$CPU = _GetCPUUsage()
ExitLoop
WEnd
EndFunc ;==>_While
#endregion ### _While() ###
;==========
#region ### _Pressed() ###
Func _Pressed()
For $i = 0 To 1
If BitAND(_IsPressed($Pressed[$i], $dll), $GUI_CHECKED) Then Call($aFunktions[$i])
Next
EndFunc ;==>_Pressed
#endregion ### _Pressed() ###
;==========
#region ### _Trap() ###
Func _Trap()
_MouseTrap(MouseGetPos(0), MouseGetPos(1), MouseGetPos(0) + 1, MouseGetPos(1) + 1) ;Fange Maus auf den Coord X & Y auf $Label_x / $Label_y und $Label_x +1(Pixel) / $Label_y +1(Pixel)
EndFunc ;==>_Trap
#endregion ### _Trap() ###
;==========
#region ### _Free() ###
Func _Free()
_MouseTrap()
MouseClick('Left')
EndFunc ;==>_Free
#endregion ### _Free() ###
;==========
#region ### _Cursor() ###
Func _Cursor()
GUICtrlSetData($x, 'Cursor Pos x: ' & MouseGetPos(0) & ' (Breite)') ;Gibt alle 0,05Secunden die X Possition vom Curser auf $x über
GUICtrlSetData($y, 'Cursor Pos y: ' & MouseGetPos(1) & ' (Höhe)') ;Gibt alle 0,05Secunden die Y Possition vom Curser auf $y über
EndFunc ;==>_Cursor
#endregion ### _Cursor() ###
;==========
#region ### _WinPos() ### ;Diese Function Lagt leider einwenig wenn sie nach Links von der $hGui Possitioniert wird...Ja Child hätts genauso getan, aber Child und ich sind keine guten Freunde
Func _WinPos()
Local $p = WinGetPos($hGui) ;Ermitelt die x-y Possition von $hGui
If $p[1] <> $WGP[0] Then ;Wenn zwischen der Localen Pos Y von $hGui und der Neuen Pos Y von $hGui ein Unterschied besteht dann
WinMove($eGui, '', $WGP[0] + 412, $WGP[1] - 4) ;erschiebt $eGui nach Rechts von $hGui
EndIf
If $p[0] >= $aRes[2] - 800 And $p[0] <= $aRes[2] Then ;Wenn zuwenig Pixel Zwischen $hGui und der Definitiven Desktop Breite besteht
WinMove($eGui, '', $WGP[0] - 412, $WGP[1] - 4) ;Verschiebt $eGui nach Links von $hGui
EndIf
EndFunc ;==>_WinPos
#endregion ### _WinPos() ###
;==========
#region ### _ClipGet() ###
Func _ClipGet()
Local $Get = ClipGet() ;gibt den Inhalt der Zwischenablage wieder
If $Get <> GUICtrlRead($Clipboard) Then ;Wenn zwischen der Zwischenablage und dem Label $Clipboard ein unterschied besteht, dann
GUICtrlSetData($Clipboard, $Get) ;Ersetze Alten inhalt des Label's $Clipboard mit Neuem Inhalt der Zwischenablage
GUICtrlSetData($Edit, $Get)
EndIf
EndFunc ;==>_ClipGet
#endregion ### _ClipGet() ###
;==========
#region ### _SB_Link() ###
Func _SB_Link()
Local $url = ClipGet()
Local $l_String = StringLen($url)
Local $s_String = StringTrimRight($url,$l_String-7)
If $s_String = 'http://' Or $s_String = 'https:/' Then
$name = InputBox('Name wählen', 'Wählen sie einen Namen', 'Hier', ' M10', 100, 125)
If @error Then
$msg = MsgBox(4 + 48 ,'InputBox Error','InputBox ist Leer' & @CRLF & 'Neuer Versuch?')
If $msg = 6 Then
_SB_Link()
Else
Return
EndIf
EndIf
ClipPut("" & $name & "")
Else
MsgBox(48, 'ClipGet', 'Enthält keine URL')
EndIf
EndFunc
#endregion ### _SB_Link() ###
;==========
#region ### _Core() ###
Func _Core()
If $CPU[0] = 1 Then
GUICtrlSetData($CoreProgress[0], $CPU[1])
GUICtrlSetData($CoreProz[0], $CPU[1] & ' %')
;~
GUICtrlSetData($CPU_Ges_Progress, $CPU[1])
ElseIf $CPU[0] = 2 Then
$Dual_Core = Floor($CPU[1] + $CPU[2] / 2)
;~
GUICtrlSetData($CoreProgress[0], $CPU[1])
GUICtrlSetData($CoreProz[0], $CPU[1] & ' %')
GUICtrlSetData($CoreProgress[1], $CPU[2])
GUICtrlSetData($CoreProz[1], $CPU[2] & ' %')
;~
GUICtrlSetData($CPU_Ges_Progress, $Dual_Core)
GUICtrlSetData($CPU_Ges, $Dual_Core & ' %')
ElseIf $CPU[0] = 3 Then
$Tri_Core = Floor($CPU[1] + $CPU[2] + $CPU[3] / 3)
;~
GUICtrlSetData($CoreProgress[0], $CPU[1])
GUICtrlSetData($CoreProz[0], $CPU[1] & ' %')
GUICtrlSetData($CoreProgress[1], $CPU[2])
GUICtrlSetData($CoreProz[1], $CPU[2] & ' %')
;~
GUICtrlSetData($CoreProgress[2], $CPU[3])
GUICtrlSetData($CoreProz[2], $CPU[3] & ' %')
;~
GUICtrlSetData($CPU_Ges_Progress, $Tri_Core)
GUICtrlSetData($CPU_Ges, $Tri_Core & ' %')
ElseIf $CPU[0] = 4 Then
$Quad_Core = Floor($CPU[1] + $CPU[2] + $CPU[3] + $CPU[4] / 4)
;~
GUICtrlSetData($CoreProgress[0], $CPU[1])
GUICtrlSetData($CoreProz[0], $CPU[1] & ' %')
GUICtrlSetData($CoreProgress[1], $CPU[2])
GUICtrlSetData($CoreProz[1], $CPU[2] & ' %')
;~
GUICtrlSetData($CoreProgress[2], $CPU[3])
GUICtrlSetData($CoreProz[2], $CPU[3] & ' %')
GUICtrlSetData($CoreProgress[3], $CPU[4])
GUICtrlSetData($CoreProz[3], $CPU[4] & ' %')
;~
GUICtrlSetData($CPU_Ges_Progress, $Quad_Core)
GUICtrlSetData($CPU_Ges, $Quad_Core & ' %')
ElseIf $CPU[0] = 6 Then
$Hexa_Core = Floor($CPU[1] + $CPU[2] + $CPU[3] + $CPU[4] + $CPU[5] + $CPU[6] / 6)
;~
GUICtrlSetData($CoreProgress[0], $CPU[1])
GUICtrlSetData($CoreProz[0], $CPU[1] & ' %')
GUICtrlSetData($CoreProgress[1], $CPU[2])
GUICtrlSetData($CoreProz[1], $CPU[2] & ' %')
;~
GUICtrlSetData($CoreProgress[2], $CPU[3])
GUICtrlSetData($CoreProz[2], $CPU[3] & ' %')
GUICtrlSetData($CoreProgress[3], $CPU[4])
GUICtrlSetData($CoreProz[3], $CPU[4] & ' %')
;~
GUICtrlSetData($CoreProgress[4], $CPU[5])
GUICtrlSetData($CoreProz[4], $CPU[5] & ' %')
GUICtrlSetData($CoreProgress[5], $CPU[6])
GUICtrlSetData($CoreProz[5], $CPU[6] & ' %')
;~
GUICtrlSetData($CPU_Ges_Progress, $Hexa_Core)
GUICtrlSetData($CPU_Ges, $Hexa_Core & ' %')
ElseIf $CPU[0] = 8 Then
$Octa_Core = Floor($CPU[1] + $CPU[2] + $CPU[3] + $CPU[4] + $CPU[5] + $CPU[6] + $CPU[7] + $CPU[8] /
;~
GUICtrlSetData($CoreProgress[0], $CPU[1])
GUICtrlSetData($CoreProz[0], $CPU[1] & ' %')
GUICtrlSetData($CoreProgress[1], $CPU[2])
GUICtrlSetData($CoreProz[1], $CPU[2] & ' %')
;~
GUICtrlSetData($CoreProgress[2], $CPU[3])
GUICtrlSetData($CoreProz[2], $CPU[3] & ' %')
GUICtrlSetData($CoreProgress[3], $CPU[4])
GUICtrlSetData($CoreProz[3], $CPU[4] & ' %')
;~
GUICtrlSetData($CoreProgress[4], $CPU[5])
GUICtrlSetData($CoreProz[4], $CPU[5] & ' %')
GUICtrlSetData($CoreProgress[5], $CPU[6])
GUICtrlSetData($CoreProz[5], $CPU[6] & ' %')
;~
GUICtrlSetData($CoreProgress[6], $CPU[7])
GUICtrlSetData($CoreProz[6], $CPU[7] & ' %')
GUICtrlSetData($CoreProgress[7], $CPU[8])
GUICtrlSetData($CoreProz[7], $CPU[8] & ' %')
;~
GUICtrlSetData($CPU_Ges_Progress, $Octa_Core)
GUICtrlSetData($CPU_Ges, $Octa_Core & ' %')
EndIf
; Sihe "( http://de.wikipedia.org/wiki/Mehrkernprozessor )"
EndFunc ;==>_Core
#endregion ### _Core() ###
;==========
#region ### _MemUsedRead ###
Func _MemUsedRead()
Local $Bit = (1024 ^ 2)
#region ### Phys RAM ###
Local $Phys_RAM = Ceiling(StringMid($RAM[1] / $Bit, 1, 3))
Local $Phys_RAM_Used = StringMid($RAM[1] / $Bit - $RAM[2] / $Bit, 1, 3)
;~
GUICtrlSetData($UsePhysRAM, $Phys_RAM_Used & ' GB / ' & $Phys_RAM & ' GB')
GUICtrlSetData($UsePhysRAMProgress, $RAM[0])
#endregion ### Phys RAM ###
;==========
#region ### Auslagerung ###
Local $PageFile = Ceiling(StringMid($RAM[3] / $Bit, 1, 3))
Local $PageFile_Used = StringMid($RAM[3] / $Bit - $RAM[4] / $Bit, 1, 3)
;~
GUICtrlSetData($Used_PageFile, $PageFile_Used & ' GB / ' & $PageFile & ' GB')
GUICtrlSetData($Used_PageFile_Progress, $PageFile_Used * 10)
#endregion ### Auslagerung ###
;==========
#region ### Virtueller RAM ###
Local $Virtual_Memory = Ceiling(StringMid($RAM[5] / $Bit, 1, 3))
Local $Virtual_Memory_Used = StringMid($RAM[5] / $Bit - $RAM[6] / $Bit, 1, 3)
;~
GUICtrlSetData($Used_Virtual_RAM, $Virtual_Memory_Used & ' GB / ' & $Virtual_Memory & ' GB')
GUICtrlSetData($Used_Virtual_RAM_Progress, $Virtual_Memory_Used * 10)
#endregion ### Virtueller RAM ###
EndFunc ;==>_MemUsedRead
#endregion ### _MemUsedRead ###
P.s.
Wenn IHR noch Ideen hab, was evt noch von Nutzen ist / sei, sagt mir Bescheid, und ich Versuch es Umzusetzen / Einzubauen