Jump to content

Steam GUI


FinalVersion
 Share

Recommended Posts

The images bugged me, so I wrote a modified version without images that uses the steam theme colors.

#NoTrayIcon
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <SendMessage.au3>
#include <Constants.au3>
#include <WinApi.au3>

Global Const $SC_DRAGMOVE = 0xF012
Opt("MouseCoordMode", 2)

Local $tMsg
Opt("TrayMenuMode", 1)

$frmMain = GUICreate("frmMain", 333, 441, 192, 124, $WS_POPUP, 0)
GUISetState(@SW_SHOW)
GUISetBkColor(0x464646,$frmMain)
$rgn = _WinAPI_CreateRoundRectRgn(0, 0, 333, 441, 3, 3)
_WinAPI_SetWindowRgn($frmMain, $rgn)
DrawBar()

While 1
    $tMsg = TrayGetMsg()
    Switch $tMsg
        Case $TRAY_EVENT_PRIMARYDOWN
            GUISetState(@SW_SHOW)
            DrawBar()
            WinSetState("frmMain", "", @SW_RESTORE)
            Opt("TrayIconHide", 1)
    EndSwitch

    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $GUI_EVENT_PRIMARYDOWN
            $mPos = MouseGetPos()
            If $mPos[1] <= 20 Then
                If $mPos[0] >= 295 And $mPos[0] <= 316 Then
                    GUISetState(@SW_HIDE)
                    Opt("TrayIconHide", 0)
                ElseIf $mPos[0] >= 313 And $mPos[0] <= 322 Then
                    Exit
                Else
                    _SendMessage($frmMain, $WM_SYSCOMMAND, $SC_DRAGMOVE, 0)
                EndIf
            EndIf
    EndSwitch
WEnd

Func DrawBar()
    Local $aDim = WinGetClientSize($frmMain)
    Local $hDC = _WinAPI_GetDC($frmMain)
    ; Bar
    Local $hBrush = _WinAPI_CreateSolidBrush(0x5a6a50)
    Local $hRect = DllStructCreate($tagRECT)
    DllStructSetData($hRect,"Left",0)
    DllStructSetData($hRect,"Top",0)
    DllStructSetData($hRect,"Right",$aDim[0])
    DllStructSetData($hRect,"Bottom",20)
    _WinAPI_FillRect($hDC,DllStructGetPtr($hRect),$hBrush)
    _WinAPI_DeleteObject($hBrush)
    ; Minimize
    $hBrush = _WinAPI_CreateSolidBrush(0xd8ded3)
    DllStructSetData($hRect,"Left",$aDim[0]-37)
    DllStructSetData($hRect,"Top",12)
    DllStructSetData($hRect,"Right",$aDim[0]-28)
    DllStructSetData($hRect,"Bottom",14)
    _WinAPI_FillRect($hDC,DllStructGetPtr($hRect),$hBrush)
    _WinAPI_DeleteObject($hBrush)
    ; Close
    Local $hPen = _WinAPI_CreatePen($PS_SOLID,2,0xd8ded3)
    Local $hSelected = _WinAPI_SelectObject($hDC,$hPen)
    _WinAPI_DrawLine($hDC,$aDim[0]-20, 5, $aDim[0]-11, 14)
    _WinAPI_DrawLine($hDC,$aDim[0]-20, 14, $aDim[0]-11, 5)
    _WinAPI_SelectObject($hDC,$hSelected)
    _WinAPI_DeleteObject($hPen)
    $hBrush = _WinAPI_CreateSolidBrush(0xd8ded3)
    ; Frame Edge
    $hBrush = _WinAPI_CreateSolidBrush(0x686a65)
    DllStructSetData($hRect,"Left",$aDim[0]-1)
    DllStructSetData($hRect,"Top",20)
    DllStructSetData($hRect,"Right",$aDim[0])
    DllStructSetData($hRect,"Bottom",$aDim[1])
    _WinAPI_FillRect($hDC,DllStructGetPtr($hRect),$hBrush)
    DllStructSetData($hRect,"Left",0)
    DllStructSetData($hRect,"Top",20)
    DllStructSetData($hRect,"Right",1)
    DllStructSetData($hRect,"Bottom",$aDim[1])
    _WinAPI_FillRect($hDC,DllStructGetPtr($hRect),$hBrush)
    DllStructSetData($hRect,"Left",0)
    DllStructSetData($hRect,"Top",$aDim[1]-1)
    DllStructSetData($hRect,"Right",$aDim[0])
    DllStructSetData($hRect,"Bottom",$aDim[1])
    _WinAPI_FillRect($hDC,DllStructGetPtr($hRect),$hBrush)
    _WinAPI_DeleteObject($hBrush)
    _WinAPI_ReleaseDC($frmMain,$hDC)
    AdlibRegister("DrawBar")
EndFunc
Edited by NerdFencer

_________[u]UDFs[/u]_________-Mouse UDF-Math UDF-Misc Constants-Uninstaller Shell

Link to comment
Share on other sites

  • 1 month later...

Weird, Tried blue on the background - thats blue.

Tried blue on the titlebar - thats not blue.

Look at: Line 77 and 79 -- nothing to do with above comment

"The mediocre teacher tells. The Good teacher explains. The superior teacher demonstrates. The great teacher inspires." -William Arthur Ward

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