The free, multi-party video conferencing offering Google+ Hangout is a pretty fantastic alternative to Skype (and its paid multi-party option). Wouldn't it be wonderful to have a UI control you could drop into any .NET application that gave you all the power of Google+ Hangout? Well, it would... and I've been working on it, but so far it's not proved easy.
First a bit of back story. I have been working on an app which features embedded video conferencing and had gone initially with Skype. Skype has been a somewhat miserable experience thus far, workable but only just. The only way I've been able to integrate with Skype thus far has been their Skype4COM option. Skype4COM allows you to remote control certain features of Skype from a third-party application. You can initiate calls, hangup, mute, and things but you can't hide the original Skype interface or embed its video in your own application. There is a way to do all that, and it's SkypeKit. But for reasons unknown to me they seem to have suspended SkypeKit access. I applied to the program many months ago and my account still says something like, "We'll get back to you about SkypeKit when we're ready for you." I've heard from others that that's just the way it is right now, that they are redoing SkypeKit or something. At any rate... Skype isn't a great solution at the moment. Google+ Hangout on the other hand would be perfect, if only it worked.
I spent a few days a few weeks ago trying to create a Windows control that would let me embed Google+ Hangout inside a Windows control. The logical approach to do that would be to customize a web browser control to load up the web-based Google+ Hangout and just modify the rendered content and inject JS as necessary to achieve the desired control-ifying of Hangout. I've done that before, so I didn't think it would prove so tricky.
Microsoft WebBrowser Control
I first tried using the built-in Microsoft WebBrowser control as the hosting control. I automated Google account sign-in and had it load up the Google+ Hangout page. I hit the first major roadblock. The page gave me a warning about my browser agent not being supported. I went back and added code to spoof it, but that didn't seem to work as the WebBrowser control isn't all that sophisticated and only spoofs the user agent for the first request, not subsequent ones or ones that the loaded page fetches. I tried several alternative WebBrowser extension classes that try to intercept navigating requests and replace them with navigate calls that include the spoofing, but they didn't seem to work properly. If memory serves I did reach a point where I was able to call the JS to start a hangout but everything hung when it tried to install/start the hangout.
The next option I tried was Awesomium, a Chromium-based behind the scenes browser rendering system. After looking at some of their examples and struggling a bit with their concept (which differed radically from the WebBrowser control and MozNET control approaches I was used to) I ended up realizing I could use one of their demo apps as a quick way to test the concept. They had a tabbed web browser demo which I used to access Hangout. I was able to initiate a Hangout but the video of the Hangout was not contained as it should have been within the Awesomium demo browser, the Hangout window was at the top left of the screen whereas the browser was in the middle. So it worked but if they couldn't control where it was rendering then I didn't think an Awesomium would be an easy solution.
MozNET / Xulrunner
Next I tried my old friend, MozNET. MozNET is a XULrunner implementation which I've quite enjoyed using before. There again I wen the easy route first and used a demo browser example to see if I could get it working. Sadly it did not work. It would just hang at the step where Hangout is checking for its plugin. I feel like a MozNET solution wouldn't be too hard to achieve, but I don't have the depth of knowledge in it to make it happen easily. I know MozNET can be made to work with various XPI-based plugins.
Oddly enough, Google+ Hangout doesn't seem to be an XPI plugin. I did a procmon.exe dump of a Firefox when using Hangout and I see access to:
And a separate EXE gets launched:
C:\Users\foo\AppData\Local\Google\Google Talk Plugin\googletalkplugin.exe
But I'm not sure how what is doing the communication between Firefox and the Hangout code.
If anyone has any thoughts they'd like to share, please let me know! I think the world would benefit from an embeddable Google+ Hangout control... I know I would.
A few times a year I run into situations where an application, a driver, or something effectively locks me out of my computer. After trying various remedies I am ultimately forced to do a hard power down of the computer. I cringe every time I am forced to take that action, praying I don't end up with corrupted files.
Today I had enough. I went to shutdown my laptop and head out the door to go get a working lunch only to have my computer log me out and show me Acronis True Image's dreaded, "Operations are in progress. Please wait. The machine will be turned off automatically after the operations are complete." That is Acronis True Image's way of saying, "We're not going to shut down until a backup or backup verification finishes." The problem is those operations can take hours, and nine times out of ten the message is bogus, indicating not something in progress but a job that's hung. Today's case was one such example that would have left me waiting forever; the backup drive was disconnected, so Acronis True Image could not have been doing anything at all. When this message is displayed there's no normal way to force a shutdown other than forcing a power off with the power button. There is no ability to log in locally, no ability to log in remotely via RDP, no ability to use System Internal's remote tools (I am not sure if the reasons relate to permissions or not, I've not adequately investigated). So, today I decided to put in a back door which will save me in such situations.
Schedule a Task to Periodically Run a Remotely Editable Batch File
In all the cases where these sorts of things have happened I've noticed that I can still remotely access the computer's file system just fine. This got me to thinking I could use that as a vector for forcing Windows to execute some code to force the shutdown. To that end I created a shared folder on the laptop called "backdoor", made sure permissions allow only myself the privilege of editing its files, and created a single batch file inside it called backdoor.bat. I then set up a task in Windows Task Scheduler to execute that batch file as administrator (UAC) every 5 minutes from now until forever. When not needed the batch file is effectively empty, just a couple of commented out batch commands. If I find myself locked out I can populate the file with whatever executable commands might be appropriate to force the shutdown (e.g., System Internals' pslist, pskill, psshutdown).
Since setting this up a month ago I've already had two occasions where this method saved me and allowed me to shutdown my computer gracefully!
For anyone curious, the commands I put in the backdoor.bat file are:
C:\systeminternals\pslist -accepteula > pslist.txt
C:\systeminternals\pskill -accepteula trueimagehomeservice
C:\systeminternals\pskill -accepteula trueimagehomenotify
Those lines are commented out until and unless I need them. The first line lets me grab a snapshot of the running processes and put them in a text file I can read, very useful if the system still doesn't shut down. Since my task will only run every 5 minutes if the first attempt doesn't shut things down I've got several minutes to review the process list and find other processes to try and kill. The last two lines kill the processes that are typically hanging my shutdowns (I haven't bothered to check which of the two processes is the problem, so I just list both.)
Initially I tried to just use a more generic approach and force a shutdown ("psshutdown -accepteula -r -f -t 60") but I could never get this method to work, it didn't ever seem to kill the jobs that were hanging things up.
Since setting this up I've needed to use it a dozen times or more, saving me almost as many hard resets. The most frequent situation in which I need to use it has been when Stardock's Multiplicity prevents my keyboard and mouse from being used and when Acronis' True Image prevents shutdown (see above).
Multiplicity is a fantastic app that lets your mouse and keyboard seamlessly switch between different computers as though they were just extra monitors on the one computer. It is brilliant software, but has had a hugely serious bug in it for all the years as I've used it. If Multiplicity gave focus to another computer and that computer went offline (network outage, sleep/shutdown, software crash) it won't let you regain the use of your primary computer. Whatever timeout logic should restore your ability to use your primary computer fails the vast majority of the time and you are locked out of your own computer, unable to send commands to it. My backdoor trick lets me kill off Multiplicity and regain access.
If you used your Windows 8 Upgrade media to install a clean copy of Windows you've probably discovered by now that Windows 8 won't activate, telling you that your key is for upgrade and not clean install. Don't fret, there is a simple solution which does not require you pointlessly installing an old copy of XP, Vista, or Windows 7!
The easy three-step solution is:
- Modify the registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\OOBE and set the MediaBootInstall value to 0 (zero).
- Open an elevated command-prompt (run command as admin) and execute this command: "slmgr -rearm"
I'm not sharing this tip as a way to cheat Microsoft out of a dollar, I'm sharing it because anyone experienced enough to be installing a copy of Windows 8 on a clean hard drive has surely owned enough Microsoft computers over the years to legitimately qualify for the upgrade. With Windows XP through Windows 7 qualifying I know in the last 12 years I've owned and still have legal rights to at least 10 - 15 installations (mostly from retired computers).
This past weekend I reviewed the Viliv S10 Blade, the first iPad-like device for Windows... It's my new e-bff (but Apple can rest easy, it's no iPad killer).
Check out my review.