Jump to content

Glowing Inputbox


Lucid
 Share

Recommended Posts

you need the GuiCtrlOnHover.au3 from here:  

Then you can do something like this (a modified version of MrCreator's 'Basic GUI Controls Example' from the zip file):

#include <GUIConstantsEx.au3>
#include "GUICtrlOnHover.au3"
#include <GDIPlus.au3>

$hGUI = GUICreate("GUICtrlSetOnHover GUI DEMO", 280, 200)

$Button = GUICtrlCreateButton("Button", 20, 40, 100, 20)
_GUICtrl_OnHoverRegister(-1, "_Hover_Func", "_Hover_Func")

$Label = GUICtrlCreateLabel("Label", 200, 40, 28, 15)
GUICtrlSetFont($Label, 8.5)
GUICtrlSetCursor($Label, 0)
_GUICtrl_OnHoverRegister($Label, "_Hover_Func", "_Hover_Func")

$CheckBox = GUICtrlCreateCheckbox("CheckBox", 20, 120)
_GUICtrl_OnHoverRegister($CheckBox, "_Hover_Func", "_Hover_Func")

$Edit = GUICtrlCreateEdit("Edit", 150, 120, 100, 50)
_GUICtrl_OnHoverRegister($Edit, "_Hover_Func", "_Hover_Func")

GUISetState()

While 1
    $Msg = GUIGetMsg()
    Switch $Msg
        Case -3
            Exit
    EndSwitch
WEnd

Func _Hover_Func($iCtrlID, $iParam)

    Local $sConsole_Data = "Hovered"
    Local $sButton_Text = "Hover Button"
    Local $iLabel_Color = 0x00000FF
    Local $iLabel_FontAttrib = 4
    Local $iCheckBox_State = $GUI_CHECKED
    Local $sEdit_Data = "New Edit Data"
    Local $sColor = 0xFF00FF00

    _GDIPlus_Startup()
    $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hGUI)
    $hBrush1 = _GDIPlus_BrushCreateSolid()
    _GDIPlus_BrushSetSolidColor($hBrush1 , $sColor)
    $hPen1 = _GDIPlus_PenCreate2 ( $hBrush1 , 3 ,  2 )

    If $iParam = 2 Then ;Indicates On *Leave* Hover process
        $sConsole_Data = "NOT Hovered"
        $sButton_Text = "Button"
        $iLabel_Color = 0x000000
        $iLabel_FontAttrib = 0
        $iCheckBox_State = $GUI_UNCHECKED
        $sEdit_Data = "Edit Data"
        $sColor = 0xFFF0F0F0
        _GDIPlus_PenDispose($hPen1)
        _GDIPlus_BrushSetSolidColor($hBrush1 , $sColor)
        $hPen1 = _GDIPlus_PenCreate2 ( $hBrush1 , 3 ,  2 )


    EndIf

    Printf("Control " & $iCtrlID & " [Data: " & GUICtrlRead($iCtrlID, 1) & "] Is Now " & $sConsole_Data)

    Switch $iCtrlID
        Case $Button
            If GUICtrlRead($iCtrlID) <> $sButton_Text Then GUICtrlSetData($iCtrlID, $sButton_Text)

        Case $Label
            GUICtrlSetColor($iCtrlID, $iLabel_Color)
            GUICtrlSetFont($iCtrlID, Default, Default, $iLabel_FontAttrib)

        Case $CheckBox
            GUICtrlSetState($iCtrlID, $iCheckBox_State)

        Case $Edit
            If GUICtrlRead($iCtrlID) <> $sEdit_Data Then
                GUICtrlSetData($iCtrlID, $sEdit_Data)

                $hRect = _GDIPlus_GraphicsDrawRect($hGraphic, 147, 117, 104, 55, $hPen1)

            Endif

    EndSwitch

EndFunc

Func Printf($Str, $Line=@ScriptLineNumber)
    ConsoleWrite("!===========================================================" & @LF & _
                "+======================================================" & @LF & _
                "--> Script Line (" & $Line & "):" & @LF & "!" & @TAB & $Str & @LF & _
                "+======================================================" & @LF)
EndFunc

