Opening another WinRT app from another running app in FULL mode - c#

I have 2 apps. I am running one in full mode and want to click a button from the first app to launch the second app .
My problem is that my second app is getting launched but both apps are in Snapped mode.
I programatically want to allow the other app to open in fill mode and first app should be in the memory.
Any help ?

Windows Store apps don't have any way to directly launch other apps. I assume you're launching a URI or file and your app is registered as the default handler (users can choose something else).
In your call to Launcher.LaunchUriAsync you can set the DesiredRemainingView in your LauncherOptions to indicate how much of the screen you'd like your app to keep. This is non-binding, but likely to be followed for UseNone. If there's room for UseHald (the default) then UseLess to snap/fill will likely be respected as well.

Related

Open application from Universal Windows(UWP)

So for our project, we have this app that's in the Windows Store. It is a Unity UWP app. At some point, we want to check if program X is installed on the user's machine. If yes, we want to launch it, if no we want to provide the user with a download link (or whatever.)
The app we want to launch, however, is a Unity standalone app. The user can download it from our website.
I tried multiple things. PlayerPrefs, Register checking etc. None of these really work. Register checking turned out to work decently well, but that only works between standalone apps. UWP apps seem to have no access to the Register.
Which left me thinking about URIs etc. But, I'm a complete noob regarding all of this and I have no clue how or where to start. Any help or direction is highly appreciated.
Ideal scenario:
User downloads our app from the Windows Store
Users click a button within our app
Our app checks the user's system for App X
If App X is installed, we launch it, if not we do something else
App X opens.
The UWP app cannot interact with the standalone Unity app directly.
You can write another standalone desktop “helper” app that does the actual work of checking the registry and launching the Unity app, and then make this “helper” app part of the UWP package and resubmit the package to the Windows Store.
Keep the “helper” app as simple as possible so it doesn’t have other dependencies.
Use FullTrustProcessLauncher to launch the helper app when the user clicks the button.
And the UWP app needs to have runFullTrust capability in order to use FullTrustProcessLauncher.
runFullTrust is a restricted capacity and when you submit the app to the Windows Store it is required for you to specify the reason why the capacity is necessary for your app. See this answer for more details.

UWP app start automatically at startup

