Jump to content

How to remove Gui Border ?


newb_powa'
 Share

Recommended Posts

I have a gui looking like the first pic.

How could I remove the border of the gui to making it look like the second pic (modified with ms paint) ?

pic1

Posted Image

pic2

Posted Image

There is my script

#include <GUIConstants.au3>

$Form6 = GUICreate("", 554, 89, 174, 34)
$Form3 = GUICreate("", 115, 526, 54, 34, $WS_EX_MDICHILD, "", $Form6)
$Form4 = GUICreate("", 561, 122, 54, 531, $WS_EX_MDICHILD, "", $Form6)
$Form5 = GUICreate("", 115, 527, 611, 126, $WS_EX_MDICHILD, "", $Form6)

GUISetState(@SW_SHOW, $Form3)
GUISetState(@SW_SHOW, $Form4)
GUISetState(@SW_SHOW, $Form5)
GUISetState(@SW_SHOW, $Form6)


While 1
    $msg=GuiGetMsg()
    If $msg=$GUI_EVENT_CLOSE Then ExitLoop
    ;;;
    If $msg=$GUI_EVENT_PRIMARYDOWN Then windrag()
    ;;;
WEnd
 
func windrag()
    $posw = WinGetPos($Form6)
    $poss = MouseGetPos()
    $deltax = $poss[0]-$posw[0]
    $deltay = $poss[1]-$posw[1]
    
    Do
        $msg = GUIGetMsg()
    Until $msg==$GUI_EVENT_PRIMARYUP
    
    $pos=MouseGetPos()
    
    WinMove($Form6, "", ($pos[0]-$deltax)     , ($pos[1]-$deltay)     )
    WinMove($Form3, "", ($pos[0]-$deltax)-120 , ($pos[1]-$deltay)-000 )
    WinMove($Form4, "", ($pos[0]-$deltax)-120 , ($pos[1]-$deltay)+497 )
    WinMove($Form5, "", ($pos[0]-$deltax)+437 , ($pos[1]-$deltay)+092 )
EndFunc

I wish you understand what I'm trying to say ... Sorry for bad english ^^

Thanks for help !!

Link to comment
Share on other sites

If the bit in the centre is supposed to be black you can make it with one GUI

#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("AForm1", 633, 447, 193, 115)
$Graphic1 = GUICtrlCreateGraphic(80, 64, 489, 305)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlSetState(-1, $GUI_DISABLE)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

  • Moderators

Look at $WS_POPUP under GUI Control Styles in the help file for the child windows.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

@BigDod, In the middle this is not really black, this is transparent and i can continue to operate on other app :lmao:

@Smoke_N, Thanks i will look at it

Edit: That's perfect Smoke_N, I'll add some Label to make my own Border :ph34r: Thanks

Edit2: Is there a way that if I put my line of code in Koda it will make the form and I could still continue with that ?? Because I forgot to save my form ^^

Edited by newb_powa'
Link to comment
Share on other sites

Are you actually just trying to make a hole in your main GUI? If so, there are easier ways.

EDIT: Simple example:

#include <GuiConstants.au3>
$gui = GUICreate("", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP, $WS_EX_LAYERED)
GUICtrlCreateLabel("", 100, 100, 500, 500)
GUICtrlSetBkColor(-1, 0xff00ff)
DllCall("user32.dll", "long", "SetLayeredWindowAttributes", "hwnd", $gui, "long", 0x00ff00ff, "long", 255, "long", 1)
GUISetState()
Sleep(10000)

This script works with Win2k and XP.

Edited by this-is-me
Who else would I be?
Link to comment
Share on other sites

Are you actually just trying to make a hole in your main GUI? If so, there are easier ways.

EDIT: Simple example:

