Sign in to follow this  
Followers 0
megahyperion

Custom Shpae Gui Function Problem

3 posts in this topic

I tired using the examples here

http://www.autoitscript.com/forum/index.php?showtopic=12827

to make a custom shaped gui but i keep getting the following error

$lppt=DllStructCreat($buffer)

Unknown function name

I have the latest Autoit and even the latest Autoit Beta but still no go.

Any help is aprecited.

Thanks

Share this post


Link to post
Share on other sites



got it

had to take out all the dllstruct stuff

Share this post


Link to post
Share on other sites

try this

#include <GUIConstants.au3>

$GUI = GUICreate("test",300,300,-1,-1,$WS_POPUP)
GUISetBkColor(0xFFFFFF)

; CreatePolyRgn takes an array of points...
; the following goes from
;     0,0 to
;     600,500 to
;     500,800 to
;     100,500 to
;     0,0

$a = CreatePolyRgn("0,0,600,500,500,800,100,500,0,0")
SetWindowRgn($GUI,$a)

$Eggzit = GUICtrlCreateButton("Bye",80,170,60,25)

GUISetState()

While 1
    $msg = GUIGetMsg()
    If $msg = $Eggzit Or $msg = $GUI_EVENT_CLOSE Then Exit
WEnd

Func SetWindowRgn($h_win, $rgn)
    DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $h_win, "long", $rgn, "int", 1)
EndFunc

Func CreatePolyRgn($pt)
    Local $ALTERNATE = 1
    Local $buffer = ""

    $pt = StringSplit($pt,",")
    For $i = 1 to $pt[0]
        $buffer = $buffer & "int;"
    Next
    $buffer = StringTrimRight($buffer,1)
    $lppt = DllStructCreate($buffer)
    For $i = 1 to $pt[0]
        DllStructSetData($lppt,$i,$pt[$i])
    Next
    $ret = DllCall("gdi32.dll","long","CreatePolygonRgn", _
            "ptr",DllStructGetPtr($lppt),"int",Int($pt[0] / 2), _
            "int",$ALTERNATE)
    $lppt = 0
    Return $ret[0]
EndFunc

8)


NEWHeader1.png

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