How to disable resize button in winjs - win-universal-app

I'm developing windows 10 cordova application and for native integration we should use WinJS. I would like to know below things in Winjs app.
How to disable resize button in app control bar?
How to set maximum windows during application load?

There is no way in UWP to manipulate with windowing buttons (e.g. disable them). To control window size you can use the following three methods:
setPrefferedMinSize to define minimum window size (up to 500x500px).
tryResizeView to manually attempt to resize windows to desired size.
tryEnterFullScreenMode to place app in full-screen mode.
There is a code sample on GitHub for these methods, including JS.

Related

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

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

Make electron window able to receive click event when above keynote app

I am working on electron app where i open a child window which i want to be above all the windows (not above fullscreen windows though), I managed to do it by using
win.setAlwaysOnTop(true, "screen-saver");
It now stays on top of all other open apps and keynote app presentation mode, i want user to be able to click buttons inside my window but now the issue is as soon as user clicks on button or just window in my child window, keynote window minimizes (as focus shifts to my window).
What i tried : I tried almost all available window option given in electron docs with different variations, I also tried playing with modals, but obviously modals stay in window itself, i want to keep main app minimized and keep child window on top of other apps. I also found electron-modal package, but that also behaves same.
working example
I was trying different application to check is any other application is able to do it, and i found that zoom app window (in screen share mode) is able to stay on top of keynote app and you can click buttons inside that app, you can move window, and keynote app keeps running in the background with no issues. I am trying to achieve exactly same behaviour.
This is something that you won't be able to recreate with electron currently, except through a native node module that manipulates your window related OS flags.
You can follow this issue on the Electron repository, since the flags introduced there should resolve your issue, or at least give you a point of entry to make your own PR or node_module.
https://github.com/electron/electron/issues/10078

Desktop gadet/app for Windows

I want to make a desktop gadget like the Sticky notes that we have but just with some additional functionality.
Now that the gadgets have been discontinued in windows, i am not sure about what technology to use to create this app.
I want to create a custom UI like just a Add button on the side of the desktop and clicking on it would create notes.
I was trying to use node-webkit but seems that will appear like a web page and not what I want. Can anyone tell me what should i use to achieve the result.
A Node Webkit window doesn't have to look like a webpage. You can use a frameless window and then design the UI to look however you want with HTML and CSS.
Frameless Window

Linux Window Manager Forces Window Size/Location

We're using Red Hat Linux 6.4, and our application is built using Qt. The application has multiple windows and we support a layout system where our users can save the application layout and restore it later. The application is cross-platform, and on Windows, everything is fine. On Linux, we're having problems restoring windows when a window spans multiple monitors. Our configuration uses a single virtual X display spanning all monitors, and the users can manually position and size windows across the monitors as desired.
What we've found is that the window manager is enforcing a policy on windows that are programmatically set and forcing them not to span across divide between two monitors. When we attempt to restore a saved layout containing a window that spanned monitors, the window manager reduces its size and repositions at as it sees fit. Basically, as long as the user makes the change by dragging and resizing the window, the window manager respects it, but an application that programmatically sets it gets overridden. I'm sure someone somewhere thought this was a reasonable restriction, but our customers disagree.
A developer here has spent days searching and experimented trying to find a way to work around this behavior programmatically, or better yet, tell the window manager to stop doing that. We're using the GNOME desktop and Qt 4.8.x.
Any ideas?
Thank you,
Doug McGrath

How to separately style HTML5 apps using the Sencha framework for iOS and Android?

App development in native Apps happens separately for iPhone and Android. But in HTML5 Sencha framework apps, the same HTML5 code is used. Should we use same visual styling for alert boxes or buttons for both platforms or should they look different depending on the platform?
Since the same HTML5 code is used, how do you to take care of different look and feel for both platforms? For example, the menu bar is at bottom for iPhone and for android it is at the top. Or for Android we need to hide the top back button Or how to style the alert boxes or buttons differently for both platforms?
Do we need to use different set of CSS files for iOS and for An?
I was going thru the kitchen sync Sencha application and it shows a very basic styling for alert boxes.
You can use the iOS/Android classes that Sencha Touch will add when detecting user agent. For example, if the device is running iOS the body element has the class "x-ios". For android it will be "x-android". This also applies for specific OS versions (ex: "x-ios-4"). Try overriding your user agent in Chrome and inspect the elements under different agents to get an understanding of the classes. Using these classes you can avoid multiple stylesheets and just set up the CSS accordingly depending on the class.
As for specific layout tweaks that cannot be performed with simple CSS - this is where profiles come into play (http://docs.sencha.com/touch/2-1/#!/api/Ext.app.Profile). Set up a profile for Android and iOS, and use the launch function to manipulate specific components as needed.
Using these methods you should be able to keep things organized and minimize the number of separate files needed.

Resources