,-. .--. ________ .-. .-. ,---. ,-. .-. .-. .-.
|(| / /\ \ |\ /| |__ __||| | | || .-' | |/ / \ \_/ )/
(_) / /__\ \ |(\ / | )| | | `-' | | `-. | | / __ \ (_)
| | | __ | (_)\/ | (_) | | .-. | | .-' | | \ |__| ) (
| | | | |)| | \ / | | | | | |)| | `--. | |) \ | |
`-' |_| (_) | |\/| | `-' /( (_)/( __.' |((_)-' /(_|
'-' '-' (__) (__) (_) (__)

Link to comment
Share on other sites

It's simple, without additional UDF.

 

#Include <EditConstants.au3>
#Include <GUIConstantsEx.au3>
#Include <WindowsConstants.au3>

Global $Pic[3], $Input[3]

$hForm = GUICreate('MyGUI', 251, 201)
GUISetBkColor(0x151515)
For $i = 0 To 2
    $Pic[$i] = GUICtrlCreatePic('ig1.bmp', 20, 20 + 57 * $i, 211, 47)
    GUICtrlSetState(-1, $GUI_DISABLE)
    $Input[$i] = GUICtrlCreateInput('', 36, 36 + 57 * $i, 179, 15, -1, 0)
    GUICtrlSetFont(-1, 9, 800, 0, 'Segoe UI')
    GUICtrlSetBkColor(-1, 0x2A2A2A)
    GUICtrlSetColor(-1, 0xC0C0C0)
Next
GUIRegisterMsg($WM_COMMAND, 'WM_COMMAND')
GUISetState()

Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE

Func WM_COMMAND($hWnd, $iMsg, $wParam, $lParam)
    Switch $hWnd
        Case $hForm
            Local $ID = BitAND($wParam, 0xFFFF)
            For $i = 0 To 2
                If $Input[$i] = $ID Then
                    Switch BitShift($wParam, 16)
                        Case $EN_KILLFOCUS
                            GUICtrlSetImage($Pic[$i], 'ig1.bmp')
                        Case $EN_SETFOCUS
                            GUICtrlSetImage($Pic[$i], 'ig2.bmp')
                    EndSwitch
                    Return 0
                EndIf
            Next
    EndSwitch
    Return $GUI_RUNDEFMSG
EndFunc   ;==>WM_COMMAND

InputGlow.zip

Edited by Yashied
Link to comment
Share on other sites

Here my version (proof of concept):

 

;idea taken from http://codepen.io/jackrugile/full/ABeIi
#Include <WindowsConstants.au3>
#Include <GUIConstantsEx.au3>
#include <GDIPLus.au3>
#include <EditConstants.au3>
#include <StaticConstants.au3>

_GDIPlus_Startup()
Global $__hGUI_, $__iInput_, $__hGUI_Glow, $__bPlayAnim = False
Global Const $fDeg = 180 / ACos(-1), $fRad = ACos(-1) / 180

ModernSearchGUI(800, 300)

_GDIPlus_Shutdown()

Func ModernSearchGUI($iW = @DesktopWidth, $iH = @DesktopHeight)
    Local Const $iBgColor = 0x151515
    $iW = $iW < (346 + 2 * 220 + 3) ? (346 + 2 * 220 + 3) : $iW
    $iH = $iH < 2 * 84 ? 2 * 84 : $iH
    $__hGUI_ = GUICreate("", $iW, $iH, ($iW <> @DesktopWidth) ? (@DesktopWidth - $iW) / 2 : 0, ($iH <> @DesktopHeight) ? (@DesktopHeight - $iH) / 2 : 0, BitOR($WS_TABSTOP, $WS_POPUP), $WS_EX_TOPMOST)
    GUISetBkColor($iBgColor)
    Local Const $iW_Frame = 346, $iH_Frame = 84
    Local Const $iPosX = Int(($iW - $iW_Frame) / 2), $iPosY = Int($iH / 4)
    Local Const $iPicFrame = GUICtrlCreatePic("", $iPosX, $iPosY, $iW_Frame, $iH_Frame)
    GUICtrlSetState(-1, $GUI_DISABLE)
    Local Const $iStripLeft = GUICtrlCreatePic("", $iPosX - 220, $iPosY + $iH_Frame / 2, 220, 2)
    Local Const $iStripRight = GUICtrlCreatePic("", $iPosX + $iW_Frame, $iPosY + $iH_Frame / 2, 220, 2)

    Local $hBmp = _GDIPlus_BitmapCreateFromScan0(220, 2), $hHBmp
    Local $hCtxt = _GDIPlus_ImageGetGraphicsContext($hBmp)

    #Region l/r strips
    Local Const $hBrushL1 = _GDIPlus_LineBrushCreate(0, 0, 220, 1, 0xFF151515, 0xFF0A0A0A, 1)
    Local Const $hBrushR1 = _GDIPlus_LineBrushCreate(0, 0, 220, 1, 0xFF0A0A0A, 0xFF151515, 1)
    Local Const $hBrushL2 = _GDIPlus_LineBrushCreate(0, 0, 220, 1, 0xFF151515, 0xFF2F2F2F, 1)
    Local Const $hBrushR2 = _GDIPlus_LineBrushCreate(0, 0, 220, 1, 0xFF2F2F2F, 0xFF151515, 1)
    _GDIPlus_GraphicsFillRect($hCtxt, 0, 0, 220, 1, $hBrushL1)
    _GDIPlus_GraphicsFillRect($hCtxt, 0, 1, 220, 1, $hBrushL2)
    $hHBmp = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBmp)
    _WinAPI_DeleteObject(GUICtrlSendMsg($iStripLeft, 0x0172, $IMAGE_BITMAP, $hHBmp))
    _WinAPI_DeleteObject($hHBmp)
    _GDIPlus_GraphicsDispose($hCtxt)
    _GDIPlus_ImageRotateFlip($hBmp, 4)
    $hHBmp = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBmp)
    _WinAPI_DeleteObject(GUICtrlSendMsg($iStripRight, 0x0172, $IMAGE_BITMAP, $hHBmp))
    _WinAPI_DeleteObject($hHBmp)
    _GDIPlus_BitmapDispose($hBmp)
    _GDIPlus_BrushDispose($hBrushL1)
    _GDIPlus_BrushDispose($hBrushL2)
    _GDIPlus_BrushDispose($hBrushR1)
    _GDIPlus_BrushDispose($hBrushR2)
    #EndRegion

    #Region Frame
    $hBmp = _GDIPlus_BitmapCreateFromScan0($iW_Frame, $iH_Frame)
    $hCtxt = _GDIPlus_ImageGetGraphicsContext($hBmp)
    _GDIPlus_GraphicsSetSmoothingMode($hCtxt, $GDIP_SMOOTHINGMODE_ANTIALIAS8X4 + (@OSBuild > 5999))
    _GDIPlus_GraphicsClear($hCtxt, 0xFF000000 + $iBgColor)
    Local $hBrushBg = _GDIPlus_LineBrushCreate($iW_Frame / 2, 0, $iW_Frame / 2, $iH_Frame, 0xFF1F1F1F, 0xFF101010, 1)
    _GDIPlus_GraphicsFillRect($hCtxt, 0, 0, $iW_Frame, $iH_Frame, $hBrushBg)

    Local $hPath = _GDIPlus_PathCreate()
    Local Const $hPen = _GDIPlus_PenCreate(0xFF000000)
    Local $aPoints[9][2] = [[8]], $iCorner = 3
    ;outer border
    $aPoints[1][0] = $iCorner
    $aPoints[1][1] = 0
    $aPoints[2][0] = $iW_Frame - $iCorner
    $aPoints[2][1] = 0
    $aPoints[3][0] = $iW_Frame - 1
    $aPoints[3][1] = $iCorner
    $aPoints[4][0] = $iW_Frame - 1
    $aPoints[4][1] = $iH_Frame - $iCorner
    $aPoints[5][0] = $iW_Frame - $iCorner - 1
    $aPoints[5][1] = $iH_Frame - 1
    $aPoints[6][0] = $iCorner
    $aPoints[6][1] = $iH_Frame - 1
    $aPoints[7][0] = 0
    $aPoints[7][1] = $iH_Frame - $iCorner
    $aPoints[8][0] = 0
    $aPoints[8][1] = $iCorner
    _GDIPlus_PathAddClosedCurve2($hPath, $aPoints, 0.025)
    _GDIPlus_GraphicsDrawPath($hCtxt, $hPath, $hPen)

    ;inner border
    _GDIPlus_PathReset($hPath)
    _GDIPlus_PenSetColor($hPen, 0xFF272727)
    $aPoints[1][0] = $iCorner
    $aPoints[1][1] = 1
    $aPoints[2][0] = $iW_Frame - $iCorner
    $aPoints[2][1] = 1
    $aPoints[3][0] = $iW_Frame - 2
    $aPoints[3][1] = $iCorner
    $aPoints[4][0] = $iW_Frame - 2
    $aPoints[4][1] = $iH_Frame - $iCorner
    $aPoints[5][0] = $iW_Frame - $iCorner - 2
    $aPoints[5][1] = $iH_Frame - 2
    $aPoints[6][0] = $iCorner
    $aPoints[6][1] = $iH_Frame - 2
    $aPoints[7][0] = 1
    $aPoints[7][1] = $iH_Frame - $iCorner
    $aPoints[8][0] = 1
    $aPoints[8][1] = $iCorner
    _GDIPlus_PathAddClosedCurve2($hPath, $aPoints, 0.025)
    _GDIPlus_GraphicsDrawPath($hCtxt, $hPath, $hPen)

    $hHBmp = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBmp)
    _WinAPI_DeleteObject(GUICtrlSendMsg($iPicFrame, 0x0172, $IMAGE_BITMAP, $hHBmp))
    _WinAPI_DeleteObject($hHBmp)
    _GDIPlus_GraphicsDispose($hCtxt)
    _GDIPlus_BitmapDispose($hBmp)
    _GDIPlus_BrushDispose($hBrushBg)
    #EndRegion

    #Region input box
    Local Const $iPicBg = GUICtrlCreatePic("", $iPosX + ($iW_Frame - 304) / 2 - 8, $iPosY + 12, 320, 60)
    GUICtrlSetState(-1, $GUI_DISABLE)
    Local $hPicBg = GUICtrlGetHandle($iPicBg)

    _GDIPlus_PathReset($hPath)
    _GDIPlus_PenSetColor($hPen, 0xFF000000)
    _GDIPlus_PenSetWidth($hPen, 2)
    $aPoints[0][0] = 4
    $aPoints[1][0] = 310
    $aPoints[1][1] = 48
    $aPoints[2][0] = 308
    $aPoints[2][1] = 50
    $aPoints[3][0] = 11
    $aPoints[3][1] = 50
    $aPoints[4][0] = 8
    $aPoints[4][1] = 48
    $hBmp = _GDIPlus_BitmapCreateFromScan0(320, 60)
    $hCtxt = _GDIPlus_ImageGetGraphicsContext($hBmp)
    _GDIPlus_GraphicsSetSmoothingMode($hCtxt, $GDIP_SMOOTHINGMODE_ANTIALIAS8X4 + (@OSBuild > 5999))
    _GDIPlus_PathAddCurve2($hPath, $aPoints, 0.025)
    _GDIPlus_GraphicsDrawPath($hCtxt, $hPath, $hPen) ;draw shadow

    _GDIPlus_PathReset($hPath)
    _GDIPlus_PenSetColor($hPen, 0xFF686868)
    _GDIPlus_PenSetWidth($hPen, 1)
    $aPoints[0][0] = 8
    $aPoints[1][0] = 11
    $aPoints[1][1] = 8
    $aPoints[2][0] = 308
    $aPoints[2][1] = 8
    $aPoints[3][0] = 311
    $aPoints[3][1] = 11
    $aPoints[4][0] = 311
    $aPoints[4][1] = 45
    $aPoints[5][0] = 308
    $aPoints[5][1] = 48
    $aPoints[6][0] = 11
    $aPoints[6][1] = 48
    $aPoints[7][0] = 8
    $aPoints[7][1] = 45
    $aPoints[8][0] = 8
    $aPoints[8][1] = 11
    _GDIPlus_PathAddClosedCurve2($hPath, $aPoints, 0.025) ;draw round rectangle
    _GDIPlus_GraphicsDrawPath($hCtxt, $hPath, $hPen)
    Local $hBrush = _GDIPlus_BrushCreateSolid(0xFF2B2B2B)
    _GDIPlus_GraphicsFillPath($hCtxt, $hPath, $hBrush)
    _GDIPlus_GraphicsDrawLine($hCtxt, 230, 8, 230, 48, $hPen)
    _GDIPlus_PenSetColor($hPen, 0xFF000000)
    _GDIPlus_GraphicsDrawLine($hCtxt, 231, 8, 231, 48, $hPen)

    $hHBmp = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBmp)
    _WinAPI_DeleteObject(GUICtrlSendMsg($iPicBg, 0x0172, $IMAGE_BITMAP, $hHBmp))

    _GDIPlus_PathDispose($hPath)
    _GDIPlus_PenDispose($hPen)
    _GDIPlus_BrushDispose($hBrush)
    _WinAPI_DeleteObject($hHBmp)
    _GDIPlus_GraphicsDispose($hCtxt)
    _GDIPlus_BitmapDispose($hBmp)

    $__iInput_ = GUICtrlCreateInput("What are you looking for?", 12 + $iPosX + ($iW_Frame - 304) / 2, $iPosY + ($iH_Frame - 18) / 2, 195, 18, $ES_AUTOHSCROLL, 0)
    GUICtrlSetFont(-1, 10, 400, 0, "Arial", 5)
    GUICtrlSetColor(-1, 0x888888)
    GUICtrlSetBkColor(-1, 0x2B2B2B)
    Local Const $iBtn = GUICtrlCreateLabel("Search", $iPosX + 245, $iPosY + 21, 78, 39, BitOR($SS_CENTER, $SS_CENTERIMAGE, $WS_TABSTOP))
    GUICtrlSetFont(-1, 11, 400, 0, "Arial", 5)
    GUICtrlSetColor(-1, 0xF0F0F0)
    GUICtrlSetBkColor(-1, 0x2B2B2B)
    ControlFocus($__hGUI_ , "", $iBtn)

    $__hGUI_Glow = GUICreate("", $iW_Frame, $iH_Frame, $iPosX, $iPosY, $WS_POPUP, BitOR($WS_EX_MDICHILD, $WS_EX_TRANSPARENT, $WS_EX_LAYERED), $__hGUI_)
    GUISetBkColor(0x00011, $__hGUI_Glow)
    Local Const $iPic_Glow = GUICtrlCreatePic("", 14, 15, 236, 57)
    GUICtrlSetState(-1, $GUI_DISABLE)

    $hBmp = _GDIPlus_BitmapCreateFromScan0(239, 57)
    $hCtxt = _GDIPlus_ImageGetGraphicsContext($hBmp)
    _GDIPlus_GraphicsSetSmoothingMode($hCtxt, 4 + (@OSBuild > 5999))
    _GDIPlus_GraphicsSetPixelOffsetMode($hCtxt, $GDIP_PIXELOFFSETMODE_HIGHQUALITY)

    Local Const $hRegion = _GDIPlus_RegionCreateFromRect(0, 0, $iW_Frame, $iH_Frame)
    _GDIPlus_RegionCombineRect($hRegion, 18, 20, 195, 18, 3)
    _GDIPlus_GraphicsSetClipRegion($hCtxt, $hRegion)

    $hBrushBg = _GDIPlus_LineBrushCreate($iW_Frame / 2, 0, $iW_Frame / 2, $iH_Frame, 0xFF1F1F1F, 0xFF101010, 1)
    _GDIPlus_GraphicsFillRect($hCtxt, 0, 0, $iW_Frame, $iH_Frame, $hBrushBg)
    $hBrush = _GDIPlus_BrushCreateSolid(0xFF2B2B2B)
    _GDIPlus_GraphicsFillRect($hCtxt, 10, 13, 220, 36, $hBrush)

    _GDIPlus_GlowCreate($hCtxt, 10, 8, 10, 49, 8)
    _GDIPlus_GlowCreate($hCtxt, 233, 8, 233, 49, 8)
    _GDIPlus_GlowCreate($hCtxt, 8, 8, 236, 8)
    _GDIPlus_GlowCreate($hCtxt, 8, 49, 236, 49)

    $hHBmp = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBmp)
    _WinAPI_DeleteObject(GUICtrlSendMsg($iPic_Glow, 0x0172, $IMAGE_BITMAP, $hHBmp))

    _GDIPlus_BrushDispose($hBrushBg)
    _GDIPlus_BrushDispose($hBrush)
    _GDIPlus_RegionDispose($hRegion)
    _WinAPI_DeleteObject($hHBmp)
    _GDIPlus_GraphicsDispose($hCtxt)
    _GDIPlus_BitmapDispose($hBmp)

    #EndRegion

    GUISetState(@SW_SHOW, $__hGUI_)
    GUISetState(@SW_SHOW, $__hGUI_Glow)

    _WinAPI_SetLayeredWindowAttributes($__hGUI_Glow, 0x00011, 0x00)

    GUIRegisterMsg($WM_COMMAND, 'WM_COMMAND')
    AdlibRegister("PlayGlowAnim", 30)
    Local $iMpos, $iBState = 0
    Do
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                AdlibUnRegister("PlayGlowAnim")
                GUIDelete()
                Return 1
            Case $iBtn
                MsgBox(0, "Test", GUICtrlRead($__iInput_), 0, $__hGUI_ )
        EndSwitch
        $iMpos = GUIGetCursorInfo($__hGUI_ )[4]
        Switch $iMpos
            Case $iBtn
                If Not $iBState Then
                    GUICtrlSetColor($iBtn, 0x55FF55)
                    GUICtrlSetBkColor($iBtn, 0x383838)
                    $iBState = 1
                EndIf
            Case Else
                If $iBState Then
                    $iBState = 0
                    GUICtrlSetColor($iBtn, 0xF0F0F0)
                    GUICtrlSetBkColor($iBtn, 0x2B2B2B)
                EndIf
        EndSwitch
    Until False
