Jump to content
Sign in to follow this  
AndyS01

How to create a Slider for color values

Recommended Posts

I want to create a slider that has values representing colors, like the slider on the _ChooseColor() GUI in the Misc.au3 UDF, but the max value for a slider is 32767.  
Here is my test code:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <SliderConstants.au3>
#include <Misc.au3>

$hGUI = GUICreate("Test", 100, 560)

$BtnID = GUICtrlCreateButton("Choose", 10, 10, 50, 25)
;~ GUICtrlSetOnEvent($BtnID, "handle_choose_btn")

$flags = BitOR($TBS_AUTOTICKS, $TBS_VERT)
$iSliderID = GUICtrlCreateSlider(10, 50, 40, 420, $flags)
$hSlider_hWnd = GUICtrlGetHandle($iSliderID)

$iMaxVal = 32767
GUICtrlSetLimit($iSliderID, $iMaxVal, 0) ; change min/max value

GUISetState()
GUIRegisterMsg($WM_VSCROLL, "WM_V_Slider")

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $GUI_EVENT_PRIMARYUP
            ToolTip("")
        case $BtnID
            handle_choose_btn()
    EndSwitch
WEnd

; React to a slider movement
Func WM_V_Slider($hWnd, $iMsg, $wParam, $lParam)
    #forceref $hWnd, $iMsg, $wParam

    If $lParam = $hSlider_hWnd Then
        $iValue = GUICtrlRead($iSliderID)
        ConsoleWrite("+++: $iValue = " & $iValue & @CRLF)

        ToolTip(getRGB($iValue))
    EndIf

    Return $GUI_RUNDEFMSG
EndFunc   ;==>WM_V_Slider

; Extract the RGB components from the color value
Func getRGB($iColorVal)
    Local $hexstr, $b, $g, $r, $rgb

    $hexstr = StringFormat("%06X", $iColorVal)
    $r = StringMid($hexstr, 1, 2)
    $g = StringMid($hexstr, 3, 2)
    $b = StringMid($hexstr, 5, 2)

    $rgb = StringFormat("" & $iColorVal & " - rgb: %02s %02s %02s", $r, $g, $b)
    Return ($rgb)
EndFunc   ;==>getRGB

Func handle_choose_btn()
    $color = _ChooseColor(2, 255, 0, $hGUI)
    ConsoleWrite("+++: $color = " & Hex($color, 8) & @CRLF)
EndFunc   ;==>handle_choose_btn

 

Share this post


Link to post
Share on other sites

this?

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <SliderConstants.au3>
#include <Misc.au3>

$hGUI = GUICreate("Test", 100, 560)

$BtnID = GUICtrlCreateButton("Choose", 10, 10, 50, 25)
;~ GUICtrlSetOnEvent($BtnID, "handle_choose_btn")

$flags = BitOR($TBS_AUTOTICKS, $TBS_VERT)
$iSliderID = GUICtrlCreateSlider(10, 50, 40, 420, $flags)
$hSlider_hWnd = GUICtrlGetHandle($iSliderID)

$iMaxVal = 100
GUICtrlSetLimit($iSliderID, $iMaxVal, 0) ; change min/max value

GUISetState()
GUIRegisterMsg($WM_VSCROLL, "WM_V_Slider")

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $GUI_EVENT_PRIMARYUP
            ToolTip("")
        case $BtnID
            handle_choose_btn()
    EndSwitch
WEnd

; React to a slider movement
Func WM_V_Slider($hWnd, $iMsg, $wParam, $lParam)
    #forceref $hWnd, $iMsg, $wParam

    If $lParam = $hSlider_hWnd Then
        $iValue = GUICtrlRead($iSliderID)
        $iValue = $iValue / 100
        ConsoleWrite("+++: $iValue = " & $iValue & @CRLF)
        $iValue = 16777215*$iValue
        ToolTip(getRGB($iValue))
    EndIf

    Return $GUI_RUNDEFMSG
EndFunc   ;==>WM_V_Slider

; Extract the RGB components from the color value
Func getRGB($iColorVal)
    Local $hexstr, $b, $g, $r, $rgb

    $hexstr = StringFormat("%06X", $iColorVal)
    $r = StringMid($hexstr, 1, 2)
    $g = StringMid($hexstr, 3, 2)
    $b = StringMid($hexstr, 5, 2)

    $rgb = StringFormat("" & $iColorVal & " - rgb: %02s %02s %02s", $r, $g, $b)
    Return ($rgb)
EndFunc   ;==>getRGB

Func handle_choose_btn()
    $color = _ChooseColor(2, 255, 0, $hGUI)
    ConsoleWrite("+++: $color = " & Hex($color, 8) & @CRLF)
EndFunc   ;==>handle_choose_btn

 


Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Share this post


Link to post
Share on other sites

Making your changes presented better values, but the values always ended in FFFF.  Not what I needed.  Converting slider values from 0 to max should produce hex values from 000000 to FFFFFF, something like this:

000000 - 0000FF
000100 - 0001FF
000200 - 0002FF
...
FFFF00 - FFFFFF

Try my code and look at the tooltips and Console output.  Then click on the 'choose' button and note the action of the slider to the left side of the popup.  This is exactly how I want my slider to operate.  I don't think it's a direct conversion.
Adjusted test code:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <SliderConstants.au3>
#include <Misc.au3>

$hGUI = GUICreate("Test", 100, 560)

$BtnID = GUICtrlCreateButton("Choose", 10, 10, 50, 25)

$flags = BitOR($TBS_AUTOTICKS, $TBS_VERT)
$iSliderID = GUICtrlCreateSlider(10, 50, 40, 420, $flags)
$hSlider_hWnd = GUICtrlGetHandle($iSliderID)

$iMaxVal = 100
GUICtrlSetLimit($iSliderID, $iMaxVal, 0) ; change min/max value

GUISetState()
GUIRegisterMsg($WM_VSCROLL, "WM_V_Slider")

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $GUI_EVENT_PRIMARYUP
            ToolTip("")
        Case $BtnID
            handle_choose_btn()
    EndSwitch
WEnd

; React to a slider movement
Func WM_V_Slider($hWnd, $iMsg, $wParam, $lParam)
    #forceref $hWnd, $iMsg, $wParam

    If $lParam = $hSlider_hWnd Then
        $iValue = GUICtrlRead($iSliderID)
        ConsoleWrite("+++: $iValue = " & $iValue & @CRLF)
        $iValue = 16777215 * $iValue
        ConsoleWrite("+++: $iValue = " & $iValue & @CRLF)
        ToolTip(getRGB($iValue))
    EndIf

    Return $GUI_RUNDEFMSG
EndFunc   ;==>WM_V_Slider

; Extract the RGB components from the color value
Func getRGB($iColorVal)
    Local $hexstr, $b, $g, $r, $rgb

    $hexstr = StringFormat("%06X", $iColorVal)
    ConsoleWrite("+++: $hexstr = " & $hexstr & @CRLF)
    $r = StringMid($hexstr, 1, 2)
    $g = StringMid($hexstr, 3, 2)
    $b = StringMid($hexstr, 5, 2)

    $rgb = StringFormat("" & hex($iColorVal) & " - rgb: %02s %02s %02s", $r, $g, $b)
    ConsoleWrite("+++: $rgb = " & $rgb & @CRLF)
    Return ($rgb)
EndFunc   ;==>getRGB

Func handle_choose_btn()
    $color = _ChooseColor(2, 255, 0, $hGUI)
    ConsoleWrite("+++: $color = " & Hex($color, 8) & @CRLF)
EndFunc   ;==>handle_choose_btn

 

Share this post


Link to post
Share on other sites
32 minutes ago, AndyS01 said:

...but the values always ended in FFFF.  Not what I needed.  Converting slider values from 0 to max should produce hex values from 000000 to FFFFFF

That's exactly the result i got. The bottom of the slider represents max value, and the max value in rgb is FFFFFF, the top of the slider is zero, not what you want? maybe i got it wrong.

Im just confused at this point,

"click on the 'choose' button and note the action of the slider to the left side of the popup"

i got no slider to the left, only on the right, it makes any particular color darker or brighter.

Can you clarify a bit?

Edited by careca

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Share this post


Link to post
Share on other sites

Why reinvent the wheel? What doesn't the color chooser not do that you want to do differently in your code?


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

You're right, it's on the right.  I see that I misunderstood what that slider did. 

To answer BrewManNH, this is test code to show the problem.  In my real program, I have an edit box that shows the results of FG and BG rgb color values and in fact, changes those colors 'on the fly'.  I have buttons that cycle the colors through the color values defined in the ColorConstants.au3 file.  I have a slider for the FG as well as the BG so I could see the results of in-between color combinations.

Getting back to my slider, note that the first value after 0 is 1 and that it converted to 16777215 (hex FFFFFF), and at the bottom of the slider, a value of 100 converted to 1677721500 (hex 5AFFFFA5).  This is not what I want.  I probably want to scale the actual slider values up to values from 0 to FFFFFF.

Share this post


Link to post
Share on other sites
1 hour ago, AndyS01 said:

I probably want to scale the actual slider values up to values from 0 to FFFFFF.

I mean, you might have gotten a different result, but that's what i got in the code i posted before, that's why i posted it, now you're saying it's not what the code is doing. What is different in the result, to what you need? Can you test my code again? It goes from 0 - 000000 to 100 - FFFFFF.

Not what you want? Im still confused.


Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Share this post


Link to post
Share on other sites

Using the last posted test code:

the first value is: 1 -> 16777215 (hex 00FFFFFF)
and the last value is: 100 -> 1677721500 (hex 63FFFF9C)

Share this post


Link to post
Share on other sites

My posted code?

screenshot - 14082018-1947.jpg


Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Share this post


Link to post
Share on other sites

Just to be sure we're on the same page:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <SliderConstants.au3>
#include <Misc.au3>

$hGUI = GUICreate("Test", 100, 560)

$BtnID = GUICtrlCreateButton("Choose", 10, 10, 50, 25)

$flags = BitOR($TBS_AUTOTICKS, $TBS_VERT)
$iSliderID = GUICtrlCreateSlider(10, 50, 40, 420, $flags)
$hSlider_hWnd = GUICtrlGetHandle($iSliderID)

$iMaxVal = 100
GUICtrlSetLimit($iSliderID, $iMaxVal, 0) ; change min/max value

GUISetState()
GUIRegisterMsg($WM_VSCROLL, "WM_V_Slider")

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $GUI_EVENT_PRIMARYUP
            ToolTip("")
        Case $BtnID
            handle_choose_btn()
    EndSwitch
WEnd

; React to a slider movement
Func WM_V_Slider($hWnd, $iMsg, $wParam, $lParam)
    #forceref $hWnd, $iMsg, $wParam

    If $lParam = $hSlider_hWnd Then
        $iValue = GUICtrlRead($iSliderID)
        ConsoleWrite("+++: $iValue = " & $iValue & @CRLF)
        $iValue = 16777215 * $iValue
        ConsoleWrite("+++: $iValue = " & $iValue & @CRLF)
        ToolTip(getRGB($iValue))
    EndIf

    Return $GUI_RUNDEFMSG
EndFunc   ;==>WM_V_Slider

; Extract the RGB components from the color value
Func getRGB($iColorVal)
    Local $hexstr, $b, $g, $r, $rgb

    $hexstr = StringFormat("%06X", $iColorVal)
    ConsoleWrite("+++: $hexstr = " & $hexstr & @CRLF)
    $r = StringMid($hexstr, 1, 2)
    $g = StringMid($hexstr, 3, 2)
    $b = StringMid($hexstr, 5, 2)

    $rgb = StringFormat("" & hex($iColorVal) & " - rgb: %02s %02s %02s", $r, $g, $b)
    ConsoleWrite("+++: $rgb = " & $rgb & @CRLF)
    Return ($rgb)
EndFunc   ;==>getRGB

Func handle_choose_btn()
    $color = _ChooseColor(2, 255, 0, $hGUI)
    ConsoleWrite("+++: $color = " & Hex($color, 8) & @CRLF)
EndFunc   ;==>handle_choose_btn

with this code, the end of the slider looks like this:image.png.dd3670305c652c92034b9c7bc33ca3a7.png

Share this post


Link to post
Share on other sites

Is that the code i posted? no.


Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Share this post


Link to post
Share on other sites

Im getting tired of this conversation, i know it wasnt my code... Read all posts again, there are questions unanswered.

Edited by careca

Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Share this post


Link to post
Share on other sites

Right you are.  Somehow, I reverted my code back to as it was in my previous code.  I copied your code, then I changed $iMaxVal from 100 to  32767 to give it more granularity and rewrote the WM_V_Slider() function like this:

