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):
Thanks in advance and I hope I didn't post in the wrong section
Good morning everyone
I was playing a little bit with "Screen Capture" UDF, and I was trying to make a "Window" capture, but, since I made a GUI which through I fire the event "Capture", my GUI is captured as well, and I don't want to
This is the line of code that makes the capture:
_ScreenCapture_CaptureWnd($strScreenCaptureFileName, $objActiveWindow, 0, 0, -1, -1, False) And these are the lines of code which select the "active" window:
Local $objCurrentWindow = 9999 If _IsPressed("01") Then $objCurrentWindow = WinGetHandle("[ACTIVE]") If $objCurrentWindow <> $objMyGUI Then $objActiveWindow = $objCurrentWindow EndIf EndIf Sorry If I made stupid mistakes
Thanks in advance.
Here is a function that will return a 2D array of visible windows. You will notice that windows "Start" and "Program Manager" windows will always be in the array. The array returns the title of the window, the window handle, the PID of the process associated with the window, the process name associated with the window, the window's position, and the window's dimension, Please see comments in the code about the numbers returned about the window's position.
#include <Array.au3> #include <Process.au3> ;Get a list of visable windows with titles. $aWindows = _GetVisibleWindows() _ArrayDisplay($aWindows) Func _GetVisibleWindows() ;Retrieve a list of windows. Local $aWinList = WinList() If Not IsArray($aWinList) Then Return SetError(0, 0, 0) ;Loop through the array deleting no title or invisable windows. Local $sDeleteRows = "" For $i = 1 To $aWinList If $aWinList[$i] = "" Or Not BitAND(WinGetState($aWinList[$i]), $WIN_STATE_VISIBLE) Then $sDeleteRows &= $i & ";" EndIf Next $sDeleteRows = StringTrimRight($sDeleteRows, 1) ;Remove last ";". _ArrayDelete($aWinList, $sDeleteRows) $aWinList = UBound($aWinList) - 1 ;Get Window's Processor ID (PID), and add to the array. _ArrayColInsert($aWinList, UBound($aWinList, 2)) For $i = 1 To $aWinList $aWinList[$i] = WinGetProcess($aWinList[$i]) Next ;Get Window's Process Name from PID, and add to the array. _ArrayColInsert($aWinList, UBound($aWinList, 2)) For $i = 1 To $aWinList $aWinList[$i] = _ProcessGetName($aWinList[$i]) Next ;Get Windows's Position and Size, and add it to the array. ;For Position, -3200,-3200 is minimized window, -8,-8 is maximized window on 1st display, and ;x,-8 is maximized windown on the nth display were x is the nth display width plus -8 (W + -8). _ArrayColInsert($aWinList, UBound($aWinList, 2)) ;Position (X,Y). _ArrayColInsert($aWinList, UBound($aWinList, 2)) ;Dimension (WxH). Local $aWinPosSize For $i = 1 To $aWinList $aWinPosSize = WinGetPos($aWinList[$i]) $aWinList[$i] = $aWinPosSize & "," & $aWinPosSize $aWinList[$i] = $aWinPosSize & "x" & $aWinPosSize Next Return $aWinList EndFunc ;==>_GetVisibleWindows
I have an inquiry please
when i use the control get focus
it don't detect the menu item
there are any Method to do that?
i'll use that to make a custom screen reader in my program
please help me to do that
I am waiting for your answers
greetings to you
Thank you in advance
When LISTVIEW loses focus,the selected item will turn gray.
How can I change It . Let it continue to stay blue
Do not gray
#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Example() Func Example() Local $listview, $button, $item1, $item2, $item3, $msg GUICreate("LISTVIEW", 220, 250, 100, 200, -1, $WS_EX_ACCEPTFILES) $listview = GUICtrlCreateListView("NO1 |NO2|NO3 ", 10, 10, 200, 150);,$LVS_SORTDESCENDING) $button = GUICtrlCreateButton("BUTTON", 75, 170, 70, 20) $item1 = GUICtrlCreateListViewItem ("A1|A2|A3", $listview) $item2 = GUICtrlCreateListViewItem ("B1|B2|B3", $listview) $item3 = GUICtrlCreateListViewItem ("C1|C2|C3", $listview) $item4 = GUICtrlCreateListViewItem ("D1|D2|D3", $listview) $item5 = GUICtrlCreateListViewItem ("E1|E2|E3", $listview) GUICtrlCreateInput("", 20, 200, 150) GUISetState() Do $msg = GUIGetMsg() Select Case $msg = $button MsgBox(0, "", GUICtrlRead(GUICtrlRead($listview)), 2) Case $msg = $listview MsgBox(0, "", "" & GUICtrlGetState($listview), 2) EndSelect Until $msg = $GUI_EVENT_CLOSE EndFunc ;==>Example