Na dann immer her mit der Wurzel!
Die UDF soll ja nicht nur auf die Grundrechenarten beschränkt bleiben...
Soll ich die Funktionen eigentlich jetzt umbenennen? z.b. auf BigNum_
lgE
Na dann immer her mit der Wurzel!
Die UDF soll ja nicht nur auf die Grundrechenarten beschränkt bleiben...
Soll ich die Funktionen eigentlich jetzt umbenennen? z.b. auf BigNum_
lgE
Ich habe mal die besten Elemente des Wettbewerbs kombiniert und konnte nochmals 10% schneller werden
dann hab ich die UDF gleich mal auf alle 4 Grundrechenarten ausgebaut.
und heute noch auf Dezimalstellen erweitert.
(Ist noch nicht gründlich getestet, und ich hab auch noch keine Errorcodes usw. eingebaut... Beta halt;))
Dadurch ist die Performance wieder etwas schlechter geworden (0.0557 beim µit-Benchmark), aber immer noch ganz flink!
Kann jemand das Script gründlich testen? mein BigInt-Rechner schafft leider keine Dezimalzahlen.
Erklärung zu den Algo´s folgt irgendwann nach...
Wär schön, wenn die UDF langsam wachsen und immer mehr Funktionen bekommen würde...bzw. noch bessere Algo´s...
EDIT: Neue Version: autoit.de/wcf/attachment/11017/
lgE
BigInt BigDec BigNum BigNumber BigDecimal BigInteger _BigNum_Add _BigNum_Sub _BigNum_Mul _BigNum_Div _BigNum_Mod _BigNum_Round _BigNum_Compare
Lol - und ich dachte, bei Notepad und SndRec32 habe ich 2 Programme gewählt, die auf jedem WindowsPC vorhanden sind...
Und die Class hab ich verwendet, weil ich dachte, so unabhängig von der Betriebssystem-Sprache zu sein (Untitled vs. Unbenannt ;))
Tja, ich wollte das damals auch tatsächlich posten, hab aber leider vergessen - sorry!
lgE
Hoffe daß es das ist, was du gesucht hast:
1) einfaches Beispiel mit Notepad.exe
#include <WindowsConstants.au3>
Opt("TrayIconDebug",1)
$hGui = GUICreate("Test GUI", 320, 240)
GUISetState(@SW_HIDE, $hGui)
$hPid=Run(@SystemDir & '\notepad.exe',"", @SW_HIDE)
WinWait("[CLASS:Notepad]", "", 5)
$hChild = WinGetHandle("[CLASS:Notepad]", "")
$NEXSTYLE = DllCall("user32.dll", "int", "GetWindowLong", "hwnd", $hChild, "int", 236)
DllCall("user32.dll", "int", "SetWindowLong", "hwnd", $hChild, "int", 236, "int", BitOR($NEXSTYLE[0], $WS_EX_MDICHILD))
DllCall("user32.dll", "int", "SetParent", "hwnd", $hChild, "hwnd", $hGui)
WinMove($hChild, "", 0, 0,320,240)
GUISetState(@SW_SHOW, $hGui)
WinSetState($hChild,"",@SW_SHOW)
While GUIGetMsg()<>-3
Sleep(1)
WEnd
Func OnAutoItExit()
ProcessClose($hPid)
EndFunc
2) Beispiel mit SndRec32.exe, wobei teilweise Controls ausgeblendet bzw. verschoben wurden
#include <WindowsConstants.au3>
Opt("TrayIconDebug",1)
$hGui = GUICreate("Test GUI", 380, 380)
GUISetState(@SW_HIDE, $hGui)
$hPid=Run(@SystemDir & '\sndrec32.exe /play "' & @WindowsDir & '\Media\tada.wav"',"", @SW_HIDE)
WinWait("[CLASS:SoundRec]", "", 5)
$hChild = WinGetHandle("[CLASS:SoundRec]", "")
$NEXSTYLE = DllCall("user32.dll", "int", "GetWindowLong", "hwnd", $hChild, "int", 236)
DllCall("user32.dll", "int", "SetWindowLong", "hwnd", $hChild, "int", 236, "int", BitOR($NEXSTYLE[0], $WS_EX_MDICHILD))
DllCall("user32.dll", "int", "SetParent", "hwnd", $hChild, "hwnd", $hGui)
WinMove($hChild, "", -6, -40 ,400,450)
ControlHide($hChild,"","shadowframe1")
ControlHide($hChild,"","noflickertext1")
ControlHide($hChild,"","noflickertext2")
ControlHide($hChild,"","shadowframe2")
ControlHide($hChild,"","noflickertext3")
ControlHide($hChild,"","noflickertext4")
ControlHide($hChild,"","msctls_trackbar321")
ControlMove($hChild,"","wavedisplay1",150,150)
ControlMove($hChild,"","Button1",10,10,50,50)
ControlMove($hChild,"","Button2",70,10,50,50)
ControlMove($hChild,"","Button3",130,10,50,50)
ControlMove($hChild,"","Button4",190,10,50,50)
ControlMove($hChild,"","Button5",250,10,50,50)
GUISetState(@SW_SHOW, $hGui)
WinSetState($hChild,"",@SW_SHOW)
While GUIGetMsg()<>-3
Sleep(1)
WEnd
Func OnAutoItExit()
ProcessClose($hPid)
EndFunc
Ich habe das z.b. mit VirtualDub gemacht, damit ich das VirtualDub-Fenster während einer Videoaufnahme disablen kann, man das Fenster aber trotzdem verschieben kann...
lgE
Es geht!
ich hab das in einem meiner Projekte gemacht.
Du mußt dich nur etwas gedulden, bis ich von der Arbeit daheim bin, dann kann ich das posten!
lgE
Wie kann man folgendes Problem lösen?
z.b.: Bei der Installation von Vista_XP_Virtual_Desktop_Manager kommt auf der 2 Seite eine Checkbox
Diese trägt den Classname "Button1"
Wie erkennt man nun, daß es sich um eine Checkbox handelt, und nicht um einen normalen Button?
//Edit: Problem gelöst
#include <WinAPI.au3>
Global Const $GWL_STYLE = 0xFFFFFFF0
$hWnd = ControlGetHandle("Vista/XP Virtual Desktops Setup", "", "Button1")
$style = _WinAPI_GetWindowLong($hWnd, $GWL_STYLE)
If BitAND($style, 2) Then
MsgBox(0, "", "CheckBox")
ElseIf BitAND($style, 1) Then
MsgBox(0, "", "Button")
EndIf
ist schon etwas alt, k.a. woher ich die hab!?
cpuusage.au3:
Global $liOldIdleTime = 0
Global $liOldSystemTime = 0
; \/\/\/ Should do this \/\/\/ to initialize CPU time calculations, but not necessary. First call will, with a delay.
; CurrentCPU(1)
;For $n = 1 to 20
; $a = CurrentCPU()
; ToolTip(@error & @LF & $a)
; Sleep(500)
;Next
Func CurrentCPU($init = 0)
Local $SYS_BASIC_INFO = 0
Local $SYS_PERFORMANCE_INFO = 2
Local $SYS_TIME_INFO = 3
$SYSTEM_BASIC_INFORMATION = DllStructCreate("int;uint;uint;uint;uint;uint;uint;ptr;ptr;uint;byte;byte;short")
$status = DllCall("ntdll.dll", "int", "NtQuerySystemInformation", "int", $SYS_BASIC_INFO, _
"ptr", DllStructGetPtr($SYSTEM_BASIC_INFORMATION), _
"int", DllStructGetSize($SYSTEM_BASIC_INFORMATION), _
"int", 0)
If $status[0] Then Return -1
While 1
$SYSTEM_PERFORMANCE_INFORMATION = DllStructCreate("int64;int[76]")
$SYSTEM_TIME_INFORMATION = DllStructCreate("int64;int64;int64;uint;int")
$status = DllCall("ntdll.dll", "int", "NtQuerySystemInformation", "int", $SYS_TIME_INFO, _
"ptr", DllStructGetPtr($SYSTEM_TIME_INFORMATION), _
"int", DllStructGetSize($SYSTEM_TIME_INFORMATION), _
"int", 0)
If $status[0] Then Return -2
$status = DllCall("ntdll.dll", "int", "NtQuerySystemInformation", "int", $SYS_PERFORMANCE_INFO, _
"ptr", DllStructGetPtr($SYSTEM_PERFORMANCE_INFORMATION), _
"int", DllStructGetSize($SYSTEM_PERFORMANCE_INFORMATION), _
"int", 0)
If $status[0] Then Return -3
If $init = 1 Or $liOldIdleTime = 0 Then
$liOldIdleTime = DLLStructGetData($SYSTEM_PERFORMANCE_INFORMATION,1)
$liOldSystemTime = DLLStructGetData($SYSTEM_TIME_INFORMATION,2)
Sleep(1000)
If $init = 1 Then Return -99
Else
$dbIdleTime = DLLStructGetData($SYSTEM_PERFORMANCE_INFORMATION,1) - $liOldIdleTime
$dbSystemTime = DLLStructGetData($SYSTEM_TIME_INFORMATION,2) - $liOldSystemTime
$liOldIdleTime = DLLStructGetData($SYSTEM_PERFORMANCE_INFORMATION,1)
$liOldSystemTime = DLLStructGetData($SYSTEM_TIME_INFORMATION,2)
$dbIdleTime = $dbIdleTime / $dbSystemTime
[/autoit] [autoit][/autoit] [autoit]$dbIdleTime = 100.0 - $dbIdleTime * 100.0 / DLLStructGetData($SYSTEM_BASIC_INFORMATION,11) + 0.5
Return $dbIdleTime
EndIf
$SYSTEM_PERFORMANCE_INFORMATION = 0
$SYSTEM_TIME_INFORMATION = 0
WEnd
EndFunc
beispiel:
#include "Cpuusage.au3"
[/autoit] [autoit][/autoit] [autoit]While 1
ToolTip(Round(CurrentCpu(),0) & "%")
Sleep(100)
WEnd
lgE
Hab mal versucht obiges Script so zu erweitern, daß nur alle relevanten Controls angezeigt werden:
#include<Array.au3>
;#include<ArrayMore.au3>
Opt("TrayIconDebug",1)
[/autoit] [autoit][/autoit] [autoit]HotKeySet("^!e","_Exit")
[/autoit] [autoit][/autoit] [autoit]Global $Infos="", $Controls
[/autoit] [autoit][/autoit] [autoit]$hFile=FileOpenDialog("Installations-Exe",@ScriptDir & "\Installationen","(*.exe;*.msi)",3)
If @error Then Exit
If StringRight($hFile,4)=".exe" Then $sPID=Run($hFile)
If StringRight($hFile,4)=".msi" Then
If ShellExecute($hFile)=1 Then
$Child=_ProcessGetChildren(@AutoItPID)
If @error Then Exit
$sPID=$Child[1][0]
EndIf
EndIf
Do
Sleep(500)
$Infos=""
$Controls=""
_GetInfo($sPID)
;_ToolTip($Infos)
ToolTip($Controls,0,0)
Until ProcessExists($sPID)=0
Func _GetInfo($sPid)
$Child=_ProcessGetChildren($sPID)
If IsArray($Child) Then
For $i= 1 To UBound($Child)-1
$aWin=_WinGetInfoByPID($Child[$i][0])
If Not @error Then
_AddInfos($aWin)
_GetInfo($Child[$i][0])
EndIf
Next
Else
$aWin=_WinGetInfoByPID($sPID)
If Not @error Then _AddInfos($aWin)
EndIf
EndFunc
Func _AddInfos($Array)
Local $String=""
For $i=1 To UBound($Array,1)-1
For $j=1 To UBound($Array,2)-1
If $j=2 Then _AddControls(_listcontrols($Array[$i][2]))
$String&=$Array[$i][$j]
Next
$String&=@CRLF & "------------" & @CRLF
Next
$Infos&=$String
EndFunc
Func _AddControls($Array)
Local $String="", $Temp
For $i=1 To UBound($Array,1)-1
If StringInStr($Array[$i][0],"Button") Or StringInStr($Array[$i][0],"Edit") Or StringInStr($Array[$i][0],"Combobox") Or StringInStr($Array[$i][0],"Checkbox") Then
$Temp=$Array[$i][3] & "_" & $Array[$i][0] & ": " & $Array[$i][1]
If StringLen($Temp)>100 Then $Temp=StringLeft($Temp,100)
If StringInStr($Controls,$Temp)=0 Then
$String=@CRLF&WinGetTitle($Array[1][2])&@CRLF&"--------------------------------------------"&@CRLF
ExitLoop
EndIf
EndIf
Next
For $i=1 To UBound($Array,1)-1
If StringInStr($Array[$i][0],"Button") Or StringInStr($Array[$i][0],"Edit") Or StringInStr($Array[$i][0],"Combobox") Or StringInStr($Array[$i][0],"Checkbox") Then
$Temp=$Array[$i][3] & "_" & $Array[$i][0] & ": " & $Array[$i][1]
If StringLen($Temp)>100 Then $Temp=StringLeft($Temp,100)
If StringInStr($Controls,$Temp)=0 Then $String&=$Temp & @CRLF
EndIf
Next
If $String<>"" Then $Controls&=$String&"--------------------------------------------"&@CRLF
EndFunc
Func _WinGetInfoByPID($sPID)
Local $aPList = ProcessList(), $iPID
For $iiCount = 1 To $aPList[0][0]
If $aPList[$iiCount][1] = $sPID Then
If $sPID = 0 Then Return 0
$iPID &= $aPList[$iiCount][1] & Chr(01)
EndIf
Next
$iPID = StringSplit($iPID, Chr(01))
If $iPID = 0 Then Return SetError(1, 0, 0)
Local $aStoreHwndAndText[2][9], $nCount = 1
$OptWSC = Opt('WinSearchChildren', 0)
$OptWDHT = Opt('WinDetectHiddenText', 0)
Local $aWinList = WinList()
For $iCount = 1 To $aWinList[0][0]
For $xCount = 1 To $iPID[0]
If WinGetProcess($aWinList[$iCount][1]) = $iPID[$xCount] And _
$aWinList[$iCount][0] <> '' Then
Local $aWinPos = WinGetPos($aWinList[$iCount][1])
Local $aWinClient = WinGetClientSize($aWinList[$iCount][1])
$nCount += 1
ReDim $aStoreHwndAndText[$nCount][9]
$aStoreHwndAndText[$nCount - 1][1] = $aWinList[$iCount][0]
$aStoreHwndAndText[$nCount - 1][2] = $aWinList[$iCount][1]
$aStoreHwndAndText[$nCount - 1][3] = WinGetText($aWinList[$iCount][1])
$aStoreHwndAndText[$nCount - 1][4] = $aWinPos[0]
$aStoreHwndAndText[$nCount - 1][5] = $aWinPos[1]
$aStoreHwndAndText[$nCount - 1][6] = $aWinClient[0]
$aStoreHwndAndText[$nCount - 1][7] = $aWinClient[1]
$aStoreHwndAndText[$nCount - 1][8] = WinGetClassList($aWinList[$iCount][1])
EndIf
Next
Next
Opt('WinSearchChildren', $OptWSC)
Opt('WinDetectHiddenText', $OptWDHT)
If $nCount = 1 Then Return SetError(2, 0, 0)
Return $aStoreHwndAndText
EndFunc ;==>_WinGetInfoByPID
Func _ProcessGetChildren($i_pid) ; First level children processes only
Local Const $TH32CS_SNAPPROCESS = 0x00000002
Local $a_tool_help = DllCall("Kernel32.dll", "long", "CreateToolhelp32Snapshot", "int", $TH32CS_SNAPPROCESS, "int", 0)
If IsArray($a_tool_help) = 0 Or $a_tool_help[0] = -1 Then Return SetError(1, 0, $i_pid)
Local $tagPROCESSENTRY32 = _
DllStructCreate _
( _
"dword dwsize;" & _
"dword cntUsage;" & _
"dword th32ProcessID;" & _
"uint th32DefaultHeapID;" & _
"dword th32ModuleID;" & _
"dword cntThreads;" & _
"dword th32ParentProcessID;" & _
"long pcPriClassBase;" & _
"dword dwFlags;" & _
"char szExeFile[260]" _
)
DllStructSetData($tagPROCESSENTRY32, 1, DllStructGetSize($tagPROCESSENTRY32))
Local $p_PROCESSENTRY32 = DllStructGetPtr($tagPROCESSENTRY32)
Local $a_pfirst = DllCall("Kernel32.dll", "int", "Process32First", "long", $a_tool_help[0], "ptr", $p_PROCESSENTRY32)
If IsArray($a_pfirst) = 0 Then Return SetError(2, 0, $i_pid)
Local $a_pnext, $a_children[11][2] = [[10]], $i_child_pid, $i_parent_pid, $i_add = 0
$i_child_pid = DllStructGetData($tagPROCESSENTRY32, "th32ProcessID")
If $i_child_pid <> $i_pid Then
$i_parent_pid = DllStructGetData($tagPROCESSENTRY32, "th32ParentProcessID")
If $i_parent_pid = $i_pid Then
$i_add += 1
$a_children[$i_add][0] = $i_child_pid
$a_children[$i_add][1] = DllStructGetData($tagPROCESSENTRY32, "szExeFile")
EndIf
EndIf
While 1
$a_pnext = DLLCall("Kernel32.dll", "int", "Process32Next", "long", $a_tool_help[0], "ptr", $p_PROCESSENTRY32)
If IsArray($a_pnext) And $a_pnext[0] = 0 Then ExitLoop
$i_child_pid = DllStructGetData($tagPROCESSENTRY32, "th32ProcessID")
If $i_child_pid <> $i_pid Then
$i_parent_pid = DllStructGetData($tagPROCESSENTRY32, "th32ParentProcessID")
If $i_parent_pid = $i_pid Then
If $i_add = $a_children[0][0] Then
ReDim $a_children[$a_children[0][0] + 11][2]
$a_children[0][0] = $a_children[0][0] + 10
EndIf
$i_add += 1
$a_children[$i_add][0] = $i_child_pid
$a_children[$i_add][1] = DllStructGetData($tagPROCESSENTRY32, "szExeFile")
EndIf
EndIf
WEnd
If $i_add <> 0 Then
ReDim $a_children[$i_add + 1][2]
$a_children[0][0] = $i_add
EndIf
DllCall("Kernel32.dll", "int", "CloseHandle", "long", $a_tool_help[0])
If $i_add Then Return $a_children
Return SetError(3, 0, 0)
EndFunc
Func _listcontrols($HWND)
If Not WinExists($HWND) Then Return SetError(1,Default,0)
$class = WinGetClassList($HWND)
$class = StringSplit($class,@LF)
If Not IsArray($class) Then Return SetError(2,Default,0)
_Array2DDblDel($class)
Local $ret[1][4]
For $i = 1 To UBound($class)-1
$count = 1
While True
If IsHWnd(ControlGetHandle($HWND,"",$class[$i]&$count)) Then
If ControlCommand($HWND,"",$class[$i]&$count,"IsVisible", "") And ControlCommand($HWND,"",$class[$i]&$count,"IsEnabled", "") Then
ReDim $ret[UBound($ret)+1][4]
$ret[UBound($ret)-1][0]=$class[$i]&$count
$ret[UBound($ret)-1][1]=ControlGetText($HWND,"",$class[$i]&$count)
$ret[UBound($ret)-1][2]=$HWND
If ControlCommand($HWND,"",$class[$i]&$count,"IsChecked", "")=1 Then
$ret[UBound($ret)-1][3]="Checked"
Else
$ret[UBound($ret)-1][3]="-"
EndIf
EndIf
Else
ExitLoop
EndIf
$count = $count +1
WEnd
Next
$ret[0][0] = UBound($ret) -1
;_ArrayDisplay($ret)
Return $ret
EndFunc
Func _Array2DDblDel(ByRef $ARRAY, $CASESENS=0)
Local $arTmp[1] = [''], $dbl = 0, $count = 0, $x, $l, $val, $valTmp, $i, $k
If ( Not IsArray($ARRAY) ) Then
SetError(1)
Return 0
EndIf
Local $Ubound2nd = UBound($ARRAY,2)
If @error = 2 Then
For $i = 0 To UBound($ARRAY)-1
$dbl = 0
For $k = 0 To UBound($arTmp)-1
Switch $CASESENS
Case 0
If $arTmp[$k] = $ARRAY[$i] Then
$dbl = 1
$count += 1
EndIf
Case 1
If $arTmp[$k] == $ARRAY[$i] Then
$dbl = 1
$count += 1
EndIf
EndSwitch
Next
If $dbl = 0 Then
If $arTmp[0] = "" Then
$arTmp[0] = $ARRAY[$i]
Else
ReDim $arTmp[UBound($arTmp)+1]
$arTmp[UBound($arTmp)-1] = $ARRAY[$i]
EndIf
Else
$dbl = 0
EndIf
Next
Else
ReDim $arTmp[1][$Ubound2nd]
$arTmp[0][0] = ''
$x = 0
For $i = 0 To UBound($ARRAY)-1
$dbl = 0
$val = ''
$valTmp = ''
For $l = 0 To $Ubound2nd-1
$val &= $ARRAY[$i][$l]
Next
For $k = 0 To UBound($arTmp)-1
For $l = 0 To $Ubound2nd-1
$valTmp &= $arTmp[$k][$l]
Next
Switch $CASESENS
Case 0
If $valTmp = $val Then
$dbl = 1
$count += 1
EndIf
Case 1
If $valTmp == $val Then
$dbl = 1
$count += 1
EndIf
EndSwitch
$valTmp = ''
Next
If $dbl = 0 Then
If $x = 1 Then ReDim $arTmp[UBound($arTmp)+1][$Ubound2nd]
For $l = 0 To $Ubound2nd-1
If $arTmp[0][0] = '' Or $x = 0 Then
$arTmp[0][$l] = $ARRAY[0][$l]
If $l = $Ubound2nd-1 Then $x = 1
Else
$arTmp[UBound($arTmp)-1][$l] = $ARRAY[$i][$l]
$x = 2
If $l = $Ubound2nd-1 Then $x = 1
EndIf
Next
Else
$dbl = 0
EndIf
Next
EndIf
$ARRAY = $arTmp
Return $count
EndFunc ; ==>_ArrayDblDel
Func _Exit()
Exit
EndFunc
Damit kann man mal überprüfen, welche Install-versionen damit noch nicht abgedeckt sind...
zu Testzwecken solls mal reichen
lgE
*.msi lassen sich nur mit Shellexecute starten...
da brauchen wir noch eine Lösung, um an die richtige PID der msiexec.exe zu kommen...
//Edit: gelöst, Siehe oben: PID von msi wird als Child von Autoit ermittelt
Welche Dateien kann man noch installieren? *.inf?
lgE
Also hier mal ein Ansatz:
Dieses Testscript ermittelt alle Window-Infos der gestarteten EXE, sowie die Daten aller Child-Prozesse (Adobe Reader Setup startet nach ein paar Sekunden z.b. msiexec.exe)
Also sollten alle Fenster, die während der Installation aufpoppen und zur Installation gehören ermittelt werden.
Diese Script ist nur mal zum Testen; man muß sich manuell durch die Installation klicken und die Infos werden im Tooltip angezeigt...
Die _WinGetInfoByPID hab ich aus einem Script von GtaSpider
(leicht verändert, da versteckte Fenster nicht gefunden werden sollen)
_ProcessGetChildren ist aus dem englischen Forum.
nur probehalber mit 7zip und Adobe Reader von IOM4 getestet...
HotKeySet("^!e","_Exit")
[/autoit] [autoit][/autoit] [autoit]Global $Infos=""
Global Const $WM_USER = 0x400
Global Const $TTM_SETTIPBKCOLOR = ($WM_USER + 19)
Global Const $TTM_SETTIPTEXTCOLOR = ($WM_USER + 20)
$hFile=FileOpenDialog("Installations-Exe",@ScriptDir & "\Installationen","(*.exe;*.msi)",3)
If @error Then Exit
If StringRight($hFile,4)=".exe" Then $sPID=Run($hFile)
If StringRight($hFile,4)=".msi" Then
If ShellExecute($hFile)=1 Then
$Child=_ProcessGetChildren(@AutoItPID)
If @error Then Exit
$sPID=$Child[1][0]
EndIf
EndIf
Do
Sleep(500)
$Infos=""
_GetInfo($sPID)
_ToolTip($Infos)
Until ProcessExists($sPID)=0
Func _GetInfo($sPid)
$Child=_ProcessGetChildren($sPID)
If IsArray($Child) Then
For $i= 1 To UBound($Child)-1
$aWin=_WinGetInfoByPID($Child[$i][0])
If Not @error Then
_AddInfos($aWin)
_GetInfo($Child[$i][0])
EndIf
Next
Else
$aWin=_WinGetInfoByPID($sPID)
If Not @error Then _AddInfos($aWin)
EndIf
EndFunc
Func _AddInfos($Array)
Local $String=""
For $i=1 To UBound($Array,1)-1
For $j=1 To UBound($Array,2)-1
$String&=$Array[$i][$j]
Next
$String&=@CRLF & "------------" & @CRLF
Next
$Infos&=$String
EndFunc
Func _WinGetInfoByPID($sPID)
Local $aPList = ProcessList(), $iPID
For $iiCount = 1 To $aPList[0][0]
If $aPList[$iiCount][1] = $sPID Then
If $sPID = 0 Then Return 0
$iPID &= $aPList[$iiCount][1] & Chr(01)
EndIf
Next
$iPID = StringSplit($iPID, Chr(01))
If $iPID = 0 Then Return SetError(1, 0, 0)
Local $aStoreHwndAndText[2][9], $nCount = 1
$OptWSC = Opt('WinSearchChildren', 0)
$OptWDHT = Opt('WinDetectHiddenText', 0)
Local $aWinList = WinList()
For $iCount = 1 To $aWinList[0][0]
For $xCount = 1 To $iPID[0]
If WinGetProcess($aWinList[$iCount][1]) = $iPID[$xCount] And _
$aWinList[$iCount][0] <> '' Then
Local $aWinPos = WinGetPos($aWinList[$iCount][1])
Local $aWinClient = WinGetClientSize($aWinList[$iCount][1])
$nCount += 1
ReDim $aStoreHwndAndText[$nCount][9]
$aStoreHwndAndText[$nCount - 1][1] = $aWinList[$iCount][0]
$aStoreHwndAndText[$nCount - 1][2] = $aWinList[$iCount][1]
$aStoreHwndAndText[$nCount - 1][3] = WinGetText($aWinList[$iCount][1])
$aStoreHwndAndText[$nCount - 1][4] = $aWinPos[0]
$aStoreHwndAndText[$nCount - 1][5] = $aWinPos[1]
$aStoreHwndAndText[$nCount - 1][6] = $aWinClient[0]
$aStoreHwndAndText[$nCount - 1][7] = $aWinClient[1]
$aStoreHwndAndText[$nCount - 1][8] = WinGetClassList($aWinList[$iCount][1])
EndIf
Next
Next
Opt('WinSearchChildren', $OptWSC)
Opt('WinDetectHiddenText', $OptWDHT)
If $nCount = 1 Then Return SetError(2, 0, 0)
Return $aStoreHwndAndText
EndFunc ;==>_WinGetInfoByPID
Func _ProcessGetChildren($i_pid) ; First level children processes only
Local Const $TH32CS_SNAPPROCESS = 0x00000002
Local $a_tool_help = DllCall("Kernel32.dll", "long", "CreateToolhelp32Snapshot", "int", $TH32CS_SNAPPROCESS, "int", 0)
If IsArray($a_tool_help) = 0 Or $a_tool_help[0] = -1 Then Return SetError(1, 0, $i_pid)
Local $tagPROCESSENTRY32 = _
DllStructCreate _
( _
"dword dwsize;" & _
"dword cntUsage;" & _
"dword th32ProcessID;" & _
"uint th32DefaultHeapID;" & _
"dword th32ModuleID;" & _
"dword cntThreads;" & _
"dword th32ParentProcessID;" & _
"long pcPriClassBase;" & _
"dword dwFlags;" & _
"char szExeFile[260]" _
)
DllStructSetData($tagPROCESSENTRY32, 1, DllStructGetSize($tagPROCESSENTRY32))
Local $p_PROCESSENTRY32 = DllStructGetPtr($tagPROCESSENTRY32)
Local $a_pfirst = DllCall("Kernel32.dll", "int", "Process32First", "long", $a_tool_help[0], "ptr", $p_PROCESSENTRY32)
If IsArray($a_pfirst) = 0 Then Return SetError(2, 0, $i_pid)
Local $a_pnext, $a_children[11][2] = [[10]], $i_child_pid, $i_parent_pid, $i_add = 0
$i_child_pid = DllStructGetData($tagPROCESSENTRY32, "th32ProcessID")
If $i_child_pid <> $i_pid Then
$i_parent_pid = DllStructGetData($tagPROCESSENTRY32, "th32ParentProcessID")
If $i_parent_pid = $i_pid Then
$i_add += 1
$a_children[$i_add][0] = $i_child_pid
$a_children[$i_add][1] = DllStructGetData($tagPROCESSENTRY32, "szExeFile")
EndIf
EndIf
While 1
$a_pnext = DLLCall("Kernel32.dll", "int", "Process32Next", "long", $a_tool_help[0], "ptr", $p_PROCESSENTRY32)
If IsArray($a_pnext) And $a_pnext[0] = 0 Then ExitLoop
$i_child_pid = DllStructGetData($tagPROCESSENTRY32, "th32ProcessID")
If $i_child_pid <> $i_pid Then
$i_parent_pid = DllStructGetData($tagPROCESSENTRY32, "th32ParentProcessID")
If $i_parent_pid = $i_pid Then
If $i_add = $a_children[0][0] Then
ReDim $a_children[$a_children[0][0] + 11][2]
$a_children[0][0] = $a_children[0][0] + 10
EndIf
$i_add += 1
$a_children[$i_add][0] = $i_child_pid
$a_children[$i_add][1] = DllStructGetData($tagPROCESSENTRY32, "szExeFile")
EndIf
EndIf
WEnd
If $i_add <> 0 Then
ReDim $a_children[$i_add + 1][2]
$a_children[0][0] = $i_add
EndIf
DllCall("Kernel32.dll", "int", "CloseHandle", "long", $a_tool_help[0])
If $i_add Then Return $a_children
Return SetError(3, 0, 0)
EndFunc
Func _ToolTip($sText)
ToolTip($sText,0,0)
Local $h_tooltip = WinGetHandle ($sText)
DllCall("user32.dll","int","SendMessage","hwnd",$h_tooltip,"int",$TTM_SETTIPBKCOLOR,"int",0xcd0000,"int",0)
DllCall("user32.dll","int","SendMessage","hwnd",$h_tooltip,"int",$TTM_SETTIPTEXTCOLOR,"int",0xFFFFFF,"int",0)
EndFunc
Func _Exit()
Exit
EndFunc
ach ja, beim Tooltip hab ich die Schriftgröße verändert, damit mehr Zeilen reinpassen
lgE
//Edit: Hab noch den HotKey Ctrl-Alt-e zum Beenden eingefügt, da bei der Thunderbirdinstallation der Tooltip den gesammten Bildschirm ausfüllt
und man dann nicht mal in den Taskmanager reinkommt
Hi
#AutoIt3Wrapper_Res_Fileversion=1.0.0.0
[/autoit]Dazu benötigst du SciTE4Autoit, der Link ist links auf dieser Seite, gleich unter "Übersetzungsstatus"
lgE
Scheint wirklich ein Hardwaredefekt zu sein.
Hab die Partition nun so verändert, daß die defekten Stellen "vorne" nicht benutzt werden.
Die Platte ist zwar nun etwas kleiner, aber sie funktioniert wieder!
thx
lgE
Bin leider nicht zuhause, um das gleich mal auszuprobieren...
Hab aber auf´m alten Laptop Ubuntu 8.4 (und auch Kubuntu, Vista, XP & Win2k) drauf...
werd das morgen gleich mal testen...
lgE
Hallo Spezialisten
Ich hab eine externe HDD, WesternDigital Passport 250GB.
Die ist werksmäßig auf Fat32 formatiert.
Irrtümlich hab ich sie auf NTSF formatiert (unter WinXP) und seither kommt beim kopieren die Fehlermeldung "Sektor nicht gefunden"!
Mit einem WD-Tool hab ich die Werksformatierung Fat32 widerhergestellt - Fehlermeldung bleibt jedoch.
Unter Windows kann ich die Platte nur mit Quickformat formatieren, bei normalem Format tut sich gar nichts...
Ich will jetzt mal ausschließen, daß die Platte physikalisch defekt ist.
Kann es sein, daß die Formatierung falsche Sector und Head Werte verwendet?
thx für alle Hinweise
Eukalyptus
Probier mal nur @CR oder nur @LF bei StringSplit
lgE
Wie wärs mit: 1 Wort ändern und 1 Wort hinzufügen?
z.b.: Unter diesem Niveau hofft mein Koalabär auf...
Unter diesem Niveau tanzt der Koalabär
Auf diesem Baum tanzt der Koalabär