GUI immer in den Hintergrund stellen? | GDI+ Strings weicher rendern (AA)

  • Hallo Com,

    die Lage ist wie folgt:
    Seit längerem benutze ich, für die die es kennen das Desktop-Erweiterungsprogramm "Rainmeter". Nun möchte ich es durch eine eigene GUI mit ein paar Funktionen erweitern. Das ganze ist ansich auch schon fertig, nur fehlt noch eine Eigenschaft: Und zwar soll die GUI immer im Hintergrund sein, das heisst selbst wenn man drauf klickt sollen andere Fenster diese GUI noch überlappen.

    [Blockierte Grafik: http://s1.directupload.net/images/120922/t7o3ccup.png]

    Rechts die GUI, so wie es links ist (Rainmeter) soll es sein..


    Ausserdem wollte ich nachfragen wie ich Strings, die per GDI+ gezeichnet werden weicher zeichnen kann (Antialiasing). Ich hab schon alle Varianten mit _GDIPlus_GraphicsSetSmoothingMode die mir eingefallen sind benutzt, aber es hat nie etwas verändert. Wo muss die Funktion hin ?

    [autoit]

    $graphic = _GDIPlus_GraphicsCreateFromHWND($hwnd)

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

    For $i = 1 To $dat[0][0]
    _GDIPlus_GraphicsDrawStringColor($graphic,$dat[$i][0],$dat[$i][1],$dat[$i][2],$link_font,$link_size,0,$link_color)
    ; _GDIPlus_GraphicsDrawStringColor(Grafik-Handle,Text,X-Position,Y-Position,Schriftart,Schriftgröße,FormatFarbe)
    Next

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

    ; ...

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

    Func _GDIPlus_GraphicsDrawStringColor($hGraphics, $sString, $nX, $nY, $sFont = "Arial", $nSize = 10, $iFormat = 0, $iBrush = 0xFF000000)
    Local $hBrush, $iError, $hFamily, $hFont, $hFormat, $aInfo, $tLayout, $bResult
    $hBrush = _GDIPlus_BrushCreateSolid($iBrush)
    $hFormat = _GDIPlus_StringFormatCreate($iFormat)
    $hFamily = _GDIPlus_FontFamilyCreate($sFont)
    $hFont = _GDIPlus_FontCreate($hFamily, $nSize)
    $tLayout = _GDIPlus_RectFCreate($nX, $nY, 0, 0)
    $aInfo = _GDIPlus_GraphicsMeasureString($hGraphics, $sString, $hFont, $tLayout, $hFormat)
    $bResult = _GDIPlus_GraphicsDrawStringEx($hGraphics, $sString, $hFont, $aInfo[0], $hFormat, $hBrush)
    $iError = @error
    _GDIPlus_FontDispose($hFont)
    _GDIPlus_FontFamilyDispose($hFamily)
    _GDIPlus_StringFormatDispose($hFormat)
    _GDIPlus_BrushDispose($hBrush)
    Return SetError($iError, 0, $bResult)
    EndFunc ;==> _GDIPlus_GraphicsDrawStringColor()

    [/autoit]

    Einmal editiert, zuletzt von Jantastic (23. September 2012 um 17:48)

  • Die GUI immer im Hintergrund:

    Spoiler anzeigen
    [autoit]


    ;code by eukalyptus
    #include <WindowsConstants.au3>

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

    Opt("GuiOnEventMode", 1)

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

    Global $hGui = GUICreate("Test", 640, 480)
    GUISetOnEvent(-3, "_Exit")
    GUIRegisterMsg($WM_WINDOWPOSCHANGING, "_WM_WINDOWPOSCHANGING")
    GUISetState()

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

    While 1
    Sleep(100)
    WEnd

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

    Func _WM_WINDOWPOSCHANGING($hWnd, $iMsg, $wParam, $lParam)
    Local $tPos = DllStructCreate("hwnd hwnd;hwnd InsertAfter;int x;int y;int cx;int cy;uint flags", $lParam)
    DllStructSetData($tPos, "InsertAfter", 1)
    EndFunc ;==>_WM_WINDOWPOSCHANGING

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

    Func _Exit()
    Exit
    EndFunc ;==>_Exit

    [/autoit]

    Und Font Smoothing:

    [autoit]


    $graphic = _GDIPlus_GraphicsCreateFromHWND($hwnd)
    _GDIPlus_GraphicsSetSmoothingMode($graphic, 2)
    DllCall($ghGDIPDll, "uint", "GdipSetTextRenderingHint", "handle", $graphic, "int", 4)

    [/autoit]

    Gruß,
    UEZ

    Auch am Arsch geht ein Weg vorbei...

    ¯\_(ツ)_/¯