Is it possible to embed/stream/project the live image of a native Windows window into a webpage? - node.js

In the new Microsoft Flight Simulator you can pop different cockpit displays out into their own external windows, like this:
However, none of the buttons needed to interact with the displays get "popped out" as well.
I'd like to build a web app that can embed (the continuously updating image of) one of these windows that I can surround with buttons, etc, for interaction to have, say, running on a tablet next to you.
My question is, is it possible with Node to embed the continuously updating image of a native Windows window within a webpage?

Stumbled upon the Screen Capture API. This is what I was looking for.
https://developer.mozilla.org/en-US/docs/Web/API/Screen_Capture_API

Related

Where does secondary image in (node.js) Windows 8 toast notification come from?

I'm using node-notifier (link) in node.js to show a toast notification in Windows 8. I have it working and I'm able to adjust the title, text, and main image in the notification just fine. However, in a Windows 8 toast notifications, there is a secondary (smaller) image. See below:
So, node-notifier uses toaster, which in turn uses ToastNotificationManager. But, I cannot find any reference anywhere to this secondary image. I've looked here and here on Microsoft's site.
This secondary image also shows in other notifications I receive from applications like Outlook, Slack, etc.
Where is this secondary image coming from? Is the documentation just out of date? Can Toaster be modified to access this secondary image?
The secondary image is the icon for the shortcut in the Start Menu folder for the program registered to raise a toast. To change it, you'll need to modify the icon on the shortcut.
For a desktop application to use the ToastNotificationManager class, it is required to have a shortcut in the start menu, and an AppUserModelId associated with that shortcut. At ToastNotificationManager creation time, the caller passes in the same AppUserModelId, which ties back to the associated icon for the shortcut. More about registering desktop applications to raise toasts this can be found on this MSDN documentation page.
Looking at the toaster code here, it is installing the shortcut to a file called toast.lnk in the Start Menu:
String shortcutPath =
Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) +
"\\Microsoft\\Windows\\Start Menu\\Programs\\toast.lnk";
And, it is creating the shortcut targeting the initial calling process:
String exePath = Process.GetCurrentProcess().MainModule.FileName;
Updating the icon in the shortcut manually should verify that you can change what is shown locally, but an update to toaster to set the icon location is likely required (to support multiple callers with different shortcuts, or by having it call IShellLink::SetIconLocation).

Desktop capture - Does not show all windows during sharing contents of Desktop

Here is the link to my extension code:
Trying to capture desktop image using getUserMedia and canvas
The problem is that when I use :
chrome.desktopCapture.chooseDesktopMedia(["screen", "window"],onAccessApproved);
It asks me to share contents of my screen. But it doesn't show all windows that are active on my desktop.
Example: Sometimes my skype is minimised and if click the extension icon it opens a sharing panel and asks me to share desktop contents but skype window is not shown in this panel. If I click on skype from my task bar, the sharing panel shows skype. Reason for this behaviour?
How to show all my windows on sharing screen?
Well, the behavior is consistent: on Windows, minimized windows are not shown as eligible capture targets. There is no way around it.
This limitation is not documented, which is regrettable; it may also be OS-specific.
Specifically, Windows implementation contains the following comment:
// Skip windows that are invisible, minimized, have no title, or are owned,
// unless they have the app window style set.
Interestingly, this seems more like a Mac limitation than a Windows one:
// Return a 1x1 black frame if the window is minimized, to match the behavior
// on Mac.

Change browser window size programmatically

I am developing a responsive website. For each and every change I made in javascript, css & html file, I need to test it in all possible screen size in portrait and landscape mode. Normally we used to test it in 3 to 5 different browser window size, and in portrait & landscape. I felt changing screensize and orientation again and again is a tedious job. So planned to write a tool, which will open multiple browser windows in a different screen size with the given url loaded in it. Any idea, or advice how to start this?
PS. If you are voting for deleting this question, please consider commenting with some suggestion how I can start, or is there any free tool available for this.
Thanks in advance.
There are number of great tools and services for helping test a website in just about every possible OS/browser/size these days.
BrowserStack.com allows you to pull up your website on nearly every combination of OS/browser/size and use the site to see how elements and features perform. There are other many other services that do this.
Another option would be a browser extension/plugin like Chrome's Window Resizer. It allows you to quickly toggle between common (and custom) window sizes. This is the most manual of the three options here, and the only free option.
One final option is Adobe's Edge Inspect. This app allows you to connect several devices to your computer and simultaneously browse a site across each of the devices. It also allows you to remote inspection on each of the connected devices.
Tools like Selenium can drive browsers and resize them as needed. Depending on the language of your choice, google for something like: selenium resize browser (language of your choice)

Spotify Apps API: Spotify crashes all the time

I'm working on a Spotify App, but the Spotify application keeps crashing on me. I have been trying to debug my own Javascript code, to see where it goes wrong, but it seems a bit random. It almost always happens when my app loses focus (i.e. switch to another app). Is there a compatibility issue with jQuery perhaps?
Unfortunately I can't find any crash-logs or anything, for Spotify. Are there any?
I hope someone can help me along here, because this problem makes developing cool Spotify Apps as good as impossible.
Edit: To clarify, I'm using Spotify 0.8.8.450.gd9413514, on Windows 8 64-bit, but I've also experienced the same on Windows 7 and Mac OS X 10.6.
Using Windows 7, you can create a crash log by accessing the Task Manager, right clicking the Spotify process and selecting "Create dump file". If you're on Mac OS X, you can get a crash dump by opening the Activity Monitor, selecting the Spotify process and clicking 'Sample Process'.
I was having the same problems, It seems related to ads banner on the top. Run the ad video and pause it, that solved the problem for me.

WP7 Emulator Browser not displaying anything

I use the webbrowser control to display a webpage from an application, but it just displayed a white screen. I tried Internet Explorer and it did not display anything either.
Any ideas how to fix this problem.
Thanks a lot in advance.
Windows Phone Emulator requires a DirectX 10 or above capable graphics card with a WDDM 1.1 driver. I assume that you got an error message on first start of the emulator that your graphic adapter isn't capable for all functions the emulator is using and that this may impact XNA games and sometimes silverlight like this one:
If your graphic adapter does not fully support DirectX 10 or doesn't has a WDDM 1.1 driver you will only see a white screen instead of the rendered webpage. This also affects all controls using MultiScaleImage, including the webbrowser control. As far as I know there is no solution for this at the moment.
To check if the emulator is running the required GPU emulation take a look at the arrow to open the application list and if it points to the right or left. If it points to the left, NO GPU is available - if it points to the right (as on the hardware phone itself) the GPU is available and rendering should work as expected.
See also this page in the msdn.
You haven't said if you're testing a local/private page or one on the web.
Also test other pages on the web. Can you view anything or just your own page.
If you can't see pages on the public web then you have a networking issue
If you can see public pages but not locally hosted ones then you probably have a different networking issue. If you're on an actual device or the emulator will likely greatly affect this.
The other things it may are:
you're trying to view a page that is to compilcated to be displayed (if there is such a thing - test with a very simple static page first)
the page uses useragent detecction and doesn't recognise the user agent and so is serving nothing
the page has complex javascript which runs before the page is rendered and the javascript is failing and so the page is never displayed.

Resources