All is in the title, I currently searching a way to launch my UWP app automatically at Windows startup with the UWP framework only, no file manipulation on the machine. The application must be able to be shared on the Store AND open when Windows starts.
Is it a feasible thing? If so how?
Thank you!
#hsmiths wrote easist solution to start app automatically and I'd like to summarize in step by step.
Open File Explorer
In address bar, copy-and-paste shell:AppsFolder
Right-click the app and then click Create Shorcut.
The message box asks to create shorcut on the Desktop. Click Yes.
In File Explorer address bar, copy-and-paste shell:startup
Go to Desktop and copy-and-paste shorcut to File Explorer.
Reboot your computer if you want to test.
+Tip: if you want to by-pass login dialog on Windows startup.
Start > Run
type control userpasswords2
User Accounts window will be opened. Uncheck Users must enter a user name ...
When you click OK, you will be asked to enter account password. Type password.
Reboot your computer if you want to test.
It seems that MS will add this feature - windows.startupTask - not only for converted desktop apps, but also UWP apps.
You can see it from about 37:00
Tip, tricks, and secrets: Building a great UWP app for PC
But this feature is not ready yet - It'll be available with Windows 10 Fall Creators Update.(I've tried with SDK 16225 but not ready yet)
Added 12/18/2017 - You can do it with Win10 Fall Creators Update.Following post show the details.
Configure your app to start at log-in (Windows Blog)
One consideration point is: By the feature, you can just 'start' the app - the app window is not shown. To see the app window, the user should click the app task at the task bar. It's a slightly ridiculous implementation for me. From the view of customer, 'click to start' and 'click to activate' is same behavior. You can do the some task in background before the user activate the app, but this is an another story.
If it's a desktop application converted to UWP you can declare a startup task in your appmanifest like this:
<desktop:Extension Category="windows.startupTask" Executable="bin\MyStartupTask.exe"
EntryPoint="Windows.FullTrustApplication">
<desktop:StartupTask TaskId="MyStartupTask" Enabled="true" DisplayName="My App Service" />
</desktop:Extension>
See Converted desktop app extensions
You can on Windows 10 (I'm not sure about Windows 8 or earlier versions), here's the instructions from Microsoft:
https://learn.microsoft.com/en-us/windows/uwp/launch-resume/create-and-register-a-background-task
Even in Windows 10 IoT you can set an app to autostart through a PS command:
[192.168.0.243]: PS C:\> iotstartup list MyBackgroundApp
You can create a .bat script that execute "start AppID!App"
"AppID!App" string is available in shell:AppsFolder view, you have to add the given column.
Then place the .bat file in the startup folder:
"shell:startup" for the given user,
"c:\windows\system32\GroupPolicy\User\Scripts\Logon" for all the users of the given computer
I think that is not possible, but maybe you can use a trigger in order to activating a background task when something happen..
Here's a list of the available triggers:
SystemTrigger
MaintenanceTrigger
TimeTrigger
PushNotificationTrigger
NetworkOperatorNotificationTrigger
NetworkOperatorHotspotAuthenticationTrigger
However you have some constraint.. take a look here: http://blogs.msdn.com/b/windowsappdev/archive/2012/05/24/being-productive-in-the-background-background-tasks.aspx

UWP Modal Window

I want to show a modal window on the screen in my Universal Windows Platform app (C#), just like the standard Mail-app does when you add an account. Or when you're signing in to a service (like facebook) in an app.
Windows mail app with modal window:
You can move this window around, but it's not in the taskbar and it is modal.
Does anyone know how to do this? It shouldn't be so hard but i can't find anything about it.
As #Daniel Meixner said, adding account interaction of this Mail app is calling another app possible with LaunchForResults.
Using Task Manager of system, you can see that, when you launch this Mail app, it starts a process with the app's name "Mail", and when you add an account from this app, it starts another process with the app's name "Email and accounts".
If we use the Process Explorer to check on these processes, the Mail app's process is this:
and the add account process is this:
They are in different processes and have different package names.
So I created two apps and use LaunchForResult for communication between these apps, they act just like the Mail app of system.
If you just want to launch the system's "add account" app, you can refer to the official UserDataAccountManager sample.
In the mail app what's happening might be app to app communication with "LaunchForResults" - I'm not sure, but it looks like that.
With Windows 10 Universal Apps you can make one app call another app with LaunchForResults. The called app will always behave like a modal dialog to the calling app.
You can pass any serializable objects in both directions using ValueSets.
Details for LaunchForResult can be found here:
https://msdn.microsoft.com/en-us/library/windows/apps/mt269386.aspx
It is possible to create a movable window, but you can't make it modal.
https://social.msdn.microsoft.com/Forums/sqlserver/en-US/f1328991-b5e5-48e1-b4ff-536a0013ef9f/is-it-possible-to-open-a-new-window-in-uwp-apps?forum=wpdevelop

open app url scheme without option to go to store if not available windows phone 8

On IOS and Android it's easy to detect wether a certain app is installed or not. Microsoft is not as friendly for developers and denies the access to information about other apps.
So when launching an url scheme on WP like:
Windows.System.Launcher.LaunchUriAsync(new system.Uri("myApp:MyParams"));
This would open a dialog you can either cancel or "go to store to download the app".
I would like to get a result where this dialog is never shown when the app is not installed and when it is installed the app just opens.
So can anyone help me with that? (of course more ideally would be an availability check but that's not gonna happen so)
Not possible in 8.1, you have to wait for 10 where there is more functionality provided for Launcher.LaunchUriAsync.
You can also call method Windows.System.Launcher.LaunchUriAsync with LauncherOptions param.
LauncherOptions.preferredApplicationPackageFamilyName Is set to the package family name of the app in the store that you want to recommend.
LauncherOptions.preferredApplicationDisplayName Is set to the name of that app LauncherOptions.
You must set both of these options to recommend an app. Setting one without the other will result in a failure.

NotifyIcon on startup

I trying to make a visible tray-icon of my program in windows startup, with the NotifyIcon component.
The program itself works great and the tray-icon showing up.
But, when i placing my program in computer startup, the tray icon not always showing up, while the program itself is running without any problems, and its main window is visible.
There is no custom code involved here, all code is auto-generated.
Running on Windows 7 Ultimate.
What can i do to make the tray icon to showing up in windows startup always?
in windows startup
If you mean you are running a OS boot time (e.g. by adding an entry to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run or with a service) then the process is running in a different session and has no access to the UI.
If you want a process to be run on OS startup and to be interactive you will need two applications: one to run on startup and expose some form of inter-0process communications (IPC), and two a UI application that uses the first applications IPC to communicate with it.
You also (depending on your target users) may need to consider cases where (1) no-one logs on to the system (e.g. a headless server), and (2) where multiple users login (e.g. remote desktop connections to a shared system).
In the past services could be configured to add items to the console user's UI, but this was blocked in Vista (as it opened up security holes).
You'll probably find it back in the hidden icons. On Win7 click the "Show hidden icons" arrow, click on Customize and override the behavior.

Categories

Resources