Func WM_V_Slider($hWnd, $iMsg, $wParam, $lParam)
    #forceref $hWnd, $iMsg, $wParam

    If $lParam = $hSlider_hWnd Then
        $iValue1 = GUICtrlRead($iSliderID)
        $iValue2 = $iValue1 / $iMaxVal
        $iValue3 = floor(16777215*$iValue2) ; Divide by 0xFFFFFF
        ConsoleWrite("+++: $iValue1 = " & $iValue1 & ", $iValue2 = " & $iValue2 & ", $iValue3 = " & $iValue3 & ", RGB: "& getRGB($iValue3)& @CRLF)
        ToolTip(getRGB($iValue3))
    EndIf

    Return $GUI_RUNDEFMSG
EndFunc   ;==>WM_V_Slider

Everything works correctly.  Thank you

Share this post


Link to post
Share on other sites

Glad it's solved. ;)


Spoiler

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

MirrorDir - Synchronize/Backup/Mirror Folders

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By DigiBox
      Hello!
      Please help me with this small problem I've encountered while learning to make GUI.
      I'm not able to get the set slider values out of sliders and I can't figure out why.
      The slider value in the example is preset to 1, but whatever I set the slider to, it returns the value 3 when I click Apply and I havn't set any value to 3.
      Where is that 3 coming from?
       
      #include <SliderConstants.au3> #include <MsgBoxConstants.au3> #include <GUIConstantsEx.au3> Global $LRSlider Opt("GUIOnEventMode", 1) Global $Form1 = GUICreate("test slider", 200, 200, -1, -1) Global $LRSlider = GUICtrlCreateSlider(50, 50, 100, 20, $TBS_TOOLTIPS) GUICtrlSetLimit($LRSlider, 50, 1) GUICtrlSetData($LRSlider, 1) GUISetOnEvent($GUI_EVENT_CLOSE, "Exit1") Global $ApplyButton = GUICtrlCreateButton("APPLY", 100, 150, 89, 17) GUICtrlSetOnEvent($ApplyButton, "Apply") GUISetState(@SW_SHOW) Func Apply() GUICtrlRead($LRSlider) MsgBox(0, 0, $LRSlider) GUICtrlSetData($LRSlider, $LRSlider) EndFunc ;==>Apply Func Exit1() Exit EndFunc ;==>Exit1 While 1 Sleep(200) WEnd  
    • By Miliardsto
      hello Im wondering if it is possible to process image in autoit like this
      1. firstly there is colorfull wallpaper
      2. Fill all colors (exception rose color) - with white
      3. Fill rose color with black color
      I see Gdi functions have things to manipulate images
      https://imgur.com/a/lFdY26g
    • By Miliardsto
      Im wondering if its possible to read pixel colors from not only from top window.
      For example I got a few windows with images how (in attachment video) . Is it possible to read pixel color for example 200px, 200px from top left ?
      Can i make something like winlist for the same window names and then get handles for every listed exact name window and then read for every window pixel color for example: 200px, 200px from top left ?
      https://streamable.com/l3pit
       
      2018-12-10 01-02-38.mp4
    • By nacerbaaziz
      Hi guys
      I have a question about the slider  controle
      There is a problem with screen readers, wen we Using a screen reader We usually move between GUI controls using the tab key.
      But when you create a slider , beside to it there are  buttons and check boxes or any other controls, When I move between the GUI controls using the tab key I can not find the slider.
      But if it were alone in the window, I would find it normally.
      Is there a solution to Solve this problem please?
      This is the code i tried
      #include <GUIConstantsEx.au3>
      #include <WindowsConstants.au3>
      #include <MsgBoxConstants.au3>
      #include <SliderConstants.au3>
      main()
      Func main()
          GUICreate("slider", 200, 200, -1, -1)
      GUICtrlCreateGroup("slider", 10, 10, 240, 50)
          Local $idSlider1 = GUICtrlCreateSlider(50, 30, 200, 20, BitOr($TBS_DOWNISLEFT, $TBS_BOTH))
          GUICtrlSetLimit(-1, 100, 0)
      ;GUIStartGroup("")
          Local $idButton = GUICtrlCreatebutton("Value?", 75, 70, 70, 20)
          GUISetState(@SW_SHOW)
          GUICtrlSetData($idSlider1, 10)
      while 1
      switch GUIGetMsg()
      case $GUI_EVENT_CLOSE
      exit
      case $idButton
                  MsgBox($MB_SYSTEMMODAL, "slider1", GUICtrlRead($idSlider1))
      endSwitch
      Wend
      EndFunc
      [Click and drag to move]
       
       
    • 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
×
×
  • Create New...