fisofo Posted August 7, 2016 Share Posted August 7, 2016 Not sure if anyone knows what might be up, but I've looked around and haven't found anything yet. A snippet of the code in question is this: Func _SwitchToDevice($sId) Local $oPolicyConfig = ObjCreateInterface($sCLSID_CPolicyConfigClient, $sIID_IPolicyConfig, $tagIPolicyConfig) Local $hResult $hResult = $oPolicyConfig.SetDefaultEndpoint($sId, $eConsole) If $hResult = $S_OK Then $hResult = $oPolicyConfig.SetDefaultEndpoint($sId, $eCommunications) Return $hResult = $S_OK EndFunc ;==>_SwitchToDevice It *looks* like it is working, but the default sound device doesn't actually change. I'll attach my source code for anyone that wants to review it/help out. Code is courtesy Trancexx and KaFu. SetSoundDevice.zip Link to comment Share on other sites More sharing options...
trancexx Posted August 9, 2016 Share Posted August 9, 2016 On 7.8.2016. at 4:28 AM, fisofo said: Not sure if anyone knows what might be up, but I've looked around and haven't found anything yet. A snippet of the code in question is this: Func _SwitchToDevice($sId) Local $oPolicyConfig = ObjCreateInterface($sCLSID_CPolicyConfigClient, $sIID_IPolicyConfig, $tagIPolicyConfig) Local $hResult $hResult = $oPolicyConfig.SetDefaultEndpoint($sId, $eConsole) If $hResult = $S_OK Then $hResult = $oPolicyConfig.SetDefaultEndpoint($sId, $eCommunications) Return $hResult = $S_OK EndFunc ;==>_SwitchToDevice It *looks* like it is working, but the default sound device doesn't actually change. I'll attach my source code for anyone that wants to review it/help out. Code is courtesy Trancexx and KaFu. SetSoundDevice.zip Try changing IID_IPolicyConfig: Global Const $sIID_IPolicyConfig = "{6be54be8-a068-4875-a49d-0c2966473b11}" ♡♡♡ . eMyvnE Link to comment Share on other sites More sharing options...
fisofo Posted August 16, 2016 Author Share Posted August 16, 2016 On 8/9/2016 at 10:25 AM, trancexx said: Try changing IID_IPolicyConfig: Global Const $sIID_IPolicyConfig = "{6be54be8-a068-4875-a49d-0c2966473b11}" Thanks for the response and sorry for the delay! I expected an email notice and didn't get one. In any case, doing that causes an error in the SetDefaultEndpoint line of "Variable must be of type "Object"" Prior, I had the variable set like this: Global Const $sIID_IPolicyConfig = "{00000000-0000-0000-C000-000000000046}" Any ideas? Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now