Jump to content
NHD

Custom control don't work correctly

Recommended Posts

NHD

Hi,

I've been translated code from FreeBasic to AutoIt. And it didn't work correctly.

Please help me!

FreeBasic:

#Include Once "windows.bi"

#Define _RGB(r,g,b)  BGR(b,g,r)

CONST GRADIENT_FILL_RECT_H  =  0
CONST GRADIENT_FILL_RECT_V  =  1

Dim Shared hInstance As HINSTANCE

  ' This dll is located in Windows directory
DECLARE FUNCTION Gradientfill Lib "MSIMG32" ALIAS "GradientFill"           _
(hDC AS HDC, pVertex As PTRIVERTEX, dwNumVertex As Integer,pMesh AS PGRADIENT_RECT, dwNumMesh As Integer, dwMode  As Integer) As Integer

'********************************************************************
'     A FB Control Template  
'********************************************************************
Declare Function NiceButt(ByVal hWnd as HWND,byval Msg as UINT,byval wParam as WPARAM,byval lParam as LPARAM) as LRESULT 
Declare FUNCTION IsMouseOver (hWnd As HWND )As Integer
Declare SUB Draw_Gradient (hdc as HDC, x  As Integer, y  As integer, w  As integer, h  As Integer, r  As integer, g  As integer, b As integer)
Declare FUNCTION Register_NiceButt()As Integer

 ' 'Windows calls this function when the dll is loaded. 
/'Function DllMain alias "MAIN"(byval hModule as HMODULE,byval reason as Integer,byval lpReserved as LPVOID) as BOOL  

   Select case reason
      case DLL_PROCESS_ATTACH
         hInstance=hModule
         Register_NiceButt()
         MessageBox(GetActiveWindow(),"OK","OK",MB_OK)
         Return 0
      case DLL_PROCESS_DETACH
         '
   end select 
   return TRUE 

end function 
'/

FUNCTION Register_NiceButt()As Integer Export
DIM  wc AS WNDCLASSEX
DIM  szClassName As String
szClassName     =  "NiceButt"
wc.cbSize        =  SIZEOF(WNDCLASSEX)
wc.style         =  CS_HREDRAW OR CS_VREDRAW OR CS_GLOBALCLASS
wc.hInstance     =  GetmoduleHandle(0) 'hInstance
wc.hbrBackground =  Cast(HBRUSH,COLOR_BTNFACE+1)
wc.lpszClassName =  StrPtr(szClassName)
wc.lpfnWndProc   =  @NiceButt
wc.cbClsExtra    =  0
wc.cbWndExtra    =  0
wc.hIcon         =  0
wc.hCursor       =  0
wc.lpszMenuName  =  0
wc.hIconSm       =  0
FUNCTION         =  RegisterClassEx(@wc)
END FUNCTION

'********************************************************************
'                      Custom Control Procedure
'********************************************************************

Function NiceButt(ByVal hWnd as HWND,byval Msg as UINT,byval wParam as WPARAM,byval lParam as LPARAM) as LRESULT
STATIC  As Integer ButtDown,mouseover
STATIC Captured AS HWND

SELECT Case Msg

'**************************
  CASE WM_CREATE
'**************************

  DIM   Region AS HRGN
  DIM   Rct AS RECT
  DIM As Integer  x, y, w, h
  ButtDown = FALSE
  GetClientRect (hWnd,@Rct)      ' <<-- Get the size of our control
  x = Rct.left
  y = Rct.top
  w = Rct.right  - Rct.left
  h = Rct.bottom - Rct.top

  'Region = CreateRoundRectRgn(10,10,w,h, h * 0.90 , h * 0.90 )

  'SetWindowRgn (hWnd,Region,True)
  InvalidateRect(hWnd,0,0)
  'EXIT FUNCTION

' *******************
  CASE WM_PAINT
' *******************

  DIM   hDC       AS HDC
  DIM   ps        AS PAINTSTRUCT
  DIM   hPen      AS HPEN
  DIM   hBrush    AS HBRUSH
  DIM   hOldBrush AS HBRUSH
  DIM   Rct       AS RECT
  DIM   Size      AS SIZE
  DIM   T As ZString*2048
  DIM As Integer i
  DIM As Integer  XCtr
  DIM As Integer  YCtr
  DIM As Integer  x,y,w,h
  DIM As Integer  r,g,b

' *******************

  GetClientRect (hWnd,@Rct)      ' <<-- Get the size of our control
  x = Rct.left
  y = Rct.top
  w = Rct.right  - Rct.left
  h = Rct.bottom - Rct.top

  XCtr = (Rct.left + Rct.right)  / 2  ' Horizontal center of our ctrl
  YCtr = (Rct.top  + Rct.bottom) / 2  ' Vertical   center of our ctrl
  GetWindowText(hWnd,T ,255)          ' Grab a copy of control caption

'**********************************
'        Draw our control
'**********************************

  hDC = BeginPaint (hWnd, @ps)
  GetTextExtentPoint32(hDC, T , LEN(T),@Size)    ' Get caption size
  r = 30 : g = 90 : b = 90
  Draw_Gradient (hDC, x, y, w, h, r, g, b)
  SetBkMode (hDC,TRANSPARENT)

  IF ButtDown THEN
    SetTextColor(hDC,_RGB(255,0,0))
    TextOut(hDC, XCtr-(Size.cx/2)+1, YCtr-(Size.cy/2)+1,T,LEN(T))
  ELSE
    SetTextColor(hDC,_RGB(0,0,255))
    TextOut(hDC, XCtr-Size.cx/2, YCtr-Size.cy/2,T,LEN(T))
  END IF

  EndPaint (hWnd,@ps)
  'EXIT FUNCTION

'******************************
  CASE WM_LBUTTONUP
'******************************

  IF hWnd = Captured THEN
    DIM   hParent AS HWND
    ReleaseCapture()
    ButtDown = FALSE
    InvalidateRect(hWnd,0,0)
    hParent=GetParent(hWnd)
    SendMessage(hParent,WM_COMMAND,MAKELONG(GetWindowLong(hWnd,GWL_ID), BN_CLICKED),Cast(LONG,hWnd))
  END IF
  'EXIT FUNCTION

'******************************
  CASE WM_LBUTTONDOWN
