Positioniern einer Ausgabe mit _Win API_DrawText()

  • Hallo zusammen,

    ich versuche mit der Funktion _WinAPI_DrawText() Texte auszugeben. Dies gelingt grundsätzlich auch gut. Mein Problem ist jedoch, dass die Ausgabe immer links oben auf einem Blatt beginnt.
    Wie kann ich steuern, dass die Ausgabe mit _WinAPI_DrawText() an einer von mir gewünschten, beliebigen Stelle des Ausgabemediums erfolgt ?

    Bereits jetzt danke für jeden Hinweis zur Lösung.

    Gruß

    Ynkelonium

    Einmal editiert, zuletzt von Ynkelonium (20. April 2009 um 13:23)

  • Danke für den Hinweis - diese Hilfe bzw. Beispiel habe ich aber leider noch nicht gefunden / entdeckt.

    Welche Hilfe und welches Beispiel meinst du also ? Wo und wie finde ich das ??

    Danke

    Ynkelonium

  • HI!

    Ich denke er meinte den in der Autoit Hilfe.

    Spoiler anzeigen
    [autoit][/autoit] [autoit][/autoit] [autoit]

    #include <WinAPI.au3>
    #include <WindowsConstants.au3>
    #include <FontConstants.au3>

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

    Global $tRECT, $hFont, $hOldFont, $hDC

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

    HotKeySet("{ESC}", "_Exit")

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

    $tRECT = DllStructCreate($tagRect)
    DllStructSetData($tRECT, "Left", 5)
    DllStructSetData($tRECT, "Top", 5)
    DllStructSetData($tRECT, "Right", 250)
    DllStructSetData($tRECT, "Bottom", 50)

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

    $hDC = _WinAPI_GetDC(0)
    $hFont = _WinAPI_CreateFont(50, 0, 0, 0, 400, False, False, False, $DEFAULT_CHARSET, _
    $OUT_DEFAULT_PRECIS, $CLIP_DEFAULT_PRECIS, $DEFAULT_QUALITY, 0, 'Arial')
    $hOldFont = _WinAPI_SelectObject($hDC, $hFont)

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

    _WinAPI_SetTextColor($hDC, 0x0000FF)
    _WinAPI_SetBkColor($hDC, 0x000000)
    ; comment next line to get black background instead of transparent one
    _WinAPI_SetBkMode($hDC, $TRANSPARENT)

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

    While 1
    _WinAPI_DrawText($hDC, "Hello world!", $tRECT, $DT_CENTER)
    Sleep(100)
    WEnd

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

    Func _Exit()
    _WinAPI_SelectObject($hDC, $hOldFont)
    _WinAPI_DeleteObject($hFont)
    _WinAPI_ReleaseDC(0, $hDC)
    _WinAPI_InvalidateRect(0, 0)
    $tRECT = 0
    Exit
    EndFunc ;==>_Exit

    [/autoit]

    If not :?: then ?( else :thumbup: