Jump to content

fisofo

Active Members
  • Posts

    379
  • Joined

  • Last visited

About fisofo

  • Birthday 05/07/1982

Profile Information

  • Member Title
    If you can read this, then I suck at being a ninja
  • Location
    Minnesota

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

fisofo's Achievements

Universalist

Universalist (7/7)

0

Reputation

  1. 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?
  2. Hate to be that guy, but I'm resurrecting this post because SetDefaultEndpoint is no longer working after the latest Win10 update. I was going to just PM you Trancexx, but looks like I can't; mind taking a look?
  3. 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
  4. trancexx, thank you for taking the time to dig into this in-depth with me! Having said that, much of what you posted is over my head, and will probably take me a long time to really get a grasp of it... I've read through it a few times, but I'm having difficulty understanding it; it's a level or three above my current grasp of programming/AutoIt. I can *sort of* see what you are getting at, in that you are showing me how to access the methods of the object, and I can see how you've done that with your original $tagIMMDeviceEnumerator and with your example code here, but there are bits and pieces all over that I don't get or am not sure how to translate to what I want to do, and I don't even know where to start asking questions. I figured out that I need to do a IMMDeviceEnumerator::RegisterEndpointNotificationCallback first, but I'm afraid that I'll need to table this for now until I can take more time to learn this stuff, or until someone else codes it and I can learn from that... it probably would have been easier back in college when I was actually more fluent in programming languages, but it's been too long! If you feel like whipping the code together, that would be great, but I won't ask or expect you to do that after you've already done so much. Thanks for trying to teach me though!
  5. My apologies trancexx and KaFu! You are absolutely right, didn't mean to hijack the thread, but I was getting off on a tangent. Trancexx, I appreciate you being willing to take a look, I've posted the question over here: '?do=embed' frameborder='0' data-embedContent>>.
  6. As mentioned at the end of >this thread, I'm looking to code a way to capture OnDeviceStateChanged events. I've read through the msdn info, as well as an example they have, but it's frankly over my head. Tracexx's code utilizes some of this stuff, but not this particular method. The purpose is for triggering code when an audio endpoint is added/removed/changed from the system. GUIRegisterMsg($WM_DEVICECHANGE, 'WM_DEVICECHANGE') can be used for some of these when they are USB related, but not when a bluetooth speaker (for example) connects or disconnects.
  7. Well, nevermind for now; I ended up just using the WM_DEVICECHANGE and watched for changes in the count of the following device states: $DEVICE_STATE_ACTIVE $DEVICE_STATE_DISABLED $DEVICE_STATE_NOTPRESENT $DEVICE_STATE_UNPLUGGED Strange/frustrating part is that a bluetooth speaker connecting/disconnecting is not picked up by the GUIRegisterMsg($WM_DEVICECHANGE...). Back to searching...
  8. So I got all of that working (I can post my code later if anyone is interested... and by "my" code I mean trancexx's code with some minor alterations of my own), and then I got to thinking: "It'd be cool to take this a step further and have the script automatically update the list of audio endpoints when something is removed/added/etc." Trancexx, if you don't mind another question, do you know how to setup autoit to capture the OnDeviceStateChanged? I've read through the msdn info, as well as an example they have, but it's frankly over my head. I can use GUIRegisterMsg($WM_DEVICECHANGE, 'WM_DEVICECHANGE') to detect when a change occurs, which works, but I've had difficulty getting it filtered down to just what I want, and I'm loathe to have the script firing over and over for stuff it shouldn't care about. What do you think?
  9. Thank you trancexx! I just found that code as well, I'll give it a try. And yes, that's what I plan to do, but I was thinking I'd also customize the tray icon to match the device icon; might be a neat effect.
  10. So trancexx's code works really well (no offense KaFu!), does anyone know how to *Get* the current default Audio Endpoint using the IPolicyConfig code?
  11. I'm getting a permission denied error when trying to grab that latest attachment, fyi!
  12. I've been searching a while for this, thought I'd just ask here: has anyone created something like this in AutoIt? Before I dig into trying to create it, I thought this might be a good place to ask: http://stackoverflow.com/questions/1855884/determine-font-color-based-on-background-color
  13. Doh! That makes sense... thanks Psalty! When I compiled the example, it worked perfectly for me, so I reinstalled the latest AutoIt but chose not to include native x64 components. Should this be submitted as a bug somewhere? I looked around and see that others have had similar issues though, so perhaps the team is aware of it. In any case, thanks much Psalty!
  14. Summary: I want to disable specific TreeView Item checkboxes (grayed out, disabled, invisible, whatever!) and leave others intact. I've searched and found Holger's Tristate GUI TreeView as well as a more specific post from him about what I am trying to do, however after updating the code to work with the most recent AutoIt versions, I find it is not working for me. The code in that second post is actually just a simplified version of his Tristate stuff, so I focused on that (although I tested both), and I produced the below code, which is unfortunately not working. The Struct appears to be correct as far as I can tell from MSDN as well... Any thoughts? I am running Win7 x64. #include <GUIConstantsEx.au3> #include <GuiTreeView.au3> Global Const $TVM_SETITEM = $TV_FIRST + 13 GUICreate('Test') $tv = GUICtrlCreateTreeView(10, 10, 200, 200, BitOr($TVS_HASBUTTONS, $TVS_DISABLEDRAGDROP, $TVS_HASLINES, $TVS_HASLINES, $TVS_SHOWSELALWAYS, $TVS_CHECKBOXES)) $tvitem1 = GUICtrlCreateTreeViewItem('Item1', $tv) $tvitem2 = GUICtrlCreateTreeViewItem('Item2', $tvitem1) $tvitem3 = GUICtrlCreateTreeViewItem('Item3', $tvitem1) GUICtrlSetState($tvitem1, $GUI_EXPAND) RemoveCheckbox($tv, $tvitem1) GUISetState() While 1 $Msg = GUIGetMsg() Switch $Msg Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd Exit Func RemoveCheckbox($nTV, $nID) Local $hItem = GUICtrlGetHandle($nID) If $hItem = 0 Then $hItem = $nID Local $stTVITEM = DllStructCreate('uint;uint;uint;uint;ptr;int;int;int;int;uint;int') DllStructSetData($stTVITEM, 1, $TVIF_STATE) DllStructSetData($stTVITEM, 2, $hItem) DllStructSetData($stTVITEM, 3, 0) DllStructSetData($stTVITEM, 4, $TVIS_STATEIMAGEMASK) GUICtrlSendMsg($nTV, $TVM_SETITEM, 0, DllStructGetPtr($stTVITEM)) EndFunc
  15. Fyi, I'm guessing you know this, but in case you don't, compiling a script on the most recent autoit gives me this: HotKey.au3(194,56) : ERROR: Opt() called with illegal argument 1: "OnExitFunc" Global $OnHotKeyExit = Opt('OnExitFunc', 'OnHotKeyExit') EDIT: seems to work fine otherwise though!
×
×
  • Create New...