'******************************

  SetCapture(hWnd)
  Captured = hWnd
  ButtDown = TRUE
  SetFocus (hWnd)
  InvalidateRect(hWnd,0,0)
  'EXIT FUNCTION

'******************************
  CASE WM_MOUSEMOVE
'******************************

  IF ButtDown THEN
    IF IsMouseOver(hWnd) THEN
      ButtDown = TRUE
      InvalidateRect(hWnd,0,0)
    ELSE
      ReleaseCapture()
      ButtDown = FALSE
      InvalidateRect(hWnd,0,0)
    END IF
  END IF
  'EXIT FUNCTION

'******************************
  CASE WM_MOVING
'******************************

  ReleaseCapture()
  ButtDown = FALSE
  InvalidateRect(hWnd,0,0)
  'EXIT FUNCTION

'******************************
  CASE WM_SIZE
'******************************

  ReleaseCapture()
  ButtDown = FALSE
  InvalidateRect(hWnd,0,0)
  'EXIT FUNCTION

END Select
Return DefWindowProc(hwnd,Msg,wparam,lparam)
END FUNCTION







SUB Draw_Gradient (hdc as HDC, x  As Integer, y  As integer, w  As integer, h  As Integer, r  As integer, g  As integer, b As integer)
DIM  Vert(2) AS TRIVERTEX
DIM   Rect    AS GRADIENT_RECT
'******************************************************
Vert (0).x      =    0
Vert (0).y      =    0
Vert (0).Red    =    65535-(65535-(r*256))
Vert (0).Green  =    65535-(65535-(g*256))
Vert (0).Blue   =    65535-(65535-(b*256))
Vert (0).Alpha  =    0
'******************************************************
Vert (1).x      =    w
Vert (1).y      =    h/2
Vert (1).Red    =    65535-(65535-(255*256))
Vert (1).Green  =    65535-(65535-(255*256))
Vert (1).Blue   =    65535-(65535-(255*256))
Vert (1).Alpha  =    0
'******************************************************
Rect.UpperLeft  =    0
Rect.LowerRight =    1
'******************************************************
Gradientfill(hdc,@Vert(0),2,@Rect,1,GRADIENT_FILL_RECT_V)
'******************************************************
Vert (0).x      =    0
Vert (0).y      =    h/2
Vert (0).Red    =    65535-(65535-(255*256))
Vert (0).Green  =    65535-(65535-(255*256))
Vert (0).Blue   =    65535-(65535-(255*256))
Vert (0).Alpha  =    0
'******************************************************
Vert (1).x      =    w
Vert (1).y      =    h
Vert (1).Red    =    65535-(65535-(r*256))
Vert (1).Green  =    65535-(65535-(g*256))
Vert (1).Blue   =    65535-(65535-(b*256))
Vert (1).Alpha  =    0
'******************************************************
Rect.UpperLeft  =    0
Rect.LowerRight =    1
'******************************************************
Gradientfill(hdc,@Vert(0),2,@Rect,1,GRADIENT_FILL_RECT_V)
END SUB

FUNCTION IsMouseOver (hWnd As HWND )As Integer
DIM  Rect As RECT
DIM  Pt   As POINT
GetWindowRect (hWnd, @Rect)
GetCursorPos(@Pt)
FUNCTION = PtInRect (@Rect, Pt)
END FUNCTION

 

AutoIt:

#include-once
#include <WinAPI.au3>
#include <WinAPIGdi.au3>
#include <WinAPISys.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
;~ #Include <windows.bi>

Global Const $_tagRect              = "struct;long left;long top;long right;long bottom;endstruct"
Global Const $_tagSize              = "struct;long cx;long cy;endstruct"
Global Const $_tagGradient_Rect     = "struct;ulong UpperLeft;ulong LowerRight;endstruct"
Global Const $_tagPoint             = "struct;long x;long y;endstruct"
Global Const $_tagTrivertex         = "struct;long x;long y;int Red;int Greed;int Blue;int Alpha;endstruct"
Global Const $_tagPaintStruct       = "struct;handle hdc;bool fErase;long left;long top;long right;long bottom;bool fRestore;bool fIncUpdate;byte rgbReserved[32];endstruct"
Global Const $_tagWNDCLASSEX        = "struct;uint cbSize;uint style;ptr lpfnWndProc;int cbClsExtra;int cbWndExtra;ptr hInstance;ptr hIcon;" & _
                                    "ptr hCursor; ptr hbrBackground; ptr lpszMenuName;ptr lpszClassName;ptr hIconSm;endstruct"
Global Const $CS_VREDRAW            = 0x0001, $CS_HREDRAW =0x0002, $CS_GLOBALCLASS = 0x4000
Global Const $BN_CLICKED            = 0
;~ #Define _RGB(r,g,b)  BGR(b,g,r)

Global Const $GRADIENT_FILL_RECT_H  =  0
Global Const $GRADIENT_FILL_RECT_V  =  1

;~ Dim Shared hInstance As HINSTANCE

;~   ' This dll is located in Windows directory
;~ DECLARE FUNCTION Gradientfill Lib "MSIMG32" ALIAS "GradientFill"           _
;~ (hDC AS HDC, pVertex As PTRIVERTEX, dwNumVertex As Integer,pMesh AS PGRADIENT_RECT, dwNumMesh As Integer, dwMode  As Integer) As Integer

;~ '********************************************************************
;~ '     A FB Control Template
;~ '********************************************************************
;~ Declare Function NiceButt(ByVal hWnd as HWND,byval Msg as UINT,byval wParam as WPARAM,byval lParam as LPARAM) as LRESULT
;~ Declare FUNCTION IsMouseOver (hWnd As HWND )As Integer
;~ Declare SUB Draw_Gradient (hdc as HDC, x  As Integer, y  As integer, w  As integer, h  As Integer, r  As integer, g  As integer, b As integer)
;~ Declare FUNCTION Register_NiceButt()As Integer

#cs
 ' 'Windows calls this function when the dll is loaded.
/'Function DllMain alias "MAIN"(byval hModule as HMODULE,byval reason as Integer,byval lpReserved as LPVOID) as BOOL

   Select case reason
      case DLL_PROCESS_ATTACH
         hInstance=hModule
         Register_NiceButt()
         MessageBox(GetActiveWindow(),"OK","OK",MB_OK)
         Return 0
      case DLL_PROCESS_DETACH
         '
   end select
   return True

end function
'/
#ce



#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 615, 437, 192, 124)

RegisterButton()
Global $Ctrl = _winapi_CreateWindowEx(0, "TestButton", "Test", BitOR($WS_VISIBLE, $WS_CHILD), 10, 10, 80, 30, $Form1)



ConsoleWrite(@CRLF & $Ctrl)
GUISetState(@SW_SHOW)

_WinAPI_UpdateWindow($Form1)
#EndRegion ### END Koda GUI section ###

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

    EndSwitch
WEnd


Func RegisterButton()

    Local $hDll = DllCallbackRegister('TestButtonProc', 'lresult', 'hwnd;uint;wparam;lparam')

;~  DIM  wc AS WNDCLASSEX
;~  DIM  szClassName As String
    Local $sClass = "TestButton"
    Local $wc = DllStructCreate($_tagWNDCLASSEX & ';wchar szClassName[' & (StringLen($sClass) + 1) & ']')

;~  szClassName         =  "NiceButt"

;~  wc.cbSize           =  SIZEOF(WNDCLASSEX)
    $wc.cbSize          =  DllStructGetPtr($wc, 'szClassName') - DllStructGetPtr($wc)

;~  wc.style            =  CS_HREDRAW OR CS_VREDRAW OR CS_GLOBALCLASS
    $wc.style           =  BitOR($CS_HREDRAW, $CS_VREDRAW, $CS_GLOBALCLASS)

;~  wc.hInstance        =  GetmoduleHandle(0) 'hInstance
    $wc.hInstance       =  _WinAPI_GetModuleHandle(0)

;~  wc.hbrBackground    =  Cast(HBRUSH,COLOR_BTNFACE+1) ;///
    $wc.hbrBackground   =  _WinAPI_CreateSolidBrush(_WinAPI_GetSysColor($COLOR_BTNFACE))

;~  wc.lpszClassName    =  StrPtr(szClassName)
    $wc.lpszClassName   =  DllStructGetPtr($wc, 'szClassName')

;~  wc.lpfnWndProc      =  @NiceButt
    $wc.lpfnWndProc     =  DllCallbackGetPtr($hDll)

;~  wc.cbClsExtra       =  0
    $wc.cbClsExtra      =  0

;~  wc.cbWndExtra       =  0
    $wc.cbWndExtra      =  0

;~  wc.hIcon            =  0
    $wc.hIcon           =  0

;~  wc.hCursor          =  0
    $wc.hCursor         =  0

;~  wc.lpszMenuName     =  0
    $wc.lpszMenuName    =  0

;~  wc.hIconSm          =  0
    $wc.hIconSm         =  0

    $wc.szClassName     =  $sClass

;~  FUNCTION            =  RegisterClassEx(@wc)
    Local $aRet = _WinAPI_RegisterClassEx($wc)
    Return $aRet
;~ END FUNCTION
EndFunc

;********************************************************************
;                      Custom Control Procedure
;********************************************************************

;~ Function NiceButt(ByVal hWnd as HWND,byval Msg as UINT,byval wParam as WPARAM,byval lParam as LPARAM) as LRESULT
Func TestButtonProc($hWnd, $iMsg, $wParam, $lParam)
    Static $bBtnDown, $bMouseOver, $hCaptured

    Switch $iMsg
        Case $WM_CREATE
            Local $Rct = DllStructCreate($_tagRect)
            Local $iX, $iY, $iW, $iH
            $bBtnDown = False
            GetClientRect($hWnd, $Rct)

            $iX = $Rct.left
            $iY = $Rct.top
            $iW = $Rct.right - $Rct.left
            $iH = $Rct.bottom - $Rct.top

            InvalidateRect($hWnd, 0, False)
;~          EXIT FUNCTION
;~          Return 0

        Case $WM_PAINT
            Local $ps ;= DllStructCreate($_tagPaintStruct)
            Local $hPen, $hBrush, $hOldBrush
            Dim $Rct = DllStructCreate($_tagRect)
            Dim $Size = DllStructCreate($_tagSize)
            Dim $T = "", $i
            Dim $XCtr, $YCtr
            Dim $iX, $iY, $iW, $iH
            Dim $iR, $iG, $iB

            GetClientRect($hWnd, $Rct)

            $iX = $Rct.left
            $iY = $Rct.top
            $iW = $Rct.right  - $Rct.left
            $iH = $Rct.bottom - $Rct.top

            $XCtr = ($Rct.left + $Rct.right)  / 2
            $YCtr = ($Rct.top  + $Rct.bottom) / 2
;~          GetWindowText(hWnd,T ,255)          ' Grab a copy of control caption

;~          DllCall("user32.dll", "int", "GetWindowTextW", "hwnd", $hWnd, "LPTSTR ", $T, "int", 255) ; not work
            $T = "Test"
            ;**********************************
            ;        Draw our control
            ;**********************************

            Local $hDC = BeginPaint($hWnd, $ps)
;~          GetTextExtentPoint32(hDC, T , LEN(T),@Size)    ' Get caption size
            GetTextExtentPoint32($hDC, $T, StringLen($T), $Size)

            $iR = 30
            $iG = 90
            $iB = 90
            Draw_Gradient($hDC, $iX, $iY, $iW, $iH, $iR, $iG, $iB)
            SetBkMode($hDC, $TRANSPARENT)

            If $bBtnDown Then
;~              SetTextColor(hDC,_RGB(255,0,0))
                SetTextColor($hDC, Dec(0xFF0000))
                TextOut($hDC, $XCtr-($Size.cx/2)+1, $YCtr-($Size.cy/2)+1, $T)

            Else
;~              SetTextColor(hDC,_RGB(0,0,255))
                SetTextColor($hDC, Dec(0x0000FF))
                TextOut($hDC, $XCtr-$Size.cx/2, $YCtr-$Size.cy/2, $T)


            EndIf
            EndPaint($hWnd, $ps)

;~          EXIT FUNCTION
;~          Return 0

        Case $WM_LBUTTONUP
            If $hWnd = $hCaptured Then
                ReleaseCapture()
                $bBtnDown = False
                InvalidateRect($hWnd, 0, 0)
                Local $hParent = GetParent($hWnd)
;~              SendMessage(hParent,WM_COMMAND,MAKELONG(GetWindowLong(hWnd,GWL_ID), BN_CLICKED),Cast(LONG,hWnd))
                DllCall("user32.dll", "LRESULT", "SendMessageW", _
                        "hwnd",     $hParent, _
                        "uint",     $WM_COMMAND, _
                        "WPARAM",   _WinAPI_MakeLong(_WinAPI_GetWindowLong($hWnd, $GWL_ID), $BN_CLICKED), _
                        "LPARAM",   $hWnd)
            EndIf
;~          EXIT FUNCTION
            Return 0

        Case $WM_LBUTTONDOWN
            SetCapture($hWnd)
            $hCaptured = $hWnd
            $bBtnDown = True
            SetFocus($hWnd)
            InvalidateRect($hWnd, 0, False)

;~          EXIT FUNCTION
            Return 0

        Case $WM_MOUSEMOVE
            If $bBtnDown Then
                If IsMouseOver($hWnd) Then
                    $bBtnDown = True
                    InvalidateRect($hWnd, 0, False)
                ELSE
                    ReleaseCapture()
                    $bBtnDown = False
                    InvalidateRect($hWnd, 0, False)
                EndIf
            EndIf

;~          EXIT FUNCTION
;~          Return 0

        Case $WM_MOVING
            ReleaseCapture()
            $bBtnDown = False
            InvalidateRect($hWnd, 0, False)

;~          EXIT FUNCTION
;~          Return 0

        Case $WM_SIZE
            ReleaseCapture()
            $bBtnDown = False
            InvalidateRect($hWnd, 0, False)

;~          EXIT FUNCTION
;~          Return 0

    EndSwitch
;~  Return _WinAPI_DefWindowProc($hWnd, $iMsg, $wParam, $lParam)
    Return DllCall("user32.dll", "lresult", "DefWindowProcW", "hwnd", $hWnd, "uint", $iMsg, "wparam", $wParam, _
            "lparam", $lParam)[0]
EndFunc

;~ SUB Draw_Gradient (hdc as HDC, x  As Integer, y  As integer, w  As integer, h  As Integer, r  As integer, g  As integer, b As integer)
Func Draw_Gradient($hDC, $iX, $iY, $iW, $iH, $iR, $iG, $iB)
;~  DIM  Vert(2) AS TRIVERTEX
    Local $Vert[2]
    $Vert[0] = DllStructCreate($_tagTrivertex)
    $Vert[1] = DllStructCreate($_tagTrivertex)
;~  DIM  Rect    AS GRADIENT_RECT
    Local $Rect = DllStructCreate($_tagGradient_Rect)

;~  Vert (0).x          =   0
    $Vert[0].x          =   0
;~  Vert (0).y          =   0
    $Vert[0].y          =   0
;~  Vert (0).Red        =   65535-(65535-(r*256))
    $Vert[0].Red        =   65535-(65535-($iR*256))
;~  Vert (0).Green      =   65535-(65535-(g*256))
    $Vert[0].Green      =   65535-(65535-($iG*256))
;~  Vert (0).Blue       =   65535-(65535-(b*256))
    $Vert[0].Blue       =   65535-(65535-($iB*256))
;~  Vert (0).Alpha      =   0
    $Vert[0].Alpha      =   0
;~ '******************************************************
;~  Vert (1).x          =    w
    $Vert[1].x          =    $iW
;~  Vert (1).y          =    h/2
    $Vert[1].y          =    $iH/2
;~  Vert (1).Red        =    65535-(65535-(255*256))
    $Vert[1].Red        =    65535-(65535-(255*256))
;~  Vert (1).Green      =    65535-(65535-(255*256))
    $Vert[1].Green      =    65535-(65535-(255*256))
;~  Vert (1).Blue       =    65535-(65535-(255*256))
    $Vert[1].Blue       =    65535-(65535-(255*256))
;~  Vert (1).Alpha      =    0
    $Vert[1].Alpha      =    0
;~ '******************************************************
;~  Rect.UpperLeft      =    0
    $Rect.UpperLeft     =    0
;~  Rect.LowerRight     =    1
    $Rect.LowerRight    =    1
;~ '******************************************************
;~  Gradientfill(hdc,@Vert(0),2,@Rect,1,GRADIENT_FILL_RECT_V)
    GradientFill($hDC, $Vert[0], 2, $Rect, 1, $GRADIENT_FILL_RECT_V)
;~ '******************************************************
;~  Vert (0).x          =    0
    $Vert[0].x          =    0
;~  Vert (0).y          =    h/2
    $Vert[0].y          =    $iH/2
;~  Vert (0).Red        =    65535-(65535-(255*256))
    $Vert[0].Red        =    65535-(65535-(255*256))
;~  Vert (0).Green      =    65535-(65535-(255*256))
    $Vert[0].Green      =    65535-(65535-(255*256))
;~  Vert (0).Blue       =    65535-(65535-(255*256))
    $Vert[0].Blue       =    65535-(65535-(255*256))
;~  Vert (0).Alpha      =    0
    $Vert[0].Alpha      =    0
;~ '******************************************************
;~  Vert (1).x          =    w
    $Vert[1].x          =    $iW
;~  Vert (1).y          =    h
    $Vert[1].y          =    $iH
;~  Vert (1).Red        =    65535-(65535-(r*256))
    $Vert[1].Red        =    65535-(65535-($iR*256))
;~  Vert (1).Green      =    65535-(65535-(g*256))
    $Vert[1].Green      =    65535-(65535-($iG*256))
;~  Vert (1).Blue       =    65535-(65535-(b*256))
    $Vert[1].Blue       =    65535-(65535-($iB*256))
;~  Vert (1).Alpha      =    0
    $Vert[1].Alpha      =    0
;~ '******************************************************
;~  Rect.UpperLeft      =    0
    $Rect.UpperLeft     =    0
;~  Rect.LowerRight     =    1
    $Rect.LowerRight    =    1
;~ '******************************************************
;~  Gradientfill(hdc,@Vert(0),2,@Rect,1,GRADIENT_FILL_RECT_V)
    GradientFill($hDC, $Vert[0], 2, $Rect, 1, $GRADIENT_FILL_RECT_V)
