jNizM wrote:Buttons on white Gui's
To remove the grey border around the buttons border you can use this
CtlColorBtns (thx to just me)
That script leaks handles. According to the remarks for
CreateSolidBrush():
MSDN wrote:When you no longer need the HBRUSH object, call the DeleteObject function to delete it.
Moreover, color should be manually changed for different window background colors - cumbersome. What about backgrounds made of pattern brush or image?
However, using
GetStockObject() with NULL_BRUSH as parameter would avoid handle leaks and suit any window color/pattern/image:
MSDN wrote:It is not necessary (but it is not harmful) to delete stock objects by calling DeleteObject.
Code: Select all
; GLOBAL SETTINGS ===============================================================================================================
#NoEnv
#SingleInstance Force
SetBatchLines -1
; GUI ===========================================================================================================================
Gui, +LastFound
Gui, Margin, 10, 10
Gui, Color, AA88FF
Gui, Add, Radio, w100 vRB1, Radio1
Gui, Add, Radio, xm y+10 w100 vRB2, Radio2
Gui, Add, CheckBox, w100 vCB, CheckBox
Gui, Add, Edit, xm w100 h30
Gui, Add, Button, xm y+2 w100 vPB, Button
Gui, Show, w200 h200
WinSet, Redraw
return
; FUNCTIONS =====================================================================================================================
CtlColorBtns()
{
static init := OnMessage(0x0135, "CtlColorBtns")
return DllCall("GetStockObject", "uint", 5, "uptr")
}
; EXIT ==========================================================================================================================
GuiClose:
GuiEscape:
ExitApp