#include <GuiConstants.au3>
$gui = GUICreate("", @DesktopWidth, @DesktopHeight, 0, 0, $WS_POPUP, $WS_EX_LAYERED)
GUICtrlCreateLabel("", 100, 100, 500, 500)
GUICtrlSetBkColor(-1, 0xff00ff)
DllCall("user32.dll", "long", "SetLayeredWindowAttributes", "hwnd", $gui, "long", 0x00ff00ff, "long", 255, "long", 1)
GUISetState()
Sleep(10000)

This script works with Win2k and XP.

Oh i love it, lol

It is better than mine ^^

Thank you :lmao:

Link to comment
Share on other sites

But, I still have a question, if I open a DLL, I'm not suppose to close it after ?? not sure about that, and you don't open the dll you just call it, so I need to know lol :lmao:

And look at the code I writed, it's doing the samething as your, but it's alot more big :ph34r:

#include <GUIConstants.au3>
#include <Misc.au3>

$Form6 = GUICreate("1", 561, 122, 165, 34, $WS_POPUP)
$Label3 = GUICtrlCreateLabel("",0,0,900,29)
$Label4 = GUICtrlCreateLabel("",0,29,900,1)
$Quit = GUICtrlCreateLabel(" X", 530, 3, 28, 24)
GUICtrlCreateGroup("",529,-4,29,32)
GUICtrlSetFont($Quit, 14, 800, 0, "MS Sans Serif")
GUICtrlSetColor($Quit   , 0xFFFFFF)
GUICtrlSetBkColor($Quit , 0xFF0000)
$Reduce = GUICtrlCreateLabel(" --", 495, 3, 28, 24)
GUICtrlCreateGroup("",494,-4,29,32)
GUICtrlSetFont($Reduce, 14, 800, 0, "MS Sans Serif")
GUICtrlSetColor($Reduce   , 0xFFFFFF)
GUICtrlSetBkColor($Reduce , 0x0000FF)
$Borderline6 = GUICtrlCreateLabel("",560,30,1,9000)
$Borderline10= GUICtrlCreateLabel("",0,121,9000,1)

$Form3 = GUICreate("2", 115, 526, 54, 34, $WS_EX_MDICHILD+$WS_POPUP, "", $Form6)
$Label1 = GUICtrlCreateLabel(" My Gui",0,0,300,29)
GUICtrlSetFont($Label1, 17, 800, 2, "Stone Sans ITC TT-SemiIta")
GUICtrlSetColor($Label1, 0xFFFFFF)
$Label2 = GUICtrlCreateLabel("",0,29,300,1)
$Borderline1 = GUICtrlCreateLabel("",0,30,1,9000)
$Borderline7 = GUICtrlCreateLabel("",114,121,1,527)

$Form4 = GUICreate("3", 561, 122, 54, 531, $WS_EX_MDICHILD+$WS_POPUP, "", $Form6)
$Borderline2 = GUICtrlCreateLabel("",0,121,9000,1)
$Borderline3 = GUICtrlCreateLabel("",0,0,1,9000)
$Borderline8 = GUICtrlCreateLabel("",114,0,9000,1)

$Form5 = GUICreate("4", 115, 527, 611, 126, $WS_EX_MDICHILD+$WS_POPUP, "", $Form6)
$Borderline4 = GUICtrlCreateLabel("",0,526,9000,1)
$Borderline5 = GUICtrlCreateLabel("",114,0,1,9000)
$Borderline9 = GUICtrlCreateLabel("",0,29,1,377)

GUICtrlSetBkColor($Label1, 0x0056E8)
GUICtrlSetBkColor($Label3, 0x0056E8)

GUICtrlSetBkColor($Label2, 0x000000)
GUICtrlSetBkColor($Label4, 0x000000)
GUICtrlSetBkColor($Borderline1,  0x000000)
GUICtrlSetBkColor($Borderline2,  0x000000)
GUICtrlSetBkColor($Borderline3,  0x000000)
GUICtrlSetBkColor($Borderline4,  0x000000)
GUICtrlSetBkColor($Borderline5,  0x000000)
GUICtrlSetBkColor($Borderline6,  0x000000)
GUICtrlSetBkColor($Borderline7,  0x000000)
GUICtrlSetBkColor($Borderline8,  0x000000)
GUICtrlSetBkColor($Borderline9,  0x000000)
GUICtrlSetBkColor($Borderline10, 0x000000)

