Jump to content



Photo

Round Corners


  • Please log in to reply
13 replies to this topic

#1 GaryFrost

GaryFrost

    I don't need your attitude. I have one of my own

  • Developers
  • 7,854 posts

Posted 13 June 2005 - 01:17 PM

Thought some might be interested in this:

Test Script
#include <GuiConstants.au3> $my_gui = GuiCreate("MyGUI", 392, 323) _GuiRoundCorners($my_gui, 0, 0, 50, 50) GuiSetState() While 1     $msg = GuiGetMsg()     Select     Case $msg = $GUI_EVENT_CLOSE         ExitLoop     Case Else     ;;;     EndSelect WEnd Exit


Function to round the corners of a window:

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

Edited by gafrost, 13 June 2005 - 01:26 PM.

SciTE for AutoItDirections for Submitting Standard UDFs

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






#2 buzz44

buzz44

    Seriously funny.

  • Active Members
  • PipPipPipPipPipPip
  • 1,388 posts

Posted 13 June 2005 - 02:10 PM

*Very cool*. I'm using this one already. Yet another useful function from gafrost :(.
Old Projects:A3MORGB2HexOld Functions:_TimeAdd/_TimeSub_AddComma_BubbleSort _RippleSort "He who does not understand your silence will probably not understand your words." - Elbert Hubbard.

#3 Josbe

Josbe

    Infrequent ghost ☺

  • Active Members
  • PipPipPipPipPipPip
  • 1,585 posts

Posted 13 June 2005 - 03:34 PM

Interesting. Some days ago, I was looking something like this, to work with regions, that it offers nice possibilities for windows.
Nice example. :(

#4 Mosquitos

Mosquitos

    Prodigy

  • Active Members
  • PipPipPip
  • 174 posts

Posted 13 June 2005 - 04:21 PM

Wow cool :(
Next month we can maybe make something like this batman skin from mediaplayer :(
Sapiente vince, rex, noli vincere ferro!

#5 blindwig

blindwig

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 772 posts

Posted 13 June 2005 - 04:48 PM

Wow cool  :(
Next month we can maybe make something like this batman skin from mediaplayer  :(

<{POST_SNAPBACK}>

I think you should be able to do that, based on gafrost's example. Just use multiple regions (using SetWindowRgn) until you get evreything that you want masked off. I haven't done this with AutoIt, but I remember writing a VB to do this a while back.

#6 strate

strate

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 539 posts

Posted 14 March 2006 - 07:30 PM

When this is used it creates a different GUI style that doesn't look the same as XP theme. Is it possible to change this? I love this function and want to use really bad.

Thought some might be interested in this:

Test Script

#include <GuiConstants.au3> $my_gui = GuiCreate("MyGUI", 392, 323) _GuiRoundCorners($my_gui, 0, 0, 50, 50) GuiSetState() While 1     $msg = GuiGetMsg()     Select     Case $msg = $GUI_EVENT_CLOSE         ExitLoop     Case Else ;;;     EndSelect WEnd Exit

Function to round the corners of a window:

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


INI TreeViewA bus station is where a bus stops, a train station is where a train stops. Onmy desk I have a work station...

#7 ConsultingJoe

ConsultingJoe

    ConsultingJoe.com

  • Active Members
  • PipPipPipPipPipPip
  • 1,667 posts

Posted 14 March 2006 - 08:05 PM

When this is used it creates a different GUI style that doesn't look the same as XP theme. Is it possible to change this? I love this function and want to use really bad.

Very cool, if only someone made a UDF of all the possible GUI FX, I use user32.dll that does transitions. I don't know much about how to use dllcall but how do you guys find out what dll and how to call it.

#8 rakudave

rakudave

    Polymath

  • Active Members
  • PipPipPipPip
  • 245 posts

Posted 14 March 2006 - 09:21 PM

ultracool - i love it, thanks 4 sharing!

#9 Xenobiologist

Xenobiologist

    Xx Code~Mega xX

  • MVPs
  • 4,727 posts

Posted 14 March 2006 - 09:51 PM

ultracool - i love it, thanks 4 sharing!


Very nice, I´ll have to look at DLL Calls. That stuff seems to be very mighty. :)

So long,

Mega

Edited by th.meger, 14 March 2006 - 09:51 PM.

Scripts & functions Organize Includes Let Scite organize the include files *newYahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication)_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

#10 theguy0000

theguy0000

    Benevolent Dictator

  • Active Members
  • PipPipPipPipPipPip
  • 3,750 posts

Posted 15 March 2006 - 02:47 AM

why is it in the Windows Classic Style?

Very cool UDF though
The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN

#11 slightly_abnormal

slightly_abnormal

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 513 posts

Posted 15 March 2006 - 03:41 AM

why is it in the Windows Classic Style?

Very cool UDF though


same for me.. but this is way cool! i hope there is possibility of completly chainging the interface.. csutom colors..

#12 theguy0000

theguy0000

    Benevolent Dictator

  • Active Members
  • PipPipPipPipPipPip
  • 3,750 posts

Posted 15 March 2006 - 10:14 PM

I was able to round a normal window (the windows was SCiTE...) without making it Windows Classic style, so why is the gui in that style?
The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN

#13 theguy0000

theguy0000

    Benevolent Dictator

  • Active Members
  • PipPipPipPipPipPip
  • 3,750 posts

Posted 18 March 2006 - 05:55 PM

int SetWindowRgn(
HWND hWnd,
HRGN hRgn,
BOOL bRedraw
);

what do you use for hRgn?
The cake is a lie.www.theguy0000.com is currentlyUP images.theguy0000.com is currentlyUP all other *.theguy0000.com sites are DOWN

#14 FuryCell

FuryCell

    A cornered fox is more dangerous than a jackal!

  • Active Members
  • PipPipPipPipPipPip
  • 2,437 posts

Posted 19 March 2006 - 10:38 PM

Very cool :) but is there a way to make it use the xp style?
HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users