Jump to content

Recommended Posts

Posted (edited)

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

SciTE for AutoItDirections for Submitting Standard UDFs

 

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

 

Posted

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.
  • 9 months later...
Posted

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...
Posted

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.
Check out ConsultingJoe.com
Posted (edited)

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

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee 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

Posted

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

Posted

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

Posted

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

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...