GUISetState(@SW_SHOW, $Form3)
GUISetState(@SW_SHOW, $Form4)
GUISetState(@SW_SHOW, $Form5)
GUISetState(@SW_SHOW, $Form6)
WinSetOnTop($Form3,"",1)
WinSetOnTop($Form4,'',1)
WinSetOnTop($Form5,'',1)
WinSetOnTop($Form6,'',1)

While 1
    
    $msg = GuiGetMsg()
    
If $msg=$GUI_EVENT_PRIMARYDOWN Then
    $pos = MouseGetPos()
    If ( PixelGetColor($pos[0]-1, $pos[1]) = 0xFF0000 ) Then
        ExitLoop
    EndIf
    windrag()
EndIf

If _IsPressed(01) = 1 Then
    $pos = MouseGetPos()
    If     ( PixelGetColor($pos[0], $pos[1])   = 0xFF0000 ) Then
        ExitLoop
    ElseIf ( PixelGetColor($pos[0]-2, $pos[1]) = 0xFF0000 ) Then
        ExitLoop
    ElseIf ( PixelGetColor($pos[0]+2, $pos[1]) = 0xFF0000 ) Then
        ExitLoop
    ElseIf ( PixelGetColor($pos[0], $pos[1]-2) = 0xFF0000 ) Then
        ExitLoop
    ElseIf ( PixelGetColor($pos[0], $pos[1]+2) = 0xFF0000 ) Then
        ExitLoop
    EndIf
    
    If     ( PixelGetColor($pos[0], $pos[1])   = 0x0000FF ) Then
        WinSetState($Form6, "", @SW_MINIMIZE)
    ElseIf ( PixelGetColor($pos[0]-2, $pos[1]) = 0x0000FF ) Then
        WinSetState($Form6, "", @SW_MINIMIZE)
    ElseIf ( PixelGetColor($pos[0]+2, $pos[1]) = 0x0000FF ) Then
        WinSetState($Form6, "", @SW_MINIMIZE)
    ElseIf ( PixelGetColor($pos[0], $pos[1]-2) = 0x0000FF ) Then
        WinSetState($Form6, "", @SW_MINIMIZE)
    ElseIf ( PixelGetColor($pos[0], $pos[1]+2) = 0x0000FF ) Then
        WinSetState($Form6, "", @SW_MINIMIZE)
    EndIf
EndIf

WEnd
 
func windrag()
    $posw = WinGetPos($Form6)
    $poss = MouseGetPos()
    $deltax = $poss[0]-$posw[0]
    $deltay = $poss[1]-$posw[1]
    
    Do
        $msg = GUIGetMsg()
    Until $msg==$GUI_EVENT_PRIMARYUP
    
    $pos=MouseGetPos()
    
    WinMove($Form6, "", ($pos[0]-$deltax)     , ($pos[1]-$deltay)     )
    WinMove($Form3, "", ($pos[0]-$deltax)-108 , ($pos[1]-$deltay)-000 )
    WinMove($Form4, "", ($pos[0]-$deltax)-108 , ($pos[1]-$deltay)+497 )
    WinMove($Form5, "", ($pos[0]-$deltax)+446 , ($pos[1]-$deltay)+092 )
EndFunc

120 line of code against 5

It make me laught

Link to comment
Share on other sites

The filename of the DLL to use. e.g. "user32.dll". A handle obtained from DllOpen can also be used (See Remarks).

Remarks

If a dll filename is given then the DLL is automatically loaded and then closed at the end of the call. If you want to manually control the loading and unloading of the DLL then you should use DllOpen and DllClose and use a handle instead of a filename in this function.

SciTE for AutoItDirections for Submitting Standard UDFs

 

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

 

Link to comment
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
 Share

  • Recently Browsing   0 members

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