;~ END SUB
EndFunc

Func IsMouseOver($hWnd)
    Local $Rect = DllStructCreate($_tagRect)
    Local $Pt = DllStructCreate($_tagPoint)
    GetWindowRect ($hWnd, $Rect)
    GetCursorPos($Pt)
    Return PtInRect($Rect, $Pt)
EndFunc

Func _RGB($iR, $iG, $iB)
    Return ('0x' & Hex($iR, 2) & Hex($iG, 2) & Hex($iB, 2))
EndFunc

Func _BGR($iB, $iG, $iR)
    Return ('0x' & Hex($iB, 2) & Hex($iG, 2) & Hex($iR, 2))
EndFunc

Func InvalidateRect($hWnd, $tRECT = 0, $bErase = True)
    DllCall("user32.dll", "bool", "InvalidateRect", "hwnd", $hWnd, "struct*", $tRECT, "bool", $bErase)
EndFunc

Func SetFocus($hWnd)
    DllCall("user32.dll", "hwnd", "SetFocus", "hwnd", $hWnd)
EndFunc

Func PtInRect($tRect, $tPoint)
    Local $aRet = DllCall("user32.dll", "bool", "PtInRect", "ptr", DllStructGetPtr($tRect), "struct*", $tPoint)
    If IsArray($aRet) Then Return $aRet[0]
    Return False
EndFunc

Func GetWindowRect($hWnd, ByRef $tRect)
    DllCall("user32.dll", "bool", "GetWindowRect", "hwnd", $hWnd, "struct*", $tRect)
EndFunc

Func GetCursorPos(ByRef $tPoint)
    DllCall("user32.dll", "bool", "GetCursorPos", "struct*", $tPoint)
EndFunc

Func SetCapture($hWnd)
    DllCall("user32.dll", "hwnd", "SetCapture", "hwnd", $hWnd)
EndFunc

Func ReleaseCapture()
    DllCall("user32.dll", "bool", "ReleaseCapture")
EndFunc

Func SetTextColor($hDC, $iColor)
    DllCall("gdi32.dll", "INT", "SetTextColor", "handle", $hDC, "INT", $iColor)
EndFunc

Func BeginPaint($hWnd, ByRef $tPAINTSTRUCT)
    $tPAINTSTRUCT = DllStructCreate($tagPAINTSTRUCT)
    Local $aRet = DllCall('user32.dll', 'handle', 'BeginPaint', 'hwnd', $hWnd, 'struct*', $tPAINTSTRUCT)
    If @error Then Return SetError(@error, @extended, 0)
    Return $aRet[0]
EndFunc

Func GetTextExtentPoint32($hDC, $sText, $iTextLen, ByRef $tSize)
    DllCall("gdi32.dll", "bool", "GetTextExtentPoint32W", "handle", $hDC, "wstr", $sText, "int", $iTextLen, "struct*", $tSize)
EndFunc

Func GradientFill($hDC, $tVertex, $nVertex, $tMesh, $nMesh, $ulMode)
    DllCall("Msimg32.dll", "BOOL", "GradientFill", _
            "handle",   $hDC, _
            "struct*",  $tVertex, _
            "ulong",    $nVertex, _
            "struct*",  $tMesh, _
            "ulong",    $nMesh, _
            "ulong",    $ulMode)
EndFunc

Func GetParent($hWnd)
    Local $aResult = DllCall("user32.dll", "hwnd", "GetParent", "hwnd", $hWnd)
    If @error Then Return SetError(@error, @extended, 0)
    Return $aResult[0]
EndFunc

Func SetBkMode($hDC, $iBkMode)
    Local $aResult = DllCall("gdi32.dll", "int", "SetBkMode", "handle", $hDC, "int", $iBkMode)
    If @error Then Return SetError(@error, @extended, 0)

    Return $aResult[0]
EndFunc

Func EndPaint($hWnd, ByRef $tPAINTSTRUCT)
    Local $aRet = DllCall('user32.dll', 'bool', 'EndPaint', 'hwnd', $hWnd, 'struct*', $tPAINTSTRUCT)
    If @error Then Return SetError(@error, @extended, False)
    Return $aRet[0]
EndFunc

Func GetClientRect($hWnd, ByRef $tRect)
    Local $aRet = DllCall("user32.dll", "bool", "GetClientRect", "hwnd", $hWnd, "struct*", $tRect)
    If @error Or Not $aRet[0] Then Return SetError(@error + 10, @extended, 0)
    Return $tRect
EndFunc

Func TextOut($hDC, $iX, $iY, $sText, $iTextLen = Default)
    If $iTextLen = Default Then $iTextLen = StringLen($sText)
    DllCall('gdi32.dll', 'bool', 'TextOutW', 'handle', $hDC, 'int', $iX, 'int', $iY, 'wstr', $sText, 'int', $iTextLen)
EndFunc

 

Share this post


