
GrizDoug
Active Members-
Posts
43 -
Joined
-
Last visited
Profile Information
-
Location
Gainesville, FL
-
Interests
Camping, Hiking, Biking, Skiing, Outdoor Activities
GrizDoug's Achievements

Seeker (1/7)
0
Reputation
-
Bump, I need help and Thanks in advance!!
-
I Googled this issue on the net and found a suggestion to add a WinWait() to wait for the window to be displayed, then add a WinActivate() to activate the window once it is displayed. I tried that. but it didn't work. Something I learned in researching this issue, when the script hangs or gets stuck, I click the cancel button on the child dialog and click the link again, and the script continues on right from the point where it was waiting for the active window. I'm not sure what the link is doing that I am missing. I thought my _SendMessageA() would work the same way as a button click on the link. Help please!
-
I added the code to display the window from the link. You will also see some of the code that I tried, which are commented out or not, to activate the displayed window. Please take a look and see if you have some additional ideas. I appreciate any help. Thanks for all suggestions!!
-
Bump!
-
;********************************************* Func AddHDAudio2ndOutput() ;********************************************* ;Show the Realtek Sound Manager dialog Run("control RTSndMgr.cpl","",@SW_HIDE) Opt("WinWaitDelay", 1000) WinWait("Realtek HD Audio Manager") ;********************************************* ;The HD Audio 2nd output tab should be displayed at the top of the dialog. Select the tab and select the Default Format tab, ;about one third down the page on the left. Set the Default Format in the dropdown as "16 Bits, 44100 Hz (CD Quality)." ;Add the HD Audio 2nd Output by clicking Device Advanced Settings in upper right corner of dialog, ;to display the Device advanced settings dialog $WM_LBUTTONDOWN = 0x0201 $WM_LBUTTONUP = 0x0202 $MK_LBUTTON = 0x0001 $ilParam = _WinAPI_MakeDWord(34, 9) $hControl = ControlGetHandle("Realtek HD Audio Manager", "", "SysLink2") _SendMessageA($hControl, $WM_LBUTTONDOWN, $MK_LBUTTON, $ilParam) _SendMessageA($hControl, $WM_LBUTTONUP, $MK_LBUTTON, $ilParam) ;WinActivate("Device advanced settings", "") $hWnd = WinGetHandle("Device advanced settings") _WinAPI_SetFocus($hWnd) If WinActive("Device advanced settings") Then MsgBox(0, "", "Device advanced settings is active") EndIf Opt("WinWaitDelay", 1000) WinWait("Device advanced settings") ;WinWaitActive("Device advanced settings") ;Select the radio button titled "Make front and rear output devices playback ;two different audio streams simultaneously." ;WinActivate("Device advanced settings", "") ;ControlClick("Device advanced settings", "", 1212) ;ControlFocus("Device advanced settings", "", "Button5") ;WinActivate("Device advanced settings", "") ;ControlClick("Device advanced settings", "", 1212, "left", 1, 11, 11) ;$ilParam = _WinAPI_MakeDWord(11, 11) ;$hControl = ControlGetHandle("Device advanced settings", "", "Button5") ;_SendMessage($hControl, $WM_LBUTTONDOWN, $MK_LBUTTON, $ilParam) ;_SendMessage($hControl, $WM_LBUTTONUP, $MK_LBUTTON, $ilParam) ;ControlCommand("Device advanced settings", "", "[CLASS:Button; INSTANCE:4]", "UnCheck", "") ;ControlCommand("Device advanced settings", "", "[CLASS:Button; INSTANCE:5]", "Check", "") ControlCommand("Device advanced settings", "", 1212, "Check", "") Opt("WinWaitDelay", 1000) WinWait("Device advanced settings") ;Click the Ok button to close the Device advanced settings dialog ControlClick("Device advanced settings", "", 1) ;WinWaitNotActive("Device advanced settings") Opt("WinWaitDelay", 5000) WinWait("Realtek HD Audio Manager") Dim $tab $tab = ControlCommand("Realtek HD Audio Manager", "", "[CLASS:SysTabControl32; INSTANCE:8]", "CurrentTab", "") MsgBox(4096, "Information", "Tab = " & $tab) ;Need to tab left the proper amount of tabs to get to beginning ControlCommand("Realtek HD Audio Manager", "", "[CLASS:SysTabControl32; INSTANCE:8]", "TabLeft", "") Opt("WinWaitDelay", 1000) WinWait("Realtek HD Audio Manager") ;Get the text of the tab $tab_str = ControlGetText("Realtek HD Audio Manager", "", "[CLASS:SysTabControl32; INSTANCE:8]") MsgBox(0, "tab_str", $tab_str) ;********************************************* ;Click the Ok button to close the dialog ControlClick("Realtek HD Audio Manager", "", 1) WinWaitNotActive("Realtek HD Audio Manager") ;********************************************* EndFunc ;********************************************* The code after the comment "Add the HD Audio 2nd Output by..." causes the child dialog to display and then it has some code that checks to see if the window is active. You will see that I have tried several things and some of those are commented out. I need to get the window active before I can select the radio button using the script. Please let me know if you have any ideas. Thanks!
-
It's a window and it's title is "Device advanced settings", just like the title shows on the window. The class is #32770, which is like other windows/dialogs. The controls on the window are standard buttons and the text on the buttons is the same as shown in the AutoIt window info tool. By all accounts, it's a standard window.
-
I tried WinWaitActive() as well, but the script just sat there because the window never became active. Thanks!
-
It's a windows dialog, I think, activated by the Realtek HD Audio Manager dialog that comes from the tray in the lower right of the screen. I'll get you some code in a bit. I just got pre-empted to do an installation. I'll be back. Thanks!
-
Hyperlink doesn't work with ControlClick
GrizDoug replied to GrizDoug's topic in AutoIt General Help and Support
I think I need to call this topic finished and start a new thread with the question above. There is a new topic with the question, "How to activate a dialog?" Look for the topic in "General Help and Support". -
I displayed a dialog through a link using the script I have been working on. I read in the help file that when using the ControlCommand() call, sometimes the window or dialog needs to be activated, and I think this is one of the cases, but I am having some problems getting the window to be active. Now the question becomes, "How do I make the dialog (window) active?" The dialog gets displayed and the script stops there waiting for the window to be active. I did a test with WinActive and the dialog (window) wasn't active. It needs to be active so the script will continue. I tried WinActivate() and that didn't help. I also tried: $hWnd = WinGetHandle("Device advanced settings") _WinAPI_SetFocus($hWnd) This code didn't help either. Any ideas? Thanks in advance.
-
Hyperlink doesn't work with ControlClick
GrizDoug replied to GrizDoug's topic in AutoIt General Help and Support
This is great, because I have the dialog being displayed. Now the question becomes, "How do I make the dialog (window) active?" The script stops there waiting for the window to be active. I did a test with WinActive and the dialog (window) wasn't active. It needs to be active so the script will continue. I tried WinActivate() and that didn't help. I also tried: $hWnd = WinGetHandle("Device advanced settings") _WinAPI_SetFocus($hWnd) This code didn't help either. Any ideas? Thanks in advance. -
Hyperlink doesn't work with ControlClick
GrizDoug replied to GrizDoug's topic in AutoIt General Help and Support
That was the trick. The only other thing that was missing that someone reading this would need is to put the include at the top of the file: #include <WinAPI.au3> -
Hyperlink doesn't work with ControlClick
GrizDoug replied to GrizDoug's topic in AutoIt General Help and Support
Ok, I see what you were trying to do and appreciate your suggestion, but it didn't work. Even though the focus was on the SysLink2 control using the ControlFocus() before the ControlSend(), it seemed like the dialog didn't pick up on the fact that the message with the keystroke was being sent to the SysLink2 control. Instead, it acted like the Ok button at the bottom right corner of the dialog was activated, which is also understandable to an extent. How 'bout this, last night I was looking at the _SendMessageA(), but I couldn't figure out how to setup the LParam for the point to be clicked. It's kind of along the same line you are following, but a little different. See my code below: #include <SendMessage.au3>;at the top of file $WM_LBUTTONDOWN = 0X0201 $WM_LBUTTONUP = 0X0202 $MK_LBUTTON = 0X0001 $hControl = ControlGetHandle("Realtek HD Audio Manager", "", "SysLink2") _SendMessageA($hControl, $WM_LBUTTONDOWN, $MK_LBUTTON, 0) Is there a way to create the lParam like this in AutoIt: LPARAM lParam = MAKELPARAM(30, 30); The LParam or the point should be at the location where the 0 is located in the _SendMessageA() call. That's what I need to figure out now. Do you have any idea about this? If you have any other suggestions, please keep them coming. Thanks. -
Hyperlink doesn't work with ControlClick
GrizDoug replied to GrizDoug's topic in AutoIt General Help and Support
When I used the AutoIt v3 Window Info to get information about the control, that's where I determined that it was a SysLink. I also did a test by calling ControlFocus() to give the control the focus, and it highlighted the text, but nothing in the background around it. When I do a ControlClick on the control, which is the text, nothing happens. I also tried giving the control the focus before I did the ControlClick() and that didn't help. -
Hyperlink doesn't work with ControlClick
GrizDoug replied to GrizDoug's topic in AutoIt General Help and Support
Look at the message above before you read this. Do you happen to know another way to get the "Device advanced settings" dialog, which is a child of the "Realtek HD Audio Manager" dialog, to be displayed so I can set it's values?