How to add my protocol into default programs in windows 10? - windows

Hi I have a new protocol URL:myTest, how can I add it in windows 10 so I can see it listed in default programs? Shall I add it in registry? How/Where exactly could I do that?
I want to associate a program with this protocol.

The registration for "Default Programs" is in the registry under SOFTWARE\RegisteredApplications. If your application fits one of the client types then you should point your RegisteredApplications value to Software\Clients\%ClientType%\%YourCanonicalName%\Capabilities, otherwise you can use any key like Software\%YourCompany%\%YourApp%\Capabilities or Software\Classes\Applications\%Filename%\Capabilities.
The most important subkey in your case is UrlAssociations.
You must also register your protocol in the normal way.
Some of this changed in Windows 10 and I would recommend that you test on Windows 7 or 8 as well. "Default Programs" has been deprecated in Windows 10.
You should also register yourself in the Applications key for integration with the "Open with" dialog.
This is the way it works for pure desktop apps, I'm not sure what happens if you convert a desktop app to UWP. Modern apps declare their protocol in the manifest.

Related

What API/protocol is used to implement `Share` feature in windows explorer

I want to know the API or protocol of the Share feature in the windows explorer like this
Does anybody have any ideas?
ShowShareUIForWindow (MSDN says it requires Windows 8 but it actually only works in Windows 10/11 in a normal desktop application).
How do I show the sharing pane from a Win32 desktop application?

How to create cyrillic input on windows phone?

On my Nexus 7 input keyboard I have an option to switch languages (Bulgarian, Russian and English).
I want to create such input on windows phone application, but was not able to find a way to do that?
I am not going to deploy the application on the store, just wanted to enabled this on the emulator.
Users can set this for themselves in the keyboard settings. You can't interact with the keyboard as a developer aside from setting it's inputscope (eg. web address, e-mail, numbers).

React to failed login in Windows, and launch an interactive window

I need to place a link on the Windows home screen (before a user is logged in)
When this link is clicked, I want to launch a browser pointed at a specific web app.
This would be used to enable self-service password resets.
Is this possible? How would it be done?
EDIT: This must work on Windows 7 (and above) and Windows Server 2008 (and above)
In earlier versions of Windows, you could write a GINA DLL, which could completely replace the interface that was displayed to users during the logon process.
However, beginning with Windows Vista, GINA was removed and support was added for Credential Providers. While they provide improvements over the GINA model used previously, they also limit the flexibility afforded to developers with GINA - gone are the days when you could display a custom interface.
This isn't to say that it's not possible to have a custom provider display some UI elements. But launching a full-blown web browser is a horrible idea, plain and simple, and just asking for trouble.
You may want to check out the article Custom Login Experiences: Credential Providers in Windows Vista which is not fully up to date but is a good place to start from nonetheless.

Setting mailto: protocol handler programmatically in Windows 8