Link to post
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

  • Similar Content

    • VADemon
      By VADemon
      I've encountered a problem with a single file where I cannot retrieve it's Date-time. So far my code has worked well for over 30 files, but this one is a mystery I cannot debug myself due to insufficient Au3 knowledge.
      In line 11 "_Date_Time_FileTimeToArray" is called and for this particular file it sets the @error to 10. I don't know what that error code means, but it's not set by the _Date functions themselves I think.
      Overall, it could be a problem caused by any of the functions below, how can I properly debug this? / Does anybody know a what's causing this?
      _WinAPI_CreateFile() / _Date_Time_GetFileTime() / _Date_Time_FileTimeToArray()
      Func _SetFileTimes($sFilePath) Local $monthNumber[13] = ["", "January", "February", "March", "April", "May", "Juny", "July", "August", "September", "October", "November", "December"] Local $dayNumber[7] = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"] Local $fHandle = _WinAPI_CreateFile($sFilePath, 2, 2) ; read-only ; may NOT return a valid date for some reason! TODO Local $fTagFILETIME = _Date_Time_GetFileTime($fHandle) _WinAPI_CloseHandle($fHandle) ; This will return an empty array if theres no valid date $fModTime = _Date_Time_FileTimeToArray($fTagFILETIME[2]) ; last Modified if @error <> 10 then Local $year = $fModTime[2] Local $month = $fModTime[0] Local $day = $fModTime[1] Local $hour = $fModTime[3] Local $min = $fModTime[4] Local $sec = $fModTime[5] Local $ms = $fModTime[6] Local $weekday = $fModTime[7] Global $prettyTimestamp = StringFormat("%s, %s %d, %04d %02d:%02d:%02d", $dayNumber[$weekday], $monthNumber[$month], $day, $year, $hour, $min, $sec) Global $uploadDate = StringFormat("%04d-%02d-%02d", $year, $month, $day) $fModTime = _Date_Time_FileTimeToArray(_Date_Time_FileTimeToLocalFileTime($fTagFILETIME[2])) ; last Modified Local $year = $fModTime[2] Local $month = $fModTime[0] Local $day = $fModTime[1] Local $hour = $fModTime[3] Local $min = $fModTime[4] Local $sec = $fModTime[5] Local $ms = $fModTime[6] Local $weekday = $fModTime[7] ; GetUnixTime accounts for Local time, hence feed it local time Global $unixTimestamp = _GetUnixTime($year &"/"& $month &"/"& $day &" "& $hour&":"& $min &":"& $sec) else Global $prettyTimestamp = "N/A" Global $uploadDate = "" Global $unixTimestamp = "N/A" endif endfunc  
      _GetUnixTime returned the year 1601 start date, showing that $fModTime is probably equal 0. (But Why?)
      The file reports these dates in Explorer, it's on local NTFS drive:
      Created: ‎‎Wednesday, ‎31. ‎Januar ‎2018, ‏‎18:55:02
      Modified: ‎Wednesday, ‎10. ‎Januar ‎2018, ‏‎12:39:23
      Accessed: ‎Wednesday, ‎10. ‎Januar ‎2018, ‏‎12:39:23
    • astrionn
      By astrionn
      Hi Guys,
       
      I`m trying to record with my webcam in 5s intervalls and do some stuff between starting to record and stoping.
      I took code from here: https://www.autoitscript.com/forum/topic/27925-webcam-example/
      and took what looked relevant to me.
      I use 3 different files:
       Is called WMS.au3 and contains all the constants for the dll calls is called rec.au3 and does all necessary dll calls to start a webcam recording to a file Is called stopcam.exe and does the dll calls to stop recording into a file WMS.au3  :
      $WM_CAP_START = 0x400 $WM_CAP_UNICODE_START = $WM_CAP_START +100 $WM_CAP_PAL_SAVEA = $WM_CAP_START + 81 $WM_CAP_PAL_SAVEW = $WM_CAP_UNICODE_START + 81 $WM_CAP_UNICODE_END = $WM_CAP_PAL_SAVEW $WM_CAP_ABORT = $WM_CAP_START + 69 $WM_CAP_DLG_VIDEOCOMPRESSION = $WM_CAP_START + 46 $WM_CAP_DLG_VIDEODISPLAY = $WM_CAP_START + 43 $WM_CAP_DLG_VIDEOFORMAT = $WM_CAP_START + 41 $WM_CAP_DLG_VIDEOSOURCE = $WM_CAP_START + 42 $WM_CAP_DRIVER_CONNECT = $WM_CAP_START + 10 $WM_CAP_DRIVER_DISCONNECT = $WM_CAP_START + 11 $WM_CAP_DRIVER_GET_CAPS = $WM_CAP_START + 14 $WM_CAP_DRIVER_GET_NAMEA = $WM_CAP_START + 12 $WM_CAP_DRIVER_GET_NAMEW = $WM_CAP_UNICODE_START + 12 $WM_CAP_DRIVER_GET_VERSIONA = $WM_CAP_START + 13 $WM_CAP_DRIVER_GET_VERSIONW = $WM_CAP_UNICODE_START + 13 $WM_CAP_EDIT_COPY = $WM_CAP_START + 30 $WM_CAP_END = $WM_CAP_UNICODE_END $WM_CAP_FILE_ALLOCATE = $WM_CAP_START + 22 $WM_CAP_FILE_GET_CAPTURE_FILEA = $WM_CAP_START + 21 $WM_CAP_FILE_GET_CAPTURE_FILEW = $WM_CAP_UNICODE_START + 21 $WM_CAP_FILE_SAVEASA = $WM_CAP_START + 23 $WM_CAP_FILE_SAVEASW = $WM_CAP_UNICODE_START + 23 $WM_CAP_FILE_SAVEDIBA = $WM_CAP_START + 25 $WM_CAP_FILE_SAVEDIBW = $WM_CAP_UNICODE_START + 25 $WM_CAP_FILE_SET_CAPTURE_FILEA = $WM_CAP_START + 20 $WM_CAP_FILE_SET_CAPTURE_FILEW = $WM_CAP_UNICODE_START + 20 $WM_CAP_FILE_SET_INFOCHUNK = $WM_CAP_START + 24 $WM_CAP_GET_AUDIOFORMAT = $WM_CAP_START + 36 $WM_CAP_GET_CAPSTREAMPTR = $WM_CAP_START + 1 $WM_CAP_GET_MCI_DEVICEA = $WM_CAP_START + 67 $WM_CAP_GET_MCI_DEVICEW = $WM_CAP_UNICODE_START + 67 $WM_CAP_GET_SEQUENCE_SETUP = $WM_CAP_START + 65 $WM_CAP_GET_STATUS = $WM_CAP_START + 54 $WM_CAP_GET_USER_DATA = $WM_CAP_START + 8 $WM_CAP_GET_VIDEOFORMAT = $WM_CAP_START + 44 $WM_CAP_GRAB_FRAME = $WM_CAP_START + 60 $WM_CAP_GRAB_FRAME_NOSTOP = $WM_CAP_START + 61 $WM_CAP_PAL_AUTOCREATE = $WM_CAP_START + 83 $WM_CAP_PAL_MANUALCREATE = $WM_CAP_START + 84 $WM_CAP_PAL_OPENA = $WM_CAP_START + 80 $WM_CAP_PAL_OPENW = $WM_CAP_UNICODE_START + 80 $WM_CAP_PAL_PASTE = $WM_CAP_START + 82 $WM_CAP_SEQUENCE = $WM_CAP_START + 62 $WM_CAP_SEQUENCE_NOFILE = $WM_CAP_START + 63 $WM_CAP_SET_AUDIOFORMAT = $WM_CAP_START + 35 $WM_CAP_SET_CALLBACK_CAPCONTROL = $WM_CAP_START + 85 $WM_CAP_SET_CALLBACK_ERRORA = $WM_CAP_START + 2 $WM_CAP_SET_CALLBACK_ERRORW = $WM_CAP_UNICODE_START + 2 $WM_CAP_SET_CALLBACK_FRAME = $WM_CAP_START + 5 $WM_CAP_SET_CALLBACK_STATUSA = $WM_CAP_START + 3 $WM_CAP_SET_CALLBACK_STATUSW = $WM_CAP_UNICODE_START + 3 $WM_CAP_SET_CALLBACK_VIDEOSTREAM = $WM_CAP_START + 6 $WM_CAP_SET_CALLBACK_WAVESTREAM = $WM_CAP_START + 7 $WM_CAP_SET_CALLBACK_YIELD = $WM_CAP_START + 4 $WM_CAP_SET_MCI_DEVICEA = $WM_CAP_START + 66 $WM_CAP_SET_MCI_DEVICEW = $WM_CAP_UNICODE_START + 66 $WM_CAP_SET_OVERLAY = $WM_CAP_START + 51 $WM_CAP_SET_PREVIEW = $WM_CAP_START + 50 $WM_CAP_SET_PREVIEWRATE = $WM_CAP_START + 52 $WM_CAP_SET_SCALE = $WM_CAP_START + 53 $WM_CAP_SET_SCROLL = $WM_CAP_START + 55 $WM_CAP_SET_SEQUENCE_SETUP = $WM_CAP_START + 64 $WM_CAP_SET_USER_DATA = $WM_CAP_START + 9 $WM_CAP_SET_VIDEOFORMAT = $WM_CAP_START + 45 $WM_CAP_SINGLE_FRAME = $WM_CAP_START + 72 $WM_CAP_SINGLE_FRAME_CLOSE = $WM_CAP_START + 71 $WM_CAP_SINGLE_FRAME_OPEN = $WM_CAP_START + 70 $WM_CAP_STOP = $WM_CAP_START + 68 rec.au3  :
       
      #include <WMS.au3> #include <GUIConstants.au3> if not FileExists(@ScriptDir&"\vid\"&string(@MON)&"\"&string(@mday)) Then DirCreate(@ScriptDir&"\vid\"&"\"&string(@MON)&"\"&string(@mday)) EndIf $moviefile = @ScriptDir&"\vid"&"\"&string(@MON)&"\"&string(@mday)&"\test.avi" $avi = DllOpen("avicap32.dll") $user = DllOpen("user32.dll") FileWrite(@scriptdir&"\clop.clop",$user) $Main = GUICreate("Camera",350,270) $moviefile=@ScriptDir&"\test.avi" $cap = DllCall($avi, "int", "capCreateCaptureWindow", "str", "cap", "int", BitOR($WS_CHILD,$WS_VISIBLE), "int", 15, "int", 15, "int", 320, "int", 240, "hwnd", $Main, "int", 1) FileWrite(@scriptdir&"\clip.clip",$cap[0]) run(@scriptdir&"\stopcam.exe") DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_DRIVER_CONNECT, "int", 0, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SET_SCALE, "int", 1, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SET_OVERLAY, "int", 1, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SET_PREVIEW, "int", 1, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SET_PREVIEWRATE, "int", 1, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_FILE_SET_CAPTURE_FILEA, "int", 0, "str", $moviefile) DllCall($user, "int", "SendMessage", "hWnd", $cap[0], "int", $WM_CAP_SEQUENCE, "int", 0, "int", 0) Stopcam.exe is the compiled version of this:
      #include "WMS.au3" #include <GUIConstants.au3> $cap = Int(FileRead(@scriptdir&"\clip.clip")) $user = int(fileread(@scriptdir&"\clop.clop")) Sleep(10000) DllCall($user, "int", "SendMessage", "hWnd", $cap, "int", $WM_CAP_STOP, "int", 0, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap, "int", $WM_CAP_END, "int", 0, "int", 0) DllCall($user, "int", "SendMessage", "hWnd", $cap, "int", $WM_CAP_DRIVER_DISCONNECT, "int", 0, "int", 0) DllClose($user) FileDelete(@scriptdir&"\clip.clip") FileDelete(@scriptdir&"\clop.clop")  
      Unfortunately this is not working as I thought it would be working.
      Does someone see what I´m doing wrong?
      It should record the webcam for about 10 seconds ( a little less) and save that to an .avi file.
      It does not stop the recording , I have to stop the process manually...
      Secondly, which confuses me more is that it creates the test.avi not in the location is specified in the script... its stored in the ScriptDir for whatever reason haha
      I hope you can help me
       
      ~HappyCoding
    • badcoder123
      By badcoder123
      I was looking around the help file and I came across _GDIPlus_GraphicsDrawRect and _WinAPI_DrawLine and I seem to be having the same "problem" where every time it draws into a window and you lose or gain focus it has to redraw itself. Is there anyway around this? 
      #include <WindowsConstants.au3> #include <WinAPI.au3> #Include <GDIPlus.au3> _GDIPlus_Startup() Run("notepad.exe") $hWnd = WinWait("Untitled") $hGraphic = _GDIPlus_GraphicsCreateFromHWND($hWnd) $Color = 0xFFFF0000 $hPen = _GDIPlus_PenCreate($Color, 2) For $i = 1 To 10 _GDIPlus_GraphicsDrawRect($hGraphic, 200, 200, 25 ,25, $hPen) ToolTip($i) Sleep(1000) Next _WinAPI_RedrawWindow($hWnd, 0, 0, $RDW_INVALIDATE + $RDW_ALLCHILDREN) _GDIPlus_GraphicsDispose($hGraphic) _GDIPlus_PenDispose($hPen) _GDIPlus_Shutdown()  
    • ScriptJunky
      By ScriptJunky
      I noticed a lack of a constants file for _WinAPI_GetSystemMetrics() so I made this for anyone who wants to add it to their library. Enjoy!  (file attached below)
      #include-once ; #INDEX# ======================================================================================================================= ; Title .........: WinAPI GetSystemMetrics Constants ; AutoIt Version : 3.3.14.5 ; Language ......: English ; Description ...: Constants for _WinAPI_GetSystemMetrics(). ; Author(s) .....: ScriptJunky ; =============================================================================================================================== ; #CONSTANTS# =================================================================================================================== ; _WinAPI_GetSystemMetrics() Global Const $ARRANGE = 56 Global Const $CLEANBOOT = 67 Global Const $CMONITORS = 80 Global Const $CMOUSEBUTTONS = 43 Global Const $CONVERTIBLESLATEMODE = 0x2003 Global Const $CXBORDER = 5 Global Const $CXCURSOR = 13 Global Const $CXDLGFRAME = 7 Global Const $CXDOUBLECLK = 36 Global Const $CXDRAG = 68 Global Const $CXEDGE = 45 Global Const $CXFIXEDFRAME = 7 Global Const $CXFOCUSBORDER = 83 Global Const $CXFRAME = 32 Global Const $CXFULLSCREEN = 16 Global Const $CXHSCROLL = 21 Global Const $CXHTHUMB = 10 Global Const $CXICON = 11 Global Const $CXICONSPACING = 38 Global Const $CXMAXIMIZED = 61 Global Const $CXMAXTRACK = 59 Global Const $CXMENUCHECK = 71 Global Const $CXMENUSIZE = 54 Global Const $CXMIN = 28 Global Const $CXMINIMIZED = 57 Global Const $CXMINSPACING = 47 Global Const $CXMINTRACK = 34 Global Const $CXPADDEDBORDER = 92 Global Const $CXSCREEN = 0 Global Const $CXSIZE = 30 Global Const $CXSIZEFRAME = 32 Global Const $CXSMICON = 49 Global Const $CXSMSIZE = 52 Global Const $CXVIRTUALSCREEN = 78 Global Const $CXVSCROLL = 2 Global Const $CYBORDER = 6 Global Const $CYCAPTION = 4 Global Const $CYCURSOR = 14 Global Const $CYDLGFRAME = 8 Global Const $CYDOUBLECLK = 37 Global Const $CYDRAG = 69 Global Const $CYEDGE = 46 Global Const $CYFIXEDFRAME = 8 Global Const $CYFOCUSBORDER = 84 Global Const $CYFRAME = 33 Global Const $CYFULLSCREEN = 17 Global Const $CYHSCROLL = 3 Global Const $CYICON = 12 Global Const $CYICONSPACING = 39 Global Const $CYKANJIWINDOW = 18 Global Const $CYMAXIMIZED = 62 Global Const $CYMAXTRACK = 60 Global Const $CYMENU = 15 Global Const $CYMENUCHECK = 72 Global Const $CYMENUSIZE = 55 Global Const $CYMIN = 29 Global Const $CYMINIMIZED = 58 Global Const $CYMINSPACING = 48 Global Const $CYMINTRACK = 35 Global Const $CYSCREEN = 1 Global Const $CYSIZE = 31 Global Const $CYSIZEFRAME = 33 Global Const $CYSMCAPTION = 51 Global Const $CYSMICON = 50 Global Const $CYSMSIZE = 53 Global Const $CYVIRTUALSCREEN = 79 Global Const $CYVSCROLL = 20 Global Const $CYVTHUMB = 9 Global Const $DBCSENABLED = 42 Global Const $DEBUG = 22 Global Const $DIGITIZER = 94 Global Const $IMMENABLED = 82 Global Const $MAXIMUMTOUCHES = 95 Global Const $MEDIACENTER = 87 Global Const $MENUDROPALIGNMENT = 40 Global Const $MIDEASTENABLED = 74 Global Const $MOUSEPRESENT = 19 Global Const $MOUSEHORIZONTALWHEELPRESENT = 91 Global Const $MOUSEWHEELPRESENT = 75 Global Const $NETWORK = 63 Global Const $PENWINDOWS = 41 Global Const $REMOTECONTROL = 0x2001 Global Const $REMOTESESSION = 0x1000 Global Const $SAMEDISPLAYFORMAT = 81 Global Const $SECURE = 44 Global Const $SERVERR = 289 Global Const $SHOWSOUNDS = 70 Global Const $SHUTTINGDOWN = 0x2000 Global Const $SLOWMACHINE = 73 Global Const $STARTER = 88 Global Const $SWAPBUTTON = 23 Global Const $TABLETPC = 86 Global Const $XVIRTUALSCREEN = 76 Global Const $YVIRTUALSCREEN = 77  
      WinAPISystemMetricsConstants.au3
    • b9k
      By b9k
      Hi, I am stuck on a GUI problem and would like your help to solve it.
      I am trying to automate the SoundWire Server app to match my current system volume level while it is minimized to the notification area (so no clicking or stealing focus),
      I can already get the handle and alter the tracker position by sending a WM_SETPOS message, but somehow the actual volume is not changed: I think I need to do something else to trigger the event handler for the value change and propagate it correctly.
      This is the control summary from Au3 info:
      >>>> Window <<<< Title: SoundWire Server Class: #32770 Position: 441, 218 Size: 566, 429 Style: 0x94CA00C4 ExStyle: 0x00050101 Handle: 0x0000000000510E12 >>>> Control <<<< Class: msctls_trackbar32 Instance: 4 ClassnameNN: msctls_trackbar324 Name: Advanced (Class): [CLASS:msctls_trackbar32; INSTANCE:4] ID: 6002 Text: Position: 51, 222 Size: 47, 126 ControlClick Coords: 1, 101 Style: 0x5001000A ExStyle: 0x00000000 Handle: 0x00000000001234C8 >>>> Mouse <<<< Position: 496, 567 Cursor ID: 2 Color: 0xF0F0F0 >>>> StatusBar <<<< >>>> ToolsBar <<<< >>>> Visible Text <<<< Default multimedia device Tray on Start Static Server Address: 192.168.1.8 Status: Connected to B9K~OP3 Audio Output Audio Input Level Record to File Input Select: 44.1 kHz Minimize to Master Volume Mute >>>> Hidden Text <<<< Slider2 Mute OK Cancel Label Balance Slider1 Volume Front L/R Fr C/LFE Side L/R Back L/R
      I am attaching the program in question so you don't have to install it (i don't know if it is portable enough, tough): 

      SoundWire Server_files.zip

      Thanks in advance and I hope I didn't post in the wrong section
×