EndFunc

Func WM_COMMAND($hWnd, $iMsg, $wParam, $lParam)
    Switch $hWnd
        Case $__hGUI_
            Switch BitAND($wParam, 0xFFFF)
                Case $__iInput_
                    Switch BitShift($wParam, 16)
                        Case $EN_KILLFOCUS
                            $__bPlayAnim = False
                            WinSetTrans($__hGUI_Glow, "", 0)
                            If GUICtrlRead($__iInput_) = "" Then Return GUICtrlSetData($__iInput_, "What are you looking for?") * 0
                        Case $EN_SETFOCUS
                            $__bPlayAnim = True
                            If GUICtrlRead($__iInput_) = "What are you looking for?" Then GUICtrlSetData($__iInput_, "")
                            Return 0
                    EndSwitch
            EndSwitch
    EndSwitch
    Return $GUI_RUNDEFMSG
EndFunc   ;==>WM_COMMAND

Func _GDIPlus_GlowCreate(ByRef $hGraphics, $iX1, $iY1, $iX2, $iY2, $iSize = 16, $iCInner = 0x6010FF10) ;coded by UEZ build 2015-01-09 beta
    Local Const $fAngle = ATan(($iY2 - $iY1) / ($iX2 - $iX1)) * $fDeg ;calculate the angle of the 2 points
    Local Const $iW = Round(Sqrt(($iY2 - $iY1) ^ 2 + ($iX2 - $iX1) ^ 2), 0), $iH = $iW ;length between the 2 points

    Local Const $hBitmap = _GDIPlus_BitmapCreateFromScan0($iW, $iH)
    Local Const $hCtxt = _GDIPlus_ImageGetGraphicsContext($hBitmap)
    _GDIPlus_GraphicsSetSmoothingMode($hCtxt, $GDIP_SMOOTHINGMODE_HIGHQUALITY)

    Local Const $hMatrix = _GDIPlus_MatrixCreate()
    _GDIPlus_MatrixTranslate($hMatrix, $iW / 2, $iH / 2)
    _GDIPlus_MatrixRotate($hMatrix, $fAngle + 90)
    _GDIPlus_MatrixTranslate($hMatrix, -$iW / 2, -$iH / 2)
    _GDIPlus_GraphicsSetTransform($hCtxt, $hMatrix)

    Local Const $hPath = _GDIPlus_PathCreate()
    _GDIPlus_PathAddRectangle($hPath, ($iW - $iSize) / 2 - $iSize / 2, 0, $iSize * 2, $iH)
    $hBrush_Glow = _GDIPlus_LineBrushCreate(($iW - $iSize) / 2, 0, ($iH + $iSize) / 2, 0, 0, 0)
    Local $aColorGradient[4][2], $iCOuter = 0x00000000
    $aColorGradient[0][0] = 3
    $aColorGradient[1][0] = $iCOuter
    $aColorGradient[1][1] = 0.0
    $aColorGradient[2][0] = $iCInner
    $aColorGradient[2][1] = 0.5
    $aColorGradient[3][0] = $iCOuter
    $aColorGradient[3][1] = 1.0
    _GDIPlus_LineBrushSetPresetBlend($hBrush_Glow, $aColorGradient)
    _GDIPlus_GraphicsFillRect($hCtxt, ($iW - $iSize) / 2, 0, $iSize, $iH, $hBrush_Glow)

    Local $fDX, $fDY
    If $fAngle <= 180 Then  ;adjust position
        $fDX = $iX2 - ($iW / 2 + Cos($fAngle * $fRad) * $iW / 2)
        $fDY = $iY2 - ($iH / 2 + Sin($fAngle * $fRad) * $iH / 2)
    Else
        $fDX = $iX1 - ($iW / 2 + Cos($fAngle * $fRad) * $iW / 2)
        $fDY = $iY1 - ($iH / 2 + Sin($fAngle * $fRad) * $iH / 2)
    EndIf
    _GDIPlus_GraphicsDrawImageRect($hGraphics, $hBitmap, $fDX, $fDY, $iW, $iH)

    _GDIPlus_PathDispose($hPath)
    _GDIPlus_MatrixDispose($hMatrix)
    _GDIPlus_BrushDispose($hBrush_Glow)
    _GDIPlus_GraphicsDispose($hCtxt)
    _GDIPlus_BitmapDispose($hBitmap)
EndFunc   ;==>_GDIPlus_GlowCreate

Func PlayGlowAnim()
    If $__bPlayAnim Then
        Local Static $fTransparency = 0x40, $iDir = 1
        _WinAPI_SetLayeredWindowAttributes($__hGUI_Glow, 0x00011, $fTransparency < 0x40 ? 0x40: $fTransparency > 0xFF ? 0xFF : $fTransparency)
        $fTransparency += 8 * $iDir
        If $fTransparency < 0x40 Or $fTransparency > 0xFF Then $iDir *= -1
    EndIf
EndFunc
The glowing effect isn't good as in the original CSS version because of the rounded corners. Further it is not designed to add more controls to the GUI easily. It is just to show that it is possible to create such GUIs.

Tested only on Win 8.1. Might not work on WinXP or when Aero is disabled!

Br,

UEZ

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

Here my version:

 

;idea taken from http://codepen.io/jackrugile/full/ABeIi
#Include <WindowsConstants.au3>
#Include <GUIConstantsEx.au3>
#include <GDIPLus.au3>
#include <EditConstants.au3>
#include <StaticConstants.au3>

_GDIPlus_Startup()
Global $__hGUI_, $__iInput_, $__hGUI_Glow, $__bPlayAnim = False
Global Const $fDeg = 180 / ACos(-1), $fRad = ACos(-1) / 180

ModernSearchGUI(800, 300)

_GDIPlus_Shutdown()

Func ModernSearchGUI($iW = @DesktopWidth, $iH = @DesktopHeight)
    Local Const $iBgColor = 0x151515
    $iW = $iW < (346 + 2 * 220 + 3) ? (346 + 2 * 220 + 3) : $iW
    $iH = $iH < 2 * 84 ? 2 * 84 : $iH
    $__hGUI_ = GUICreate("", $iW, $iH, ($iW <> @DesktopWidth) ? (@DesktopWidth - $iW) / 2 : 0, ($iH <> @DesktopHeight) ? (@DesktopHeight - $iH) / 2 : 0, BitOR($WS_TABSTOP, $WS_POPUP), $WS_EX_TOPMOST)
    GUISetBkColor($iBgColor)
    Local Const $iW_Frame = 346, $iH_Frame = 84
    Local Const $iPosX = Int(($iW - $iW_Frame) / 2), $iPosY = Int($iH / 4)
    Local Const $iPicFrame = GUICtrlCreatePic("", $iPosX, $iPosY, $iW_Frame, $iH_Frame)
    GUICtrlSetState(-1, $GUI_DISABLE)
    Local Const $iStripLeft = GUICtrlCreatePic("", $iPosX - 220, $iPosY + $iH_Frame / 2, 220, 2)
    Local Const $iStripRight = GUICtrlCreatePic("", $iPosX + $iW_Frame, $iPosY + $iH_Frame / 2, 220, 2)

    Local $hBmp = _GDIPlus_BitmapCreateFromScan0(220, 2), $hHBmp
    Local $hCtxt = _GDIPlus_ImageGetGraphicsContext($hBmp)

    #Region l/r strips
    Local Const $hBrushL1 = _GDIPlus_LineBrushCreate(0, 0, 220, 1, 0xFF151515, 0xFF0A0A0A, 1)
    Local Const $hBrushR1 = _GDIPlus_LineBrushCreate(0, 0, 220, 1, 0xFF0A0A0A, 0xFF151515, 1)
    Local Const $hBrushL2 = _GDIPlus_LineBrushCreate(0, 0, 220, 1, 0xFF151515, 0xFF2F2F2F, 1)
    Local Const $hBrushR2 = _GDIPlus_LineBrushCreate(0, 0, 220, 1, 0xFF2F2F2F, 0xFF151515, 1)
    _GDIPlus_GraphicsFillRect($hCtxt, 0, 0, 220, 1, $hBrushL1)
    _GDIPlus_GraphicsFillRect($hCtxt, 0, 1, 220, 1, $hBrushL2)
    $hHBmp = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBmp)
    _WinAPI_DeleteObject(GUICtrlSendMsg($iStripLeft, 0x0172, $IMAGE_BITMAP, $hHBmp))
    _WinAPI_DeleteObject($hHBmp)
    _GDIPlus_GraphicsDispose($hCtxt)
    _GDIPlus_ImageRotateFlip($hBmp, 4)
    $hHBmp = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBmp)
    _WinAPI_DeleteObject(GUICtrlSendMsg($iStripRight, 0x0172, $IMAGE_BITMAP, $hHBmp))
    _WinAPI_DeleteObject($hHBmp)
    _GDIPlus_BitmapDispose($hBmp)
    _GDIPlus_BrushDispose($hBrushL1)
    _GDIPlus_BrushDispose($hBrushL2)
    _GDIPlus_BrushDispose($hBrushR1)
    _GDIPlus_BrushDispose($hBrushR2)
    #EndRegion

    #Region Frame
    $hBmp = _GDIPlus_BitmapCreateFromScan0($iW_Frame, $iH_Frame)
    $hCtxt = _GDIPlus_ImageGetGraphicsContext($hBmp)
    _GDIPlus_GraphicsSetSmoothingMode($hCtxt, $GDIP_SMOOTHINGMODE_ANTIALIAS8X4 + (@OSBuild > 5999))
    _GDIPlus_GraphicsClear($hCtxt, 0xFF000000 + $iBgColor)
    Local $hBrushBg = _GDIPlus_LineBrushCreate($iW_Frame / 2, 0, $iW_Frame / 2, $iH_Frame, 0xFF1F1F1F, 0xFF101010, 1)
    _GDIPlus_GraphicsFillRect($hCtxt, 0, 0, $iW_Frame, $iH_Frame, $hBrushBg)

    Local $hPath = _GDIPlus_PathCreate()
    Local Const $hPen = _GDIPlus_PenCreate(0xFF000000)
    Local $aPoints[9][2] = [[8]], $iCorner = 3
    ;outer border
    $aPoints[1][0] = $iCorner
    $aPoints[1][1] = 0
    $aPoints[2][0] = $iW_Frame - $iCorner
    $aPoints[2][1] = 0
    $aPoints[3][0] = $iW_Frame - 1
    $aPoints[3][1] = $iCorner
    $aPoints[4][0] = $iW_Frame - 1
    $aPoints[4][1] = $iH_Frame - $iCorner
    $aPoints[5][0] = $iW_Frame - $iCorner - 1
    $aPoints[5][1] = $iH_Frame - 1
    $aPoints[6][0] = $iCorner
    $aPoints[6][1] = $iH_Frame - 1
    $aPoints[7][0] = 0
    $aPoints[7][1] = $iH_Frame - $iCorner
    $aPoints[8][0] = 0
    $aPoints[8][1] = $iCorner
    _GDIPlus_PathAddClosedCurve2($hPath, $aPoints, 0.025)
    _GDIPlus_GraphicsDrawPath($hCtxt, $hPath, $hPen)

    ;inner border
    _GDIPlus_PathReset($hPath)
    _GDIPlus_PenSetColor($hPen, 0xFF272727)
    $aPoints[1][0] = $iCorner
    $aPoints[1][1] = 1
    $aPoints[2][0] = $iW_Frame - $iCorner
    $aPoints[2][1] = 1
    $aPoints[3][0] = $iW_Frame - 2
    $aPoints[3][1] = $iCorner
    $aPoints[4][0] = $iW_Frame - 2
    $aPoints[4][1] = $iH_Frame - $iCorner
    $aPoints[5][0] = $iW_Frame - $iCorner - 2
    $aPoints[5][1] = $iH_Frame - 2
    $aPoints[6][0] = $iCorner
    $aPoints[6][1] = $iH_Frame - 2
    $aPoints[7][0] = 1
    $aPoints[7][1] = $iH_Frame - $iCorner
    $aPoints[8][0] = 1
    $aPoints[8][1] = $iCorner
    _GDIPlus_PathAddClosedCurve2($hPath, $aPoints, 0.025)
    _GDIPlus_GraphicsDrawPath($hCtxt, $hPath, $hPen)

    $hHBmp = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBmp)
    _WinAPI_DeleteObject(GUICtrlSendMsg($iPicFrame, 0x0172, $IMAGE_BITMAP, $hHBmp))
    _WinAPI_DeleteObject($hHBmp)
    _GDIPlus_GraphicsDispose($hCtxt)
    _GDIPlus_BitmapDispose($hBmp)
    _GDIPlus_BrushDispose($hBrushBg)
    #EndRegion

    #Region input box
    Local Const $iPicBg = GUICtrlCreatePic("", $iPosX + ($iW_Frame - 304) / 2 - 8, $iPosY + 12, 320, 60)
    GUICtrlSetState(-1, $GUI_DISABLE)
    Local $hPicBg = GUICtrlGetHandle($iPicBg)

    _GDIPlus_PathReset($hPath)
    _GDIPlus_PenSetColor($hPen, 0xFF000000)
    _GDIPlus_PenSetWidth($hPen, 2)
    $aPoints[0][0] = 4
    $aPoints[1][0] = 310
    $aPoints[1][1] = 48
    $aPoints[2][0] = 308
    $aPoints[2][1] = 50
    $aPoints[3][0] = 11
    $aPoints[3][1] = 50
    $aPoints[4][0] = 8
    $aPoints[4][1] = 48
    $hBmp = _GDIPlus_BitmapCreateFromScan0(320, 60)
    $hCtxt = _GDIPlus_ImageGetGraphicsContext($hBmp)
    _GDIPlus_GraphicsSetSmoothingMode($hCtxt, $GDIP_SMOOTHINGMODE_ANTIALIAS8X4 + (@OSBuild > 5999))
    _GDIPlus_PathAddCurve2($hPath, $aPoints, 0.025)
    _GDIPlus_GraphicsDrawPath($hCtxt, $hPath, $hPen) ;draw shadow

    _GDIPlus_PathReset($hPath)
    _GDIPlus_PenSetColor($hPen, 0xFF686868)
    _GDIPlus_PenSetWidth($hPen, 1)
    $aPoints[0][0] = 8
    $aPoints[1][0] = 11
    $aPoints[1][1] = 8
    $aPoints[2][0] = 308
    $aPoints[2][1] = 8
    $aPoints[3][0] = 311
    $aPoints[3][1] = 11
    $aPoints[4][0] = 311
    $aPoints[4][1] = 45
    $aPoints[5][0] = 308
    $aPoints[5][1] = 48
    $aPoints[6][0] = 11
    $aPoints[6][1] = 48
    $aPoints[7][0] = 8
    $aPoints[7][1] = 45
    $aPoints[8][0] = 8
    $aPoints[8][1] = 11
    _GDIPlus_PathAddClosedCurve2($hPath, $aPoints, 0.025) ;draw round rectangle
    _GDIPlus_GraphicsDrawPath($hCtxt, $hPath, $hPen)
    Local $hBrush = _GDIPlus_BrushCreateSolid(0xFF2B2B2B)
    _GDIPlus_GraphicsFillPath($hCtxt, $hPath, $hBrush)
    _GDIPlus_GraphicsDrawLine($hCtxt, 230, 8, 230, 48, $hPen)
    _GDIPlus_PenSetColor($hPen, 0xFF000000)
    _GDIPlus_GraphicsDrawLine($hCtxt, 231, 8, 231, 48, $hPen)

    $hHBmp = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBmp)
    _WinAPI_DeleteObject(GUICtrlSendMsg($iPicBg, 0x0172, $IMAGE_BITMAP, $hHBmp))

    _GDIPlus_PathDispose($hPath)
    _GDIPlus_PenDispose($hPen)
    _GDIPlus_BrushDispose($hBrush)
    _WinAPI_DeleteObject($hHBmp)
    _GDIPlus_GraphicsDispose($hCtxt)
    _GDIPlus_BitmapDispose($hBmp)

    $__iInput_ = GUICtrlCreateInput("What are you looking for?", 12 + $iPosX + ($iW_Frame - 304) / 2, $iPosY + ($iH_Frame - 18) / 2, 195, 18, $ES_AUTOHSCROLL, 0)
    GUICtrlSetFont(-1, 10, 400, 0, "Arial", 5)
    GUICtrlSetColor(-1, 0x888888)
    GUICtrlSetBkColor(-1, 0x2B2B2B)
    Local Const $iBtn = GUICtrlCreateLabel("Search", $iPosX + 245, $iPosY + 21, 78, 39, BitOR($SS_CENTER, $SS_CENTERIMAGE, $WS_TABSTOP))
    GUICtrlSetFont(-1, 11, 400, 0, "Arial", 5)
    GUICtrlSetColor(-1, 0xF0F0F0)
    GUICtrlSetBkColor(-1, 0x2B2B2B)
    ControlFocus($__hGUI_ , "", $iBtn)

    $__hGUI_Glow = GUICreate("", $iW_Frame, $iH_Frame, $iPosX, $iPosY, $WS_POPUP, BitOR($WS_EX_MDICHILD, $WS_EX_TRANSPARENT, $WS_EX_LAYERED), $__hGUI_)
    GUISetBkColor(0x00011, $__hGUI_Glow)
    Local Const $iPic_Glow = GUICtrlCreatePic("", 14, 15, 236, 57)
    GUICtrlSetState(-1, $GUI_DISABLE)

    $hBmp = _GDIPlus_BitmapCreateFromScan0(239, 57)
    $hCtxt = _GDIPlus_ImageGetGraphicsContext($hBmp)
    _GDIPlus_GraphicsSetSmoothingMode($hCtxt, 4 + (@OSBuild > 5999))
    _GDIPlus_GraphicsSetPixelOffsetMode($hCtxt, $GDIP_PIXELOFFSETMODE_HIGHQUALITY)

    Local Const $hRegion = _GDIPlus_RegionCreateFromRect(0, 0, $iW_Frame, $iH_Frame)
    _GDIPlus_RegionCombineRect($hRegion, 18, 20, 195, 18, 3)
    _GDIPlus_GraphicsSetClipRegion($hCtxt, $hRegion)

    $hBrushBg = _GDIPlus_LineBrushCreate($iW_Frame / 2, 0, $iW_Frame / 2, $iH_Frame, 0xFF1F1F1F, 0xFF101010, 1)
    _GDIPlus_GraphicsFillRect($hCtxt, 0, 0, $iW_Frame, $iH_Frame, $hBrushBg)
    $hBrush = _GDIPlus_BrushCreateSolid(0xFF2B2B2B)
    _GDIPlus_GraphicsFillRect($hCtxt, 10, 13, 220, 36, $hBrush)

    _GDIPlus_GlowCreate($hCtxt, 10, 8, 10, 49, 8)
    _GDIPlus_GlowCreate($hCtxt, 233, 8, 233, 49, 8)
    _GDIPlus_GlowCreate($hCtxt, 8, 8, 236, 8)
    _GDIPlus_GlowCreate($hCtxt, 8, 49, 236, 49)

    $hHBmp = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBmp)
    _WinAPI_DeleteObject(GUICtrlSendMsg($iPic_Glow, 0x0172, $IMAGE_BITMAP, $hHBmp))

    _GDIPlus_BrushDispose($hBrushBg)
    _GDIPlus_BrushDispose($hBrush)
    _GDIPlus_RegionDispose($hRegion)
    _WinAPI_DeleteObject($hHBmp)
    _GDIPlus_GraphicsDispose($hCtxt)
    _GDIPlus_BitmapDispose($hBmp)

    #EndRegion

    GUISetState(@SW_SHOW, $__hGUI_)
    GUISetState(@SW_SHOW, $__hGUI_Glow)

    _WinAPI_SetLayeredWindowAttributes($__hGUI_Glow, 0x00011, 0x00)

    GUIRegisterMsg($WM_COMMAND, 'WM_COMMAND')
    AdlibRegister("PlayGlowAnim", 30)
    Local $iMpos, $iBState = 0
    Do
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                AdlibUnRegister("PlayGlowAnim")
                GUIDelete()
                Return 1
            Case $iBtn
                MsgBox(0, "Test", GUICtrlRead($__iInput_), 0, $__hGUI_ )
        EndSwitch
        $iMpos = GUIGetCursorInfo($__hGUI_ )[4]
        Switch $iMpos
            Case $iBtn
                If Not $iBState Then
                    GUICtrlSetColor($iBtn, 0x55FF55)
                    GUICtrlSetBkColor($iBtn, 0x383838)
                    $iBState = 1
                EndIf
            Case Else
                If $iBState Then
                    $iBState = 0
                    GUICtrlSetColor($iBtn, 0xF0F0F0)
                    GUICtrlSetBkColor($iBtn, 0x2B2B2B)
                EndIf
        EndSwitch
    Until False
EndFunc

Func WM_COMMAND($hWnd, $iMsg, $wParam, $lParam)
    Switch $hWnd
        Case $__hGUI_
            Switch BitAND($wParam, 0xFFFF)
                Case $__iInput_
                    Switch BitShift($wParam, 16)
                        Case $EN_KILLFOCUS
                            $__bPlayAnim = False
                            WinSetTrans($__hGUI_Glow, "", 0)
                            If GUICtrlRead($__iInput_) = "" Then Return GUICtrlSetData($__iInput_, "What are you looking for?") * 0
                        Case $EN_SETFOCUS
                            $__bPlayAnim = True
                            If GUICtrlRead($__iInput_) = "What are you looking for?" Then GUICtrlSetData($__iInput_, "")
                            Return 0
                    EndSwitch
            EndSwitch
    EndSwitch
    Return $GUI_RUNDEFMSG
EndFunc   ;==>WM_COMMAND

Func _GDIPlus_GlowCreate(ByRef $hGraphics, $iX1, $iY1, $iX2, $iY2, $iSize = 16, $iCInner = 0x6010FF10) ;coded by UEZ build 2015-01-09 beta
    Local Const $fAngle = ATan(($iY2 - $iY1) / ($iX2 - $iX1)) * $fDeg ;calculate the angle of the 2 points
    Local Const $iW = Round(Sqrt(($iY2 - $iY1) ^ 2 + ($iX2 - $iX1) ^ 2), 0), $iH = $iW ;length between the 2 points

    Local Const $hBitmap = _GDIPlus_BitmapCreateFromScan0($iW, $iH)
    Local Const $hCtxt = _GDIPlus_ImageGetGraphicsContext($hBitmap)
    _GDIPlus_GraphicsSetSmoothingMode($hCtxt, $GDIP_SMOOTHINGMODE_HIGHQUALITY)

    Local Const $hMatrix = _GDIPlus_MatrixCreate()
    _GDIPlus_MatrixTranslate($hMatrix, $iW / 2, $iH / 2)
    _GDIPlus_MatrixRotate($hMatrix, $fAngle + 90)
    _GDIPlus_MatrixTranslate($hMatrix, -$iW / 2, -$iH / 2)
    _GDIPlus_GraphicsSetTransform($hCtxt, $hMatrix)

    Local Const $hPath = _GDIPlus_PathCreate()
    _GDIPlus_PathAddRectangle($hPath, ($iW - $iSize) / 2 - $iSize / 2, 0, $iSize * 2, $iH)
    $hBrush_Glow = _GDIPlus_LineBrushCreate(($iW - $iSize) / 2, 0, ($iH + $iSize) / 2, 0, 0, 0)
    Local $aColorGradient[4][2], $iCOuter = 0x00000000
    $aColorGradient[0][0] = 3
    $aColorGradient[1][0] = $iCOuter
    $aColorGradient[1][1] = 0.0
    $aColorGradient[2][0] = $iCInner
    $aColorGradient[2][1] = 0.5
    $aColorGradient[3][0] = $iCOuter
    $aColorGradient[3][1] = 1.0
    _GDIPlus_LineBrushSetPresetBlend($hBrush_Glow, $aColorGradient)
    _GDIPlus_GraphicsFillRect($hCtxt, ($iW - $iSize) / 2, 0, $iSize, $iH, $hBrush_Glow)

    Local $fDX, $fDY
    If $fAngle <= 180 Then  ;adjust position
        $fDX = $iX2 - ($iW / 2 + Cos($fAngle * $fRad) * $iW / 2)
        $fDY = $iY2 - ($iH / 2 + Sin($fAngle * $fRad) * $iH / 2)
    Else
        $fDX = $iX1 - ($iW / 2 + Cos($fAngle * $fRad) * $iW / 2)
        $fDY = $iY1 - ($iH / 2 + Sin($fAngle * $fRad) * $iH / 2)
    EndIf
    _GDIPlus_GraphicsDrawImageRect($hGraphics, $hBitmap, $fDX, $fDY, $iW, $iH)

    _GDIPlus_PathDispose($hPath)
    _GDIPlus_MatrixDispose($hMatrix)
    _GDIPlus_BrushDispose($hBrush_Glow)
    _GDIPlus_GraphicsDispose($hCtxt)
    _GDIPlus_BitmapDispose($hBitmap)
