Teil von Fenster ausblenden

  • Hallo Forum,

    gibt es eine Möglichkeit nur einen Teil von einem Fenster aus zu blenden? also das ich praktisch von x=0 bis x=50 das Fenster nicht mehr sehe? Brauche es für ein Script welches ein Fenster zum Bildschirmrand "raussliden" lässt. Problem ist jetzt nur das es bei 2 Monitoren einfach von einem Monitor in den anderen slidet (logisch).
    Resizen will ich nicht weil das sieht dann so komisch aus ;)

    Grüße ErrorKid

  • Problem gelöst!
    Mit der Funktion _GUICtreateInvRect(), ein paar wingetpos() abfragen und ein paar kleinen Berechnungen war es gar nicht so schwer.
    Die Funktion hab ich irgendwo hier aus dem Forum rausgekramt, weiß leider nicht mehr von wem aber es ist nicht meine. Für alle die ein ähnliches Problem haben häng ich sie aber trotzdem noch mit an:

    [autoit]

    Func _GUICreateInvRect($hwnd, $l, $t, $w, $h)
    $pos = WinGetPos($hwnd)

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

    $1 = 0
    $2 = 0
    $3 = $pos[2]
    $4 = $t
    $ret = DllCall("gdi32.dll", "long", "CreateRectRgn", "long", $1, "long", $2, "long", $3, "long", $4)
    $1 = 0
    $2 = 0
    $3 = $l
    $4 = $pos[3]
    $ret2 = DllCall("gdi32.dll", "long", "CreateRectRgn", "long", $1, "long", $2, "long", $3, "long", $4)
    $1 = $l + $w
    $2 = 0
    $3 = $pos[2]
    $4 = $pos[3]
    $ret3 = DllCall("gdi32.dll", "long", "CreateRectRgn", "long", $1, "long", $2, "long", $3, "long", $4)
    $1 = 0
    $2 = $t + $h
    $3 = $pos[2]
    $4 = $pos[3]
    $ret4 = DllCall("gdi32.dll", "long", "CreateRectRgn", "long", $1, "long", $2, "long", $3, "long", $4)

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

    DllCall("gdi32.dll", "long", "CombineRgn", "long", $ret[0], "long", $ret[0], "long", $ret2[0], "int", 2)
    DllCall("gdi32.dll", "long", "CombineRgn", "long", $ret[0], "long", $ret[0], "long", $ret3[0], "int", 2)
    DllCall("gdi32.dll", "long", "CombineRgn", "long", $ret[0], "long", $ret[0], "long", $ret4[0], "int", 2)
    DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $hwnd, "long", $ret[0], "int", 1)
    EndFunc ;==>_GUICreateInvRect

    [/autoit]

    Weiß nicht was mitm Forum los is aber er macht mir keine Zeilenumbrüche:
    http://pastebin.com/tQ3Gh7et

    4 Mal editiert, zuletzt von ErrorKid (5. Juli 2012 um 16:18)

  • Ich muss sagen, die Variablen sind sehr aussagekräftig 8|

    Nicht meins, C & P aber ich kann dir sagen :
    _GUICreateInvRect($hwnd, $l, $t, $w, $h)
    $hwnd = Handle zu dem Fenster indem man ein "loch" machen möchte
    $l = linker Abstand im Fenster ab den das Rechteck beginnt
    $t = obiger Abstand ab dem das Rechteck beginnt
    $w = Breite des Rechtecks
    $h = Höhe des Rechtecks