hot202 Posted August 22, 2009 Share Posted August 22, 2009 (edited) hi is there anyway to mae it so that _GuiRoundCorners cuts the corner not round it like so it makes the corner of the gui a 45 cut on a corner? Func _GuiRoundCorners($h_win, $i_x1, $i_y1, $i_x3, $i_y3) Dim $pos, $ret, $ret2 $pos = WinGetPos($h_win) $ret = DllCall("gdi32.dll", "long", "CreateRoundRectRgn", "long", $i_x1, "long", $i_y1, "long", $pos[2], "long", $pos[3], "long", $i_x3, "long", $i_y3) If $ret[0] Then $ret2 = DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $h_win, "long", $ret[0], "int", 1) If $ret2[0] Then Return 1 Else Return 0 EndIf Else Return 0 EndIf EndFunc Edited August 22, 2009 by hot202 Link to comment Share on other sites More sharing options...
Yashied Posted August 22, 2009 Share Posted August 22, 2009 #Include <WindowsConstants.au3> $hForm = GUICreate('MyGUI', 400, 400, -1, -1, $WS_POPUP) _GuiRoundCorners($hForm, 0, 0, 100, 100) GUISetState() Do Until GUIGetMsg() = -3 Func _GuiRoundCorners($h_win, $i_x1, $i_y1, $i_x3, $i_y3) Dim $pos, $ret, $ret2 $pos = WinGetPos($h_win) $ret = DllCall("gdi32.dll", "long", "CreateRoundRectRgn", "long", $i_x1, "long", $i_y1, "long", $pos[2], "long", $pos[3], "long", $i_x3, "long", $i_y3) If $ret[0] Then $ret2 = DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $h_win, "long", $ret[0], "int", 1) If $ret2[0] Then Return 1 Else Return 0 EndIf Else Return 0 EndIf EndFunc ;==>_GuiRoundCorners My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
hot202 Posted August 22, 2009 Author Share Posted August 22, 2009 no i mean how to i get it to do a cut not round? like a angle \ on the corner Link to comment Share on other sites More sharing options...
hot202 Posted August 22, 2009 Author Share Posted August 22, 2009 like that on the corner?can it be done? Link to comment Share on other sites More sharing options...
Yashied Posted August 22, 2009 Share Posted August 22, 2009 (edited) like that on the corner?can it be done? Play with follows. #Include <WindowsConstants.au3> Global Const $ALTERNATE = 1 Global Const $WINDING = 2 $hForm = GUICreate('MyGUI', 400, 400, -1, -1, $WS_POPUP) GUISetBkColor(0x880000) $tPOINT = DllStructCreate('int[2];int[2];int[2];int[2];int[2];int[2];int[2];int[2]') DllStructSetData($tPOINT, 1, 0, 1) DllStructSetData($tPOINT, 1, 40, 2) DllStructSetData($tPOINT, 2, 40, 1) DllStructSetData($tPOINT, 2, 0, 2) DllStructSetData($tPOINT, 3, 360, 1) DllStructSetData($tPOINT, 3, 0, 2) DllStructSetData($tPOINT, 4, 400, 1) DllStructSetData($tPOINT, 4, 40, 2) DllStructSetData($tPOINT, 5, 400, 1) DllStructSetData($tPOINT, 5, 360, 2) DllStructSetData($tPOINT, 6, 360, 1) DllStructSetData($tPOINT, 6, 400, 2) DllStructSetData($tPOINT, 7, 40, 1) DllStructSetData($tPOINT, 7, 400, 2) DllStructSetData($tPOINT, 8, 0, 1) DllStructSetData($tPOINT, 8, 360, 2) $Ret = DllCall('gdi32.dll', 'ptr', 'CreatePolygonRgn', 'ptr', DllStructGetPtr($tPOINT), 'int', 8, 'int', $ALTERNATE) DllCall('user32.dll', 'int', 'SetWindowRgn', 'hwnd', $hForm, 'ptr', $Ret[0], 'int', 1) GUISetState() Do Until GUIGetMsg() = -3 Edited August 22, 2009 by Yashied My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
hot202 Posted August 22, 2009 Author Share Posted August 22, 2009 wow thanks so much. also how would i change it to only do it 2 the top right corner and bottom left? Link to comment Share on other sites More sharing options...
Yashied Posted August 22, 2009 Share Posted August 22, 2009 wow thanks so much. also how would i change it to only do it 2 the top right corner and bottom left? #Include <WindowsConstants.au3> Global Const $ALTERNATE = 1 Global Const $WINDING = 2 $hForm = GUICreate('MyGUI', 400, 400, -1, -1, $WS_POPUP) GUISetBkColor(0x880000) $tPOINT = DllStructCreate('int[2];int[2];int[2];int[2];int[2];int[2]') DllStructSetData($tPOINT, 1, 0, 1) DllStructSetData($tPOINT, 1, 0, 2) DllStructSetData($tPOINT, 2, 360, 1) DllStructSetData($tPOINT, 2, 0, 2) DllStructSetData($tPOINT, 3, 400, 1) DllStructSetData($tPOINT, 3, 40, 2) DllStructSetData($tPOINT, 4, 400, 1) DllStructSetData($tPOINT, 4, 400, 2) DllStructSetData($tPOINT, 5, 40, 1) DllStructSetData($tPOINT, 5, 400, 2) DllStructSetData($tPOINT, 6, 0, 1) DllStructSetData($tPOINT, 6, 360, 2) $Ret = DllCall('gdi32.dll', 'ptr', 'CreatePolygonRgn', 'ptr', DllStructGetPtr($tPOINT), 'int', 6, 'int', $ALTERNATE) DllCall('user32.dll', 'int', 'SetWindowRgn', 'hwnd', $hForm, 'ptr', $Ret[0], 'int', 1) GUISetState() Do Until GUIGetMsg() = -3 KeeperOfTheReaper 1 My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
Yashied Posted August 22, 2009 Share Posted August 22, 2009 Red star! >_< expandcollapse popup#Include <GUIConstantsEx.au3> #Include <WinAPI.au3> #Include <WindowsConstants.au3> Global $aPoint[10][2] = [[0, 180], [190, 180], [250, 0], [308, 180], [500, 180], [344, 294], [404, 475], [250, 362], [94, 475], [154, 294]] $hForm = GUICreate('MyGUI', 500, 475, -1, -1, $WS_POPUP, $WS_EX_TOPMOST) $Button = GUICtrlCreateButton('Exit', 215, 255, 70, 23) GUIRegisterMsg($WM_NCHITTEST, 'WM_NCHITTEST') GUISetBkColor(0xAA0000) $hRgn = _WinAPI_CreatePolygonRgn($aPoint) _WinAPI_SetWindowRgn($hForm, $hRgn) GUISetState() Do Until GUIGetMsg() = $Button Func _WinAPI_CreatePolygonRgn($aPoint, $iStart = 0, $iEnd = -1, $iMode = 1) If UBound($aPoint, 2) < 2 Then Return SetError(1, 0, 0) EndIf Local $Count, $tData, $Struct = '' If ($iEnd < 0) Or ($iEnd > UBound($aPoint) - 1) Then $iEnd = UBound($aPoint) - 1 EndIf For $i = $iStart To $iEnd $Struct &= 'int[2];' Next $tData = DllStructCreate(StringTrimRight($Struct, 1)) If @error Then Return SetError(1, 0, 0) EndIf $Count = 1 For $i = $iStart To $iEnd For $j = 0 To 1 DllStructSetData($tData, $Count, $aPoint[$i][$j], $j + 1) Next $Count += 1 Next Local $Ret = DllCall('gdi32.dll', 'ptr', 'CreatePolygonRgn', 'ptr', DllStructGetPtr($tData), 'int', $Count - 1, 'int', $iMode) If (@error) Or ($Ret[0] = 0) Then Return SetError(1, 0, 0) EndIf Return $Ret[0] EndFunc ;==>_WinAPI_CreatePolygonRgn Func WM_NCHITTEST($hWnd, $Msg, $wParam, $lParam) If _WinAPI_DefWindowProc($hWnd, $Msg, $wParam, $lParam) = $HTCLIENT Then Return $HTCAPTION EndIf Return $GUI_RUNDEFMSG EndFunc ;==>WM_NCHITTEST KeeperOfTheReaper 1 My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
CodyBarrett Posted August 22, 2009 Share Posted August 22, 2009 lol nice XD [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size] Link to comment Share on other sites More sharing options...
picea892 Posted August 23, 2009 Share Posted August 23, 2009 Hi Yashied The red star is very nice. I also like the red maple leaf..... PS: Watch the line wrap expandcollapse popup#Include <GUIConstantsEx.au3> #Include <WinAPI.au3> #Include <WindowsConstants.au3> Global $aPoint[25][2] = [[196, 31], [220, 92], [258, 77], [248, 158], [295, 125], [307, 157], [357, 149], [326, 206], [357, 214], [271, 273], [282, 296], [202, 282], [200, 361], [188, 360], [188, 280], [109, 295], [122, 276], [34, 214], [62, 204], [37, 152], [84, 156], [97, 122], [143, 156], [132, 75], [170, 89]] $hForm = GUICreate('MyGUI', 500, 475, -1, -1, $WS_POPUP, $WS_EX_TOPMOST) $Button = GUICtrlCreateButton('Exit', 160, 160, 70, 23) GUIRegisterMsg($WM_NCHITTEST, 'WM_NCHITTEST') GUISetBkColor(0xAA0000) $hRgn = _WinAPI_CreatePolygonRgn($aPoint) _WinAPI_SetWindowRgn($hForm, $hRgn) GUISetState() Do Until GUIGetMsg() = $Button Func _WinAPI_CreatePolygonRgn($aPoint, $iStart = 0, $iEnd = -1, $iMode = 1) If UBound($aPoint, 2) < 2 Then Return SetError(1, 0, 0) EndIf Local $Count, $tData, $Struct = '' If ($iEnd < 0) Or ($iEnd > UBound($aPoint) - 1) Then $iEnd = UBound($aPoint) - 1 EndIf For $i = $iStart To $iEnd $Struct &= 'int[2];' Next $tData = DllStructCreate(StringTrimRight($Struct, 1)) If @error Then Return SetError(1, 0, 0) EndIf $Count = 1 For $i = $iStart To $iEnd For $j = 0 To 1 DllStructSetData($tData, $Count, $aPoint[$i][$j], $j + 1) Next $Count += 1 Next Local $Ret = DllCall('gdi32.dll', 'ptr', 'CreatePolygonRgn', 'ptr', DllStructGetPtr($tData), 'int', $Count - 1, 'int', $iMode) If (@error) Or ($Ret[0] = 0) Then Return SetError(1, 0, 0) EndIf Return $Ret[0] EndFunc ;==>_WinAPI_CreatePolygonRgn Func WM_NCHITTEST($hWnd, $Msg, $wParam, $lParam) If _WinAPI_DefWindowProc($hWnd, $Msg, $wParam, $lParam) = $HTCLIENT Then Return $HTCAPTION EndIf Return $GUI_RUNDEFMSG EndFunc ;==>WM_NCHITTEST KeeperOfTheReaper 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now