EndFunc   ;==>_GDIPlus_GlowCreate

Func PlayGlowAnim()
    If $__bPlayAnim Then
        Local Static $fTransparency = 0x40, $iDir = 1
        _WinAPI_SetLayeredWindowAttributes($__hGUI_Glow, 0x00011, $fTransparency < 0x40 ? 0x40: $fTransparency > 0xFF ? 0xFF : $fTransparency)
        $fTransparency += 8 * $iDir
        If $fTransparency < 0x40 Or $fTransparency > 0xFF Then $iDir *= -1
    EndIf
EndFunc
The glowing effect isn't good as in the original CSS version because of the rounded corners.

Tested only on Win 8.1. Might not work on WinXP or when Aero is disabled!

Br,

UEZ

 

 

wow nice guı :)

Link to comment
Share on other sites

  • 3 weeks later...

UEZ , how to add more button (like search button with hover effects) ?

I just copy-paste the :

Local Const $iBtn = GUICtrlCreateLabel("Search", $iPosX + 245, $iPosY + 21, 78, 39, BitOR($SS_CENTER, $SS_CENTERIMAGE, $WS_TABSTOP))

GUICtrlSetFont(-1, 11, 400, 0, "Arial", 5)

GUICtrlSetColor(-1, 0xF0F0F0)

GUICtrlSetBkColor(-1, 0x2B2B2B)

ControlFocus($__hGUI_ , "", $iBtn)

Like this :

Local Const $iBtnTWO = GUICtrlCreateLabel("Search", $iPosX + 245, $iPosY + 21, 78, 39, BitOR($SS_CENTER, $SS_CENTERIMAGE, $WS_TABSTOP))

GUICtrlSetFont(-1, 11, 400, 0, "Arial", 5)

GUICtrlSetColor(-1, 0xF0F0F0)

GUICtrlSetBkColor(-1, 0x2B2B2B)

ControlFocus($__hGUI_ , "", $iBtnTWO)

_____________________

in do-until_false area I just copy-paste too like this :

$iMpos = GUIGetCursorInfo($__hGUI_ )[4]

Switch $iMpos

Case $iBtn

If Not $iBState Then

GUICtrlSetColor($iBtn, 0x55FF55)

GUICtrlSetBkColor($iBtn, 0x383838)

$iBState = 1

EndIf

Case Else

If $iBState Then

$iBState = 0

GUICtrlSetColor($iBtn, 0xF0F0F0)

GUICtrlSetBkColor($iBtn, 0x2B2B2B)

EndIf

Case $iBtnTWO

If Not $iBState Then

GUICtrlSetColor($iBtnTWO, 0x55FF55)

GUICtrlSetBkColor($iBtnTWO, 0x383838)

$iBState = 1

EndIf

Case Else

If $iBState Then

$iBState = 0

GUICtrlSetColor($iBtnTWO, 0xF0F0F0)

GUICtrlSetBkColor($iBtnTWO, 0x2B2B2B)

EndIf

EndSwitch

Until False

----------------------------

But, Hover button effect looks terrible. :-o

Help me to fix it !

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