Guest azza6 Posted June 30, 2010 Report Posted June 30, 2010 Hey guys, how do you set it to automatically select headphones when you plug something in to the 3.5" headphone slot. I don't ever use a headset or TV out, so I don't want to have to pick every time. Any ideas? Azz. :lol:
Guest sinancetinkaya Posted June 30, 2010 Report Posted June 30, 2010 (edited) .................... Edited June 30, 2010 by sinancetinkaya
Guest dwallersv Posted June 30, 2010 Report Posted June 30, 2010 (edited) Got an idea... working on it... stay tuned...Okay, here ya go! Download, unzip, and run the attached installer. It will first try to install MortScript (necessary) -- you can skip it if you already have it installed. It will then install a script that monitors and handles the Jack insertion dialog, killing it when it shows up. The default Mode Selection is Headphones, so this works without a hitch. It also starts the script up at the end of the installation automatically, so you don't need to reboot or anything -- it's working right after install.A shortcut to run the script every time you boot is also placed in \Windows\Startup, so the solution is there automatically. EDIT: See post #15 for a bugfix after installation...Omnia_II_AutoJack.zip Edited July 2, 2010 by dwallersv
Guest azza6 Posted July 1, 2010 Report Posted July 1, 2010 (edited) <del>Got an idea... working on it... stay tuned...</del> Okay, here ya go! Download, unzip, and run the attached installer. It will first try to install MortScript (necessary) -- you can skip it if you already have it installed. It will then install a script that monitors and handles the Jack insertion dialog, killing it when it shows up. The default Mode Selection is Headphones, so this works without a hitch. It also starts the script up at the end of the installation automatically, so you don't need to reboot or anything -- it's working right after install. A shortcut to run the script every time you boot is also placed in \Windows\Startup, so the solution is there automatically. Wow man you're a champ! Thanks a heap. :lol: Installing now.. EDIT: Not working. :D Any idea's why? Didn't see anything weird in the installation.. Edited July 1, 2010 by azza6
Guest wittanny Posted July 1, 2010 Report Posted July 1, 2010 (edited) Too bad, not working Edited July 1, 2010 by wittanny
Guest dwallersv Posted July 1, 2010 Report Posted July 1, 2010 (edited) Strange... I'm on a 920. The window name for the popup on an 8000 is probably different, and that's the problem. If you can figure it out and post it, that would help. Otherwise, wait a bit while I work up another script to do the job, and then you can run that and report back what it says. Hang on... EDIT: Okay gang, unzip and install the attached CAB. Then, run \Scripts\FindWinName.mscr, plug in your headphone jack, and report back what the window name is for the popup. You will have to have MortScript installed for this to run, of course. Finally, you can simply uninstall the CAB to delete this diagnostic after you're done.FindTopWinName.zip Edited July 2, 2010 by dwallersv
Guest wittanny Posted July 2, 2010 Report Posted July 2, 2010 (edited) Strange... I'm on a 920. The window name for the popup on an 8000 is probably different, and that's the problem. If you can figure it out and post it, that would help. Otherwise, wait a bit while I work up another script to do the job, and then you can run that and report back what it says. Hang on... EDIT: Okay gang, unzip and install the attached CAB. Then, run \Scripts\FindWinName.mscr, plug in your headphone jack, and report back what the window name is for the popup. You will have to have MortScript installed for this to run, of course. Finally, you can simply uninstall the CAB to delete this diagnostic after you're done. Where's FindWinName.mscr? I use Dotfred's Task Manager to see Window title. It is "Default Ime" but after changing it in your AutoJack.mscr script file still no luck. In fact I want to have Headset as my default selection. Edited July 2, 2010 by wittanny
Guest mat9v Posted July 2, 2010 Report Posted July 2, 2010 (edited) Where's FindWinName.mscr? I use Dotfred's Task Manager to see Window title. It is "Default Ime" but after changing it in your AutoJack.mscr script file still no luck. In fact I want to have Headset as my default selection. The correct window is: Window 7C09DF10 "" XOCOMMONDIALOG (17,216,463,583) and from what I understand it has no name. So I don't know what to do with it..... About selecting Headset: - you can try to find precise place that the headset select point is and use: MouseClick "correct window name",horizontal pos,vertical position (like for example MouseClick "Window",60,30) and then click OK bar using the same method. I wonder if mortscript allows for selecting window by it's "Window Id". Will have to read about that :lol: Edited July 2, 2010 by mat9v
Guest dwallersv Posted July 2, 2010 Report Posted July 2, 2010 Very sorry about that guys... busy day yesterday. The file I meant to attach is now there in the post. As for the window name, figuring it out with DotFred's Task Manager (excellent tool, BTW, it's what I've been using for all sorts of things like this for years) is tricky. First and most important, you have to leave the dialog alone and visible, on top of TM, in order to see it in the window list. If you want to go that route to figure it out, follow these steps: Run FDC TM so it is in the foreground. Switch to the Windows tab. Insert headphone plug, mode selector dialog pops up. Now, without touching the dialog, click the "Refresh" button in FDC TM on the lower right. Wait for the list to completely refresh, then you can close/dismiss the jack mode dialog and examine the windows list. On the i920 this window shows as title "Select Mode", type XOCOMMONDIALOG, child of the "Desktop" window. It should be the only window of this type.
Guest dwallersv Posted July 2, 2010 Report Posted July 2, 2010 The correct window is: Window 7C09DF10 "" XOCOMMONDIALOG (17,216,463,583) and from what I understand it has no name. So I don't know what to do with it..... About selecting Headset: - you can try to find precise place that the headset select point is and use: MouseClick "correct window name",horizontal pos,vertical position (like for example MouseClick "Window",60,30) and then click OK bar using the same method. I wonder if mortscript allows for selecting window by it's "Window Id". Will have to read about that :lol:Re: window name: If that is indeed the case for this window on the i8000, it is unfortunate, as the method I'm using to dismiss it obviously won't work. Re: Simulating mouse click: That was the method I first tried in scripting a solution to this problem, and for some reason the window doesn't recieve the mouseclicks -- they are passed to the window immediately underneath. I've picked apart the messages that are send to the window when the OK button is pressed, and am going to try hitting it with the lower-level message-sending commands in MortScript. However, there are A LOT of messages with WPARAM/LPARAM values, so hacking up this script will be a major pain... I'm trying to determine which messages are necessary, and which are just superfluous behavior of the windowing system (like multiple FOCUS, SETCURSOR, etc. messages). Before I go to all that trouble, if the window doesn't have a name as your discovery appears to indicate, I have some other ideas to try first that are much simpler. Stay tuned...
Guest mat9v Posted July 2, 2010 Report Posted July 2, 2010 (edited) The window does not have a name. It'a the only window at that position (17,216) and the only one to disappear when disconnecting the jack. But then I'm using WinCE 6.5.5 so it's entirely possible it's a quirk of that win release. Someone should test it on other system. About Mortscript - better windows handling is on todo list for version 4.3: " Better window handling. I.e. additionally to giving the window name, one could pass a variable with the window handle, which is retrieved by a new function "FindWindow". This function will allow parameters like class name, case sensitivity, comparision type (beginning, contained, exact match), parent window, whether to incude invisible windows, and the like." One of more recent builds of 4.3 adds more windows related capabilities so it may be possible to use that. "- FindWindow( title [, position, case-sensitive?, only app windows?, include invisible?, window class ] ) - looks for the "best fit" window with given properties. All parameters starting from position are optional... "App windows" means windows without parent or the Desktop as parent and some window styles common for "normal" application windows. Position: ANYWHERE = "title" contained anywhere in the title, BEGINNING = title starts with given string, COMPLETE = entire title given. - FindWindows( .... ) - Like FindWindow, but returns an array with all fitting windows, and the title is optional (use "" for all windows). - FindWindow(s) and ActiveWindow now returns a special window variable (VAR_WINDOW) instead of just the name, which allows Send... etc. to work faster because it's not necessary to search a window with a fitting name. " So maybe using title as "" and window class as XOCOMMONDIALOG it would be possible to locate correct window. Oh, and using FindWindowName returned "" Sorry :lol: Edited July 2, 2010 by mat9v
Guest dwallersv Posted July 2, 2010 Report Posted July 2, 2010 Okay, here's a possible alternate approach... On the i920, the process associated with the jack mode dialog is \Windows\XoCommandDialog.exe. I'm guessing it's the same on the i8000, given that the window created has the same typename as on the i920 (XOCOMMONDIALOG). Further, when this exe is simply run directly via a file browser (like Resco File Explorer), the behavior is as if headphones were plugged in -- i.e. the dialog pops up. The question is, is that the only thing this program handles, or are there other "common dialogs" that this program also manages? Given the behavior when simply executing it, I suspect that this is all it does, in the current design and software from Samsung for our devices. Can't know for sure, however. So, there are two ways to go forward with this, and I'll add attachments to this post for both:Replace the ROM file on the i8000 with the (I believe) newer version from the i920, see if it works, and if so the Window name will be there and the previous scripts I created will then work. This approach has the potential advantage of not screwing up other functionality of XoCommonDialog.exe, if any, and if it is fully compatible with the i8000. Risk: the newer i920 version of this executable is incompatible with the i8000 in some non-obvious way, and something else will mysteriously stop working properly but it won't be obvious that this was the cause. I believe this to be very unlikely, but the risk is there nonetheless.Replace the original AutoJack.mscr with the one attached, which monitors the existence of the XoCommonDialog.exe process, and when it shows up, kills it. This has the same effect as the original script. Risk: XoCommonDialog.exe performs others functions besides managing the jack mode, so this more coarse approach again leads to other failures or strange behavior that isn't obviously caused by this workaround. My Recommendation: Try replacing the executable first, and stick to the original AutoJack.mscr script, which is narrowly targeted at the specific functionality we are trying to modify. Just keep in mind -- remind yourself over and over for a bit -- that if the O2 starts acting funny for some reason, start by backing out this change and see if the problem goes away -- and, of course, report back here. If you decide to go with the more "bull in a china shop" second approach, same advice.AutoJack_Process_Method.zipi910_XoCommonDialog.zip
Guest dwallersv Posted July 2, 2010 Report Posted July 2, 2010 @mat9v: Thanks for the info on MortScript 4.3! I'm guessing I can grab a beta of it (I'll go check the site), and if so, I'll play with it. As you say, the richer Window interfaces look like they could solve this problem, given the ability to search based on class as well, and pass in handles as identifiers in addition to window names.
Guest mat9v Posted July 2, 2010 Report Posted July 2, 2010 The replacement method works for me (for the moment anyway) :lol: The window has a name now and it auto closes as expected. Thx !
Guest dwallersv Posted July 2, 2010 Report Posted July 2, 2010 URGENT: Bug in the original AutoJack.mscr script -- after window wait times out (1 hr as written), the script will give and error and terminate. Attached is the fixed script, unzip and replace \Scripts\AutoJack.mscr with this one. Reworking the installer as we speak, and will be updating it in post#1 shortly. Also improving the installer to detect Mortscript installation and automatically skip if unnecessary.AutoJack.zip
Guest mat9v Posted July 2, 2010 Report Posted July 2, 2010 (edited) That script "errors out" after 60 seconds. The while/if clause is incorrect? I'm no programmer.... :lol: I suppose it would be easiest to increase 60 (or 3600 in earlier script) value to something like 3600000 - I don't think any omnia 2 works for 1000 hours without restart. And mortscript seems to accept so high a value. Edited July 2, 2010 by mat9v
Guest wittanny Posted July 3, 2010 Report Posted July 3, 2010 Hi dwallersv, What if I want to select "Headset" as default?
Guest azza6 Posted July 5, 2010 Report Posted July 5, 2010 Updated with post #15.. Still no good, still asking to choose. :)
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now