Sign in to follow this  
Followers 0
themax90

Unable to use _GUIHole with _GUIRoundCorners

5 posts in this topic

Local $Pos = MouseGetPos()
    $ColorGUI = GUICreate("Color", @DesktopWidth/8, @DesktopHeight/8, $Pos[0], $Pos[1])
    _GuiRoundCorners ($ColorGUI, 0, 0, @DesktopWidth/4, @DesktopHeight/4)
    _GuiHole($ColorGUI, 10, 10, @DesktopWidth/4)
    GUISetState()

Func _GuiHole($h_win, $i_x, $i_y, $i_size)
   Dim $pos, $outer_rgn, $inner_rgn, $wh, $combined_rgn, $ret
   $pos = WinGetPos($h_win)
  
   $outer_rgn = DllCall("gdi32.dll", "long", "CreateRectRgn", "long", 0, "long", 0, "long", $pos[2], "long", $pos[3])
    If IsArray($outer_rgn) Then
        $inner_rgn = DllCall("gdi32.dll", "long", "CreateEllipticRgn", "long", $i_x, "long", $i_y, "long", $i_x + $i_size, "long", $i_y + $i_size)
        If IsArray($inner_rgn) Then
            $combined_rgn = DllCall("gdi32.dll", "long", "CreateRectRgn", "long", 0, "long", 0, "long", 0, "long", 0)
            If IsArray($combined_rgn) Then
                DllCall("gdi32.dll", "long", "CombineRgn", "long", $combined_rgn[0], "long", $outer_rgn[0], "long", $inner_rgn[0], "int", 4)
                $ret = DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $h_win, "long", $combined_rgn[0], "int", 1)
                If $ret[0] Then
                    Return 1
                Else
                    Return 0
                EndIf
            Else
                Return 0
            EndIf
        Else
            Return 0
        EndIf
    Else
        Return 0
    EndIf
  
EndFunc ;==>_GuiHole
Func _GuiRoundCorners($h_win, $i_x1, $i_y1, $i_x3, $i_y3)
; Written by gafrost.
    Local $XS_pos, $XS_ret, $XS_ret2
    $XS_pos = WinGetPos($h_win)
    $XS_ret = DllCall("gdi32.dll", "long", "CreateRoundRectRgn", "long", $i_x1, "long", $i_y1, "long", $XS_pos[2], "long", $XS_pos[3], "long", $i_x3, "long", $i_y3)
    If $XS_ret[0]Then
        $XS_ret2 = DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $h_win, "long", $XS_ret[0], "int", 1)
    EndIf
EndFunc  ;==>_GuiRoundCorners

Disables the effect of the other. Bug works vice-versa.

Share this post


Link to post
Share on other sites



Moved to Support, I believe you would have to create your own custom function which combines the two.


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

Bump. I don't know much about GUI manipulation - can anyone make a combined function real quick for me.

Share this post


Link to post
Share on other sites

Bump. I don't know much about GUI manipulation - can anyone make a combined function real quick for me.

www.rentacoder.com

Share this post


Link to post
Share on other sites

www.rentacoder.com
Perhaps if someone were to request a program with specific functions, but in this case, I really don't think that was necessary. From what I have read from AutoitSmiths posts, he's not a GUI-expert, but a TCP-IP expert <_< .

Kurt


Awaiting Diablo III..

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0