Einfach beide ToolTips hintereinander hinschreiben ![]()
Der User merkt doch die Millisekunde dazwischen gar nicht :o
Beiträge von PenGuin
-
-
Hab hier mal ne Funktion gebastelt. Vllt. nicht optimal programmiert, aber sie funktioniert
[autoit]
Func _ListDoubleNumbers($sText)
[/autoit]
Local $a = 1, $b = 0, $c = 0
Local $aMatches[1]
Local $aRegEx = StringRegExp($sText, "(\d+)", 3)
Local $aTest = _ArrayUnique($aRegEx)
Do
For $b = 0 To UBound($aRegEx) - 1
If ($aTest[$a] = $aRegEx[$b]) And ($a <> ($b+1)) Then $c += 1
Next
If $c = 1 Then _ArrayAdd($aMatches, $aTest[$a])
$c = 0
$a += 1
Until $a = $aTest[0]
Return $aMatches
EndFunc -
Ansonsten gibts ja auch noch sowas wie wm_command, falls man ein wichtiges Ereignis abfangen will, fast wie ein interupt in asm

-
:O
Ziemlich geniales Programm!
-
Wobei ich zugeben muss dass ich es wahrscheinlich auch nicht gefunden hätte wenn ich nicht gewusst hätte dass ich es mal geschrieben hatte. (wow - das waren mal viele Perfekt-Termini...
)Wenn du die Zeit "Perfekt" meinst, dann waren es gar nicht soviele. Nämlilch haste genau 1 mal Perfekt benutzt, der Rest ist Konjunktiv

Das musste ich mal eben gesagt haben
/Deutsch-besser-wisser offUnd für Fragen sind wir ja da, wenn wir genug Eigenleistung sehen

-
Wie gesagt, erst Anfangsphase

-
Da würde es 7 hoch 7 Möglichkeiten geben (richtig gerechnet? :D)
Glaub ich ziemlich schwer realisierbar^^ -
Hab zwar nicht nachgeschaut, obs schon so eine UDF gibt, aber hab auch mal eine geschrieben

Sie ist noch im Anfangsstadium... Ich werde sie noch erweitern und verbessern.
Und mit GDI+ bin ich noch nicht so gut dabei, also Rücksicht
Ich war auch bis jetzt noch zu faul ein Funktionsheader zu schreiben, in dem die Funktion erklärt wird. Ich liefere einfach erstmal ein Testscript mit

UDF:
Spoiler anzeigen
[autoit]Global $SpoilerInfoStruct = DLLStructCreate("int hWnd; int Button; int X; int Y; int Width; int Height")
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
Global $GDIInfoStruct = DLLStructCreate("int Graphic; int Brush; int Format; int Font; int Family")
Global $sDataButtonState = 1
Global $Spoilertext = ""Func _Spoiler_StartUp($hWnd)
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
_GDIPlus_Startup()
$hGraphic = _GDIPlus_GraphicsCreateFromHWND($hWnd)
AdlibRegister("__Redraw", 500)
DLLStructSetData($GDIInfoStruct, 1, $hGraphic)
EndFuncFunc _Spoiler_Create($hWnd, $sText, $sFont, $iSize, $iX, $iY, $iWidth, $iHeight)
[/autoit] [autoit][/autoit] [autoit]
GUIRegisterMsg(0x000F, "__Redraw")
GUIRegisterMsg(0x0111, "__Handler")$hLabel = GUICtrlCreateLabel("Spoiler:", $iX, $iY)
[/autoit] [autoit][/autoit] [autoit]
GUICtrlSetFont(-1, 8.5, 800)
$aPos = ControlGetPos($hWnd, "", $hLabel)
$hButtonSpoiler = GUICtrlCreateButton("hide", $iX + $aPos[2] + 2, $iY - ($aPos[3] / 5))
GUICtrlSetFont(-1, 7.5)DLLStructSetData($SpoilerInfoStruct, 1, $hWnd)
[/autoit] [autoit][/autoit] [autoit]
DLLStructSetData($SpoilerInfoStruct, 2, $hButtonSpoiler)
DLLStructSetData($SpoilerInfoStruct, 3, $iX)
DLLStructSetData($SpoilerInfoStruct, 4, $iY + $aPos[3])
DLLStructSetData($SpoilerInfoStruct, 5, $iWidth)
DLLStructSetData($SpoilerInfoStruct, 6, $iHeight)_GDIPlus_GraphicsDrawRect(DLLStructGetData($GDIInfoStruct, 1), _
[/autoit] [autoit][/autoit] [autoit]
DLLStructGetData($SpoilerInfoStruct, 3), _
DLLStructGetData($SpoilerInfoStruct, 4), _
DLLStructGetData($SpoilerInfoStruct, 5), _
DLLStructGetData($SpoilerInfoStruct, 6))$Spoilertext &= $sText
[/autoit] [autoit][/autoit] [autoit]$hGraphic = DLLStructGetData($GDIInfoStruct, 1)
[/autoit] [autoit][/autoit] [autoit]$hBrush = _GDIPlus_BrushCreateSolid(0xFF000000)
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
DLLStructSetData($GDIInfoStruct, 2, $hBrush)
$hFormat = _GDIPlus_StringFormatCreate()
DLLStructSetData($GDIInfoStruct, 3, $hFormat)
$hFamily = _GDIPlus_FontFamilyCreate($sFont)
DLLStructSetData($GDIInfoStruct, 5, $hFamily)
$hFont = _GDIPlus_FontCreate($hFamily, $iSize, 2)
DLLStructSetData($GDIInfoStruct, 4, $hFont)
__DrawString($Spoilertext)
EndFuncFunc _Spoiler_Shutdown()
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
$SpoilerInfoStruct = 0
$GDIInfoStruct = 0
AdlibUnRegister("__Redraw")
_GDIPlus_FontDispose(DllStructGetData($GDIInfoStruct, 4))
_GDIPlus_FontFamilyDispose(DllStructGetData($GDIInfoStruct, 5))
_GDIPlus_StringFormatDispose(DllStructGetData($GDIInfoStruct, 3))
_GDIPlus_BrushDispose(DllStructGetData($GDIInfoStruct, 2))
_GDIPlus_GraphicsDispose(DLLStructGetData($GDIInfoStruct, 1))
_GDIPlus_Shutdown()
EndFuncFunc __Redraw()
[/autoit] [autoit][/autoit] [autoit]
If $sDataButtonState = 1 Then
_GDIPlus_GraphicsDrawRect(DLLStructGetData($GDIInfoStruct, 1), _
DLLStructGetData($SpoilerInfoStruct, 3), _
DLLStructGetData($SpoilerInfoStruct, 4), _
DLLStructGetData($SpoilerInfoStruct, 5), _
DLLStructGetData($SpoilerInfoStruct, 6))__DrawString($Spoilertext)
[/autoit] [autoit][/autoit] [autoit]
EndIf
EndFuncFunc __Handler($hWnd, $nMsg, $wParam, $lParam)
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
$hButton = GUICtrlGetHandle(DLLStructGetData($SpoilerInfoStruct, 2))
If $lParam = $hButton Then
__StateHandler()
EndIf
EndFuncFunc __StateHandler()
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
Switch $sDataButtonState
Case 0
GUICtrlSetData(DLLStructGetData($SpoilerInfoStruct, 2), "hide")
__Redraw()
AdlibRegister("__Redraw", 500)
$sDataButtonState = 1
Case 1
GUICtrlSetData(DLLStructGetData($SpoilerInfoStruct, 2), "show")
AdLibUnRegister("__Redraw")
_WinAPI_RedrawWindow(DLLStructGetData($SpoilerInfoStruct, 1))
$sDataButtonState = 0
EndSwitch
EndFuncFunc __DrawString($sText)
[/autoit] [autoit][/autoit] [autoit]
$tLayout = _GDIPlus_RectFCreate(DLLStructGetData($SpoilerInfoStruct, 3), _
DLLStructGetData($SpoilerInfoStruct, 4), _
DLLStructGetData($SpoilerInfoStruct, 5), _
DLLStructGetData($SpoilerInfoStruct, 6))$aInfo = _GDIPlus_GraphicsMeasureString(DLLStructGetData($GDIInfoStruct, 1), $sText, DLLStructGetData($GDIInfoStruct, 4), $tLayout, DLLStructGetData($GDIInfoStruct, 3))
[/autoit]
_GDIPlus_GraphicsDrawStringEx(DLLStructGetData($GDIInfoStruct, 1), $sText, DLLStructGetData($GDIInfoStruct, 4), $aInfo[0], DLLStructGetData($GDIInfoStruct, 3), DLLStructGetData($GDIInfoStruct, 2))
EndFuncUnd hier das Testscript:
Spoiler anzeigen
[autoit]#include <GDIPlus.au3>
[/autoit] [autoit][/autoit] [autoit]
#include <SpoilerUDF.au3>$Form1 = GUICreate("Form1", 400, 400, 448, 225)
[/autoit] [autoit][/autoit] [autoit]
GUISetState(@SW_SHOW)$StartUp = _Spoiler_StartUp($Form1)
[/autoit] [autoit][/autoit] [autoit]
$Label1 = _Spoiler_Create($Form1, "Test", "Arial", 12, 50,50, 200, 200)Do
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
Sleep(50)
Until GUIGetMsg() = -3_Spoiler_Shutdown()
[/autoit]Bugs dürfen genannt werden!

Ich hoffe es gefällt euch
MfG
-
-
Andy:
VirtualAllocEx oder wie meinste das? -
Das IsVisible muss man allerdings auf _WinAPI_IsWindowVisible(...) umändern...
Woher hast du das denn
-
Mach mal ein Bild davon wie du Window Info Tool offen hast und dieses OBD!
Vielleicht findet man dann den Fehler... -
[autoit]
Global $hUser32 = DllOpen("user32.dll")
[/autoit][autoit][/autoit][autoit]
Global $pCallBack = DllCallbackRegister("_EnumWindows", "int", "hwnd;lParam")Do
[/autoit][autoit][/autoit][autoit]
DllCall($hUser32, "int", "EnumWindows", "ptr", DllCallbackGetPtr($pCallBack), "lparam", 0)
Sleep(50)
Until False
DllClose($hUser32)
DllCallbackFree($pCallBack)Func _EnumWindows($hWnd, $lParam)
[/autoit]
;deine function
EndFunc -
Habs mal geändert

-
Hab noch paar Fehlerabfragen eingebaut

-
Hier die Funktion von mir, optimiert und erweitert durch Kleiner und Großvater
[autoit]
[/autoit]
; #FUNCTION# ====================================================================================================================
; Name...........: _ProcessGetModulesEx
; Description....: Retrieves the currently loaded modules in the target process.
; Syntax.........: _ProcessGetModules($iPID, $iMode, $iFlag)
; Parameters.....: $iPID - The PID of the target process.
; $iMode - Changes the returns in the array. This parameter can be:
; 1: Retrieves an array with the fullpath of the modules.
; 2: Retrieves an array with the modules only.
; $iFlag - The filter criteria. This parameter can be one of the following values
; 1: List the 32-bit modules.
; 2: List the 64-bit modules.
; 3: List all modules.
; 0: Use the default behavior.
; Return values..: Success - An array with the loaded modules.
; Failure - Returns -1 if the PId isn't valid
; Returns -2 if $iMode is not 1 or 2
; Returns -3 if the function couldn't open the target process
; Returns -4 if the function coudln't enumerate the modules
; Returns "Couldn't retrieve the modulename of xxxx" in the array where the function couldn't get the module name.
; Author.........: [email='pinguin94@autoit.de'][/email]
; Modified.......: Großvater, Kleiner
; Remarks........: None
; Related........: None
; Link...........: None
; Example........: No
; ===============================================================================================================================
Func _ProcessGetModulesEx($iPID, $iMode = 1, $iFlag = 0)
If Not ProcessExists($iPID) Then Return SetError(1, 0, -1)
If Not $iMode Or $iMode > 2 Then Return SetError(1, 0, -2)
Local $hOpen = DllCall('kernel32.dll', 'handle', 'OpenProcess', 'int', 0x0400 + 0x0010, 'int', 0, 'int', $iPID)
If @error Then Return SetError(1, 0, -3)
Local $Struct = DllStructCreate('int[1024]')
Local $aEnum = DllCall('psapi.dll', 'int', 'EnumProcessModulesEx', 'handle', $hOpen[0], 'ptr', DllStructGetPtr($Struct), 'int', DllStructGetSize($Struct), 'dword*', 0, 'dword', $iFlag)
If @error Then Return SetError(1, 0, -4)
Local $iMax = $aEnum[4] / 4
Local $aModules[$iMax + 1]
Local $aTemp, $iMod = 0
For $i = 1 To $iMax
$aTemp = DllCall('psapi.dll', 'int', 'GetModuleFileNameEx', 'handle', $hOpen[0], 'int', DllStructGetData($Struct, 1, $i), 'str', '', 'int', 2048)
If @error Then
$iMod += 1
$aModules[$i] = "Couldn't retrieve the modulename of " & DllStructGetData($Struct, 1, $i)
ContinueLoop
EndIf
If $aTemp[3] Then
$iMod += 1
Switch $iMode
Case 1
$aModules[$i] = $aTemp[3]
Case Else
$aModules[$i] = StringMid($aTemp[3], StringInStr($aTemp[3], '\', 0, -1) + 1)
EndSwitch
EndIf
Next
$aModules[0] = $iMod
DllCall('kernel32.dll', 'int', 'CloseHandle', 'handle', $hOpen[0])
Return $aModules
EndFunc ;==>_ProcessGetModulesExBeschreibung steht im Funktionsheader.
Diese Funktion listet alle geladenen Module in dem Zielprozess auf.
MfG
-
Sehr gut

Aber war es jetzt so nötig in EnumProcessModulesEx, einfach nur ein $iFlag mit zu übergeben?

Wäre ja jetzt nicht so die Hürde für einen, der noch mehr will eben das Flag hinzuzufügen. Aber gut ich glaub ich stell die UDF mal rein in den Skripte Bereích mit special thanks an euch
Hab mal Thread auf gelöst gesetzt

-
@m-obi: Das liegt daran, dass mein RegExp nur alle .dlls gefiltert hat, wobei ja auch andere Dateien als Module geladen werden können. Wenn du das optimierte Script von Großvater nimmst sollte es gehen.
Danke an alle die geholfen haben
-
Prinzipiell hab ich meine Funktion fertig, nur gibt es einen Fehler den ich nicht erkenne:
[autoit]
Wenn man bei $iMode 2 angibt, gibt es einen Error beim StringRegExp, dass es kein Array ist, obwohl ich es mir mit _ArrayDisplay anschauen kann.
Any thoughts?
[/autoit][autoit][/autoit][autoit]
#include-once
#include <Array.au3>
; #FUNCTION# ====================================================================================================================
; Name...........: _ProcessGetModules
; Description....: Retrieves the currently loaded modules in the target process.
; Syntax.........: _ProcessGetModules($iPID, $iMode)
; Parameters.....: $iPID - The PID of the target process.
; $iMode - 1: Retrieves an array with the fullpath of the modules.
; 2: Retrieves an array with the modules only.
; Return values..: Success - An array with the loaded modules.
; Failure - Empty array
; Author.........: [email='pinguin94@autoit.de'][/email]
; Modified.......: -
; Remarks........: Array.au3 needed
; Related........: None
; Link...........: None
; Example........: No
; ===============================================================================================================================
Func _ProcessGetModules($iPID, $iMode = 1)
Local $aModules[1], $aTempLocal $Kernel32 = DllOpen("kernel32.dll")
[/autoit][autoit][/autoit][autoit]
Local $PsAPI = DllOpen("psapi.dll")Local $hOpen = DllCall($Kernel32, "hwnd", "OpenProcess", "int", BitOR(0x0400, 0x0010), "int", 0, "int", $iPID)
[/autoit][autoit][/autoit][autoit]
$hOpen = $hOpen[0]
Local $Struct = DllStructCreate("int[1024]")
$aEnum = DllCall($PsAPI, "int", "EnumProcessModules", "hwnd", $hOpen, "ptr", DllStructGetPtr($Struct), "int", DllStructGetSize($Struct), "int*", 0)
$iMax = $aEnum[4] / 4
For $i = 1 To $iMax
$aTemp = DllCall($PsAPI, "int", "GetModuleFileNameEx", "hwnd", $hOpen, "int", DllStructGetData($Struct, 1, $i), "str", "", "int", 2048)
If $aTemp[3] > "" Then
Switch $iMode
Case 1
_ArrayAdd($aModules, $aTemp[3])
Case 2
$RegExp = StringRegExp($aTemp[3], "\\(\w*).dll", 3) ;Soll alle .dll filtern <-- Error!
_ArrayAdd($aModules, $RegExp[0] & ".dll")
EndSwitch
EndIf
Next
DLLCall($Kernel32, "int", "CloseHandle", "int",$hOpen)
DllClose($Kernel32)
DllClose($PsAPI)Return $aModules
[/autoit]
EndFuncVerbesserungen an der Funktion nehm ich gerne an, die werden direkt umgesetzt.
Vielleicht braucht die Funktion ja wer, damit kann man super Task Manager programmieren, der direkt schaut, welche module geladen sind!
MfG
-
Geht

Dann hab ich ja gar nicht soviel falsch gemacht