joeyone Posted February 1, 2008 Share Posted February 1, 2008 This code generates 1 green rectangle I want to have 2 rectangles and also make different settings to each of them like position and size what should i change in the code to have this possible? expandcollapse popup#include <GUIConstants.au3> HotKeySet("{ESC}", "_end") $gui = GUICreate("GUI", 126, 63, 15, 15, $WS_POPUP, $WS_EX_TOPMOST) GUISetBkColor(0x00FF00) _GUICreateInvRect($gui, 3, 3, 120, 57) GUISetState() While 1 WinMove($gui, "", 20, 20) WEnd Func _GUICreateInvRect($hwnd, $l, $t, $w, $h) $pos = WinGetPos($hwnd) $1 = 0 $2 = 0 $3 = $pos[2] $4 = $t $ret = DllCall("gdi32.dll", "long", "CreateRectRgn", "long", $1, "long", $2, "long", $3, "long", $4) $1 = 0 $2 = 0 $3 = $l $4 = $pos[3] $ret2 = DllCall("gdi32.dll", "long", "CreateRectRgn", "long", $1, "long", $2, "long", $3, "long", $4) $1 = $l + $w $2 = 0 $3 = $pos[2] $4 = $pos[3] $ret3 = DllCall("gdi32.dll", "long", "CreateRectRgn", "long", $1, "long", $2, "long", $3, "long", $4) $1 = 0 $2 = $t + $h $3 = $pos[2] $4 = $pos[3] $ret4 = DllCall("gdi32.dll", "long", "CreateRectRgn", "long", $1, "long", $2, "long", $3, "long", $4) DllCall("gdi32.dll", "long", "CombineRgn", "long", $ret[0], "long", $ret[0], "long", $ret2[0], "int", 2) DllCall("gdi32.dll", "long", "CombineRgn", "long", $ret[0], "long", $ret[0], "long", $ret3[0], "int", 2) DllCall("gdi32.dll", "long", "CombineRgn", "long", $ret[0], "long", $ret[0], "long", $ret4[0], "int", 2) DllCall("user32.dll", "long", "SetWindowRgn", "hwnd", $hwnd, "long", $ret[0], "int", 1) EndFunc ;==>_GUICreateInvRect Func _end() Exit(0) EndFunc Link to comment Share on other sites More sharing options...
Aceguy Posted February 1, 2008 Share Posted February 1, 2008 (edited) #include<GUICONSTANTS.AU3> $box1=GUICreate('',50,50,200,200, $WS_POPUP, bitor($WS_EX_TOPMOST,$WS_EX_TOOLWINDOW)) GUISetBkColor(0xff0000) $box2=GUICreate('',50,50,260,200, $WS_POPUP, bitor($WS_EX_TOPMOST,$WS_EX_TOOLWINDOW)) GUISetBkColor(0xff0000) GUISetState(@SW_SHOW,$box1) GUISetState(@SW_SHOW,$box2) WHILE 1 SLEEP(100) WEnd(@SW_SHOW,$box2) Edited February 1, 2008 by Aceguy [u]My Projects.[/u]Launcher - not just for games & Apps (Mp3's & Network Files)Mp3 File RenamerMy File Backup UtilityFFXI - Realtime to Vana time Clock 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