Before Windows 8, the method of adding a mailto: protocol handler was straightforward (as outlined here Register Windows program with the mailto protocol programmatically)
As of Windows 8, the old method no longer works. It would seem that Win8 enforces the following key: HKEY_CURRENT_USER\Software\Microsoft\Windows\Shell\Associations\URLAssociations\‌​MAILTO\UserChoice.
It also appears the ProgID of the selected app is hashed and can't be forged, at least not that I can tell.
Does anyone have a working method for this, or can point me at a utility class/code that'll outline how to accomplish this programmatically?
For code, any language will do.
Edit
I've been asked from other discussions to specify a use-case, so I think it'd be helpful in the context of this question. Please consider this screenshot https://github.com/shellscape/Gmail-Notifier-Plus/raw/master/Promotional/prefs-account.png and the checkbox allowing the user to specify mailto handling. In this use-case, no one is forcing the user, the user is in control and makes the decision. While windows 8 store apps (metro/modern) have an available app manifest entry that automates the missing process described above, nothing seems to readily exist for desktop apps.
You can set your application to be activated by a custom protocol (like mailto:). When the user installs your app, if there is no other app supporting that protocol, they are not prompted and you are automatically assigned to that protocol.
If, however, the user already has an app that handles that protocol, then they will be prompted with a list of apps who support that protocol with the option to select the default. You cannot force the user to make a specific selection.
Also, if the user clicks on a protocol (like myprotocol:) and they have no app installed that handles that protocol then they will be sent to the store (app) which automatically searches for all apps that support that protocol. The user then installs whatever they want. You cannot force the user to make a specific selection (if any at all).
I wrote an article on protocol activation. It might be interesting to you: http://blog.jerrynixon.com/2012/10/walkthrough-using-windows-8-custom.html
So, I made Desktop Firefox my default mailto handler today in Windows 8 by adding the string value "mailto" to the HKCU\Software\Clients\StartMenuInternet\FIREFOX.EXE\Capabilities\URLAssociations and setting the value of "mailto" equal to the ProgID or "FirefoxURL". I then deleted the keys at HKEY_CURRENT_USER\Software\Microsoft\Windows\Shell\Associations\URLAssociations\‌​MAILTO\UserChoice to allow me to choose the default client again and this time Firefox was available for me to choose.
The essence of this question seems to be that one cannot take over the default client for any protocol anymore (post Windows 8). The user must choose. However, if you wanted to break the OS convention you could hook the call to create the choose default dialog, which would take research, effort, and be only a temporary kludge and would require "breaking" the OS, or you could send a double click to the dialog to choose for the user, assuming your program has elevated rights so that it can send clicks to Admin windows. That would probably be the easiest way, the user would never know what happened, just a quick flash. Really though, after registering itself as a protocol handler, I don't think any program should go beyond deleting the default protocol handler registry entry, thereby forcing the user to re-choose.
This is how to set mailto protocol manually and simply in Windows 8, 8.1, 2012, 2012R2
Add a new registry branch HKEY_CURRENT_USER\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\mailto\UserChoice
Then click any mailto: link in your web browser, say IE
and finally there in a program list for you to choose which was not available before.
Also MAILTO appears in Control Panel\All Control Panel Items\Default Programs now. There is no other option to add/remove a protocol from there.
You can't have your app directly take over file associations anymore in Windows 8. There are guidelines for how to handle this for both Windows Store and desktop applications here: http://msdn.microsoft.com/en-us/library/windows/apps/hh700321.aspx

Windows 8 Layered Windows Over Metro Apps

I have an app that runs on Windows 7 using Microsoft's Layered Window http://msdn.microsoft.com/en-us/library/ms997507.aspx. This app is setup to have a 30% opacity, it's always on top, and it is transparent to events (ie: it forwards all events to windows underneath it). You can think of it as a "screen" you are looking at your desktop through. It is currently being used to be an omnipresent feedback layer for our users.
We've tried running the same app on Windows 8, and notice it works as expected in desktop mode, but nothing overlays the start menu and other metro apps.
Does anyone know if there is an equivalent always on top window mode that works across metro apps and the start menu in Windows 8?
Yes, it is possible. Please take a look at this page:
http://blogs.microsoft.co.il/blogs/pavely/archive/2012/05/16/windows-8-topmost-vs-topmost.aspx
Specifically the second post in the comments section:
The topmost window is also affected by the accessibility settings. If you want a window on top of Metro, you need it to declare accessibility. Here are the key points:
The application must demand uiAccess (app.manifest)
The application must assert “topmost” window positioning (either in Win32/SetWindowPos or WinForms/WPF’s Topmost property, programmatically or otherwise)
Without making changes to the group policy setting, it must be installed to some trusted location [C:\Windows, C:\Program Files, C:\Program Files (x86)].
If you want to be able to run it out of an arbitrary location, you must disable the security setting: “User Account Control: Only elevate UIAccess applications that are installed in secure locations”.
This is the same as setting HKLM\Software\Microsoft\Windows\CurrentVersion\Policies\System\ValidateAdminCodeSignatures to 0
Said application cannot be run in the debugger
If it’s a .NET application:
The manifest must be embedded in a post-build step
The application must have “delayed signing” (meaning it cannot be ran from the built-in debugger, although you can build and attach – this is what Microsoft does)
The application must be signed with a trusted certificate.
Said trusted certificate must be installed to the Trusted Root Certificate Authority (this is important! It must not just simply installed)
Run the windows speech recognition. Its a top most window which floats over start menu, desktop etc. So its possible for sure. I am working on a touch simulator for Windows 8 and needed to implement this feature.
Here are the steps to achieve this:
http://www.pixytech.com/rajnish/2013/05/windows-8-topmost-window/
I am almost positive that you can't have any other app overlaying a Metro app. The new Metro environment is meant to run single, full-screen apps (or two, but only if snapped to the side). Further, allowing something to act as a man-in-the-middle is a bit dangerous, since they could capture all sorts of sensitive user data.
That being said, if you can set the "always on top" property of a window, it might stay put over the Start menu and various Metro apps. I know it works with Task Manager, but I have never tried with an arbitrary app. I do not know that it would work well for Metro apps, however, due to their events being different than old-timey winform apps. You'd have to see if your "screen" allows touch events to pass through.

Resources