1. Dashboard
  2. Mitglieder
    1. Letzte Aktivitäten
    2. Benutzer online
    3. Team
    4. Mitgliedersuche
  3. Forenregeln
  4. Forum
    1. Unerledigte Themen
  • Anmelden
  • Registrieren
  • Suche
Alles
  • Alles
  • Artikel
  • Seiten
  • Forum
  • Erweiterte Suche
  1. AutoIt.de - Das deutschsprachige Forum.
  2. Mitglieder
  3. PenGuin

Beiträge von PenGuin

  • 2 ToolTips gleichzeitig anzeigen

    • PenGuin
    • 21. Oktober 2010 um 23:20

    Einfach beide ToolTips hintereinander hinschreiben 8|
    Der User merkt doch die Millisekunde dazwischen gar nicht :o

  • Doppelte Zahlen

    • PenGuin
    • 21. Oktober 2010 um 02:43

    Hab hier mal ne Funktion gebastelt. Vllt. nicht optimal programmiert, aber sie funktioniert :D

    [autoit]

    Func _ListDoubleNumbers($sText)
    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

    [/autoit]
  • GUISetOnEvent vs. GUIGetMsg

    • PenGuin
    • 21. Oktober 2010 um 02:20

    Ansonsten gibts ja auch noch sowas wie wm_command, falls man ein wichtiges Ereignis abfangen will, fast wie ein interupt in asm ;)

  • h2au3

    • PenGuin
    • 19. Oktober 2010 um 21:12

    :O

    Ziemlich geniales Programm!

  • Welche Schleife muss ich hier nehmen ?

    • PenGuin
    • 19. Oktober 2010 um 13:33
    Zitat von AspirinJunkie

    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... :D )

    Wenn du die Zeit "Perfekt" meinst, dann waren es gar nicht soviele. Nämlilch haste genau 1 mal Perfekt benutzt, der Rest ist Konjunktiv :D
    Das musste ich mal eben gesagt haben :D
    /Deutsch-besser-wisser off


    Und für Fragen sind wir ja da, wenn wir genug Eigenleistung sehen ;)

  • Spoiler UDF

    • PenGuin
    • 17. Oktober 2010 um 19:38

    Wie gesagt, erst Anfangsphase ;)

  • Alle Möglichkeiten von Buchstaben anzeigen

    • PenGuin
    • 17. Oktober 2010 um 18:52

    Da würde es 7 hoch 7 Möglichkeiten geben (richtig gerechnet? :D)
    Glaub ich ziemlich schwer realisierbar^^

  • Spoiler UDF

    • PenGuin
    • 17. Oktober 2010 um 18:44

    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")
    Global $GDIInfoStruct = DLLStructCreate("int Graphic; int Brush; int Format; int Font; int Family")
    Global $sDataButtonState = 1
    Global $Spoilertext = ""

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Func _Spoiler_StartUp($hWnd)
    _GDIPlus_Startup()
    $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hWnd)
    AdlibRegister("__Redraw", 500)
    DLLStructSetData($GDIInfoStruct, 1, $hGraphic)
    EndFunc

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Func _Spoiler_Create($hWnd, $sText, $sFont, $iSize, $iX, $iY, $iWidth, $iHeight)
    GUIRegisterMsg(0x000F, "__Redraw")
    GUIRegisterMsg(0x0111, "__Handler")

    [/autoit] [autoit][/autoit] [autoit]

    $hLabel = GUICtrlCreateLabel("Spoiler:", $iX, $iY)
    GUICtrlSetFont(-1, 8.5, 800)
    $aPos = ControlGetPos($hWnd, "", $hLabel)
    $hButtonSpoiler = GUICtrlCreateButton("hide", $iX + $aPos[2] + 2, $iY - ($aPos[3] / 5))
    GUICtrlSetFont(-1, 7.5)

    [/autoit] [autoit][/autoit] [autoit]

    DLLStructSetData($SpoilerInfoStruct, 1, $hWnd)
    DLLStructSetData($SpoilerInfoStruct, 2, $hButtonSpoiler)
    DLLStructSetData($SpoilerInfoStruct, 3, $iX)
    DLLStructSetData($SpoilerInfoStruct, 4, $iY + $aPos[3])
    DLLStructSetData($SpoilerInfoStruct, 5, $iWidth)
    DLLStructSetData($SpoilerInfoStruct, 6, $iHeight)

    [/autoit] [autoit][/autoit] [autoit]

    _GDIPlus_GraphicsDrawRect(DLLStructGetData($GDIInfoStruct, 1), _
    DLLStructGetData($SpoilerInfoStruct, 3), _
    DLLStructGetData($SpoilerInfoStruct, 4), _
    DLLStructGetData($SpoilerInfoStruct, 5), _
    DLLStructGetData($SpoilerInfoStruct, 6))

    [/autoit] [autoit][/autoit] [autoit]

    $Spoilertext &= $sText

    [/autoit] [autoit][/autoit] [autoit]

    $hGraphic = DLLStructGetData($GDIInfoStruct, 1)

    [/autoit] [autoit][/autoit] [autoit]

    $hBrush = _GDIPlus_BrushCreateSolid(0xFF000000)
    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)
    EndFunc

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Func _Spoiler_Shutdown()
    $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()
    EndFunc

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Func __Redraw()
    If $sDataButtonState = 1 Then
    _GDIPlus_GraphicsDrawRect(DLLStructGetData($GDIInfoStruct, 1), _
    DLLStructGetData($SpoilerInfoStruct, 3), _
    DLLStructGetData($SpoilerInfoStruct, 4), _
    DLLStructGetData($SpoilerInfoStruct, 5), _
    DLLStructGetData($SpoilerInfoStruct, 6))

    [/autoit] [autoit][/autoit] [autoit]

    __DrawString($Spoilertext)
    EndIf
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func __Handler($hWnd, $nMsg, $wParam, $lParam)
    $hButton = GUICtrlGetHandle(DLLStructGetData($SpoilerInfoStruct, 2))
    If $lParam = $hButton Then
    __StateHandler()
    EndIf
    EndFunc

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Func __StateHandler()
    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
    EndFunc

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    Func __DrawString($sText)
    $tLayout = _GDIPlus_RectFCreate(DLLStructGetData($SpoilerInfoStruct, 3), _
    DLLStructGetData($SpoilerInfoStruct, 4), _
    DLLStructGetData($SpoilerInfoStruct, 5), _
    DLLStructGetData($SpoilerInfoStruct, 6))

    [/autoit] [autoit][/autoit] [autoit]

    $aInfo = _GDIPlus_GraphicsMeasureString(DLLStructGetData($GDIInfoStruct, 1), $sText, DLLStructGetData($GDIInfoStruct, 4), $tLayout, DLLStructGetData($GDIInfoStruct, 3))
    _GDIPlus_GraphicsDrawStringEx(DLLStructGetData($GDIInfoStruct, 1), $sText, DLLStructGetData($GDIInfoStruct, 4), $aInfo[0], DLLStructGetData($GDIInfoStruct, 3), DLLStructGetData($GDIInfoStruct, 2))
    EndFunc

    [/autoit]


    Und hier das Testscript:

    Spoiler anzeigen
    [autoit]

    #include <GDIPlus.au3>
    #include <SpoilerUDF.au3>

    [/autoit] [autoit][/autoit] [autoit]

    $Form1 = GUICreate("Form1", 400, 400, 448, 225)
    GUISetState(@SW_SHOW)

    [/autoit] [autoit][/autoit] [autoit]

    $StartUp = _Spoiler_StartUp($Form1)
    $Label1 = _Spoiler_Create($Form1, "Test", "Arial", 12, 50,50, 200, 200)

    [/autoit] [autoit][/autoit] [autoit]

    Do
    Sleep(50)
    Until GUIGetMsg() = -3

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    _Spoiler_Shutdown()

    [/autoit]


    Bugs dürfen genannt werden! :D
    Ich hoffe es gefällt euch :)

    MfG

  • gemeinsame Variable oder Programmschnittstelle zur selbstständigen Zusammenarbeit meiner Programme machen

    • PenGuin
    • 17. Oktober 2010 um 16:47

    Aber Andy $Struct ist doch im 2. Script nicht mehr definiert, d.h. man müsste irgendwie den Speicher auslesen, denn man mit Virtual Alloc Ex freigegeben hat...

  • gemeinsame Variable oder Programmschnittstelle zur selbstständigen Zusammenarbeit meiner Programme machen

    • PenGuin
    • 17. Oktober 2010 um 16:21

    Andy:
    VirtualAllocEx oder wie meinste das?

  • WinList - vorhandene Fenster rausfiltern

    • PenGuin
    • 13. Oktober 2010 um 21:19
    Zitat von mipez

    Das IsVisible muss man allerdings auf _WinAPI_IsWindowVisible(...) umändern...


    Woher hast du das denn 8|

  • Label anzeigen

    • PenGuin
    • 13. Oktober 2010 um 21:15

    Mach mal ein Bild davon wie du Window Info Tool offen hast und dieses OBD!
    Vielleicht findet man dann den Fehler...

  • DllCall

    • PenGuin
    • 13. Oktober 2010 um 17:51
    [autoit]

    Global $hUser32 = DllOpen("user32.dll")
    Global $pCallBack = DllCallbackRegister("_EnumWindows", "int", "hwnd;lParam")

    [/autoit][autoit][/autoit][autoit]

    Do
    DllCall($hUser32, "int", "EnumWindows", "ptr", DllCallbackGetPtr($pCallBack), "lparam", 0)
    Sleep(50)
    Until False
    DllClose($hUser32)
    DllCallbackFree($pCallBack)

    [/autoit][autoit][/autoit][autoit]

    Func _EnumWindows($hWnd, $lParam)
    ;deine function
    EndFunc

    [/autoit]
  • _ProcessGetModulesEx()

    • PenGuin
    • 13. Oktober 2010 um 17:25

    Habs mal geändert ;)

  • _ProcessGetModulesEx()

    • PenGuin
    • 13. Oktober 2010 um 14:50

    Hab noch paar Fehlerabfragen eingebaut ;)

  • _ProcessGetModulesEx()

    • PenGuin
    • 13. Oktober 2010 um 14:21

    Hier die Funktion von mir, optimiert und erweitert durch Kleiner und Großvater :)

    [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 ;==>_ProcessGetModulesEx

    [/autoit]

    Beschreibung steht im Funktionsheader.

    Diese Funktion listet alle geladenen Module in dem Zielprozess auf.


    MfG

  • Arrayfehler in Funktion

    • PenGuin
    • 13. Oktober 2010 um 14:09

    Sehr gut :)

    Aber war es jetzt so nötig in EnumProcessModulesEx, einfach nur ein $iFlag mit zu übergeben? :P
    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 :D

    Hab mal Thread auf gelöst gesetzt ;)

  • Arrayfehler in Funktion

    • PenGuin
    • 13. Oktober 2010 um 12:59

    @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 :)

  • Arrayfehler in Funktion

    • PenGuin
    • 13. Oktober 2010 um 04:00

    Prinzipiell hab ich meine Funktion fertig, nur gibt es einen Fehler den ich nicht erkenne:
    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]


    #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], $aTemp

    [/autoit][autoit][/autoit][autoit]

    Local $Kernel32 = DllOpen("kernel32.dll")
    Local $PsAPI = DllOpen("psapi.dll")

    [/autoit][autoit][/autoit][autoit]

    Local $hOpen = DllCall($Kernel32, "hwnd", "OpenProcess", "int", BitOR(0x0400, 0x0010), "int", 0, "int", $iPID)
    $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)

    [/autoit][autoit][/autoit][autoit]

    Return $aModules
    EndFunc

    [/autoit]

    Verbesserungen 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! :D

    MfG

  • provlem mit DLL

    • PenGuin
    • 12. Oktober 2010 um 20:00

    Geht :)
    Dann hab ich ja gar nicht soviel falsch gemacht :D

Spenden

Jeder Euro hilft uns, Euch zu helfen.

Download

AutoIt Tutorial
AutoIt Buch
Onlinehilfe
AutoIt Entwickler
  1. Datenschutzerklärung
  2. Impressum
  3. Shoutbox-Archiv
Community-Software: WoltLab Suite™