How to open Windows Image Acquisition (WIA) vendor UI dialog - wia

I use Windows Image Acquisition Library v2.0 in a C# application.
I know how to scan without UI by Item.Transfer method, I know how to scan by CommonDialog.ShowTransfer method with common dialog but I can't figure out how I can open vendor dialog provided by the device driver (if available)
I tried CommonDialog.ShowAcquireImage where I can specify that I want common UI or not but no luck, both cases common dialog appears not the vendor dialog.
I know that not all device driver support this vendor UI, but my devices are correctly installed and wiainfo2 WDK application can open vendor and common dialogs as well.

Related

Share screen of Microsoft Windows 10 apps using webrtc

When a Windows 10 computer wants to share some of its screens using webrtc protocol (firefox navigator), a list of the windows that can be shared appears. In this list, only "normal" applications appears, not the one related to "apps". By example, spotify window appears, but OneNote window is not listed.
It seems (?) webrtc screen share is not compatible with UWP apps.
Knows someone a way to share the screen of an app via webrtc ?
Note: following link allows to reproduce this issue:
https://mozilla.github.io/webrtc-landing/gum_test.html
you do not need share anything, just push "window" and see the list of windows that appears.
I believe Chromium (the open source version - not sure about Chrome) faces the same problem as UWP requires to use a new Win 10 API which shows it's own window selector. And then obviously that selector doesn't work on other problems. So it's a common problem on Win 10, with no known good solution as far as I can tell.

What is the Idiom type for Xbox?

I have a UWP app created using Xamarin.Forms and I uploaded it on Microsoft Store, I enabled Microsoft to decide which platforms can I support, Xbox was automatically selected by Microsoft. I cant unfortunately test it since I dont have Xbox or any emulator available. But I am seeing that there are some downloads and Microsoft Developer Console shows the type as "Console"...
Now my question is on Xamarin.Forms doesnt have that idiom as Console, it is defined here as phone, tablet, desktop, tv, Unsupported... how to check for Xbox?
This is not built into Xamarin.Forms, so you will have to use Windows-specific API to recognize if the app is running on Xbox. You can implement a custom Dependency service that will have an interface which you will implement in UWP project. The documentation will tell you how to do it.
Then to check which type of device the app is actually running on you can check the value of:
Windows.System.Profile.AnalyticsInfo.VersionInfo.DeviceFamily
This property contains a value depending on which type of hardware the app is currently open:
"Windows.Xbox"
"Windows.Mobile"
"Windows.Desktop"
"Windows.Team"
"Windows.IoT"
"Windows.Holographic"

What do I convert a Delphi Win32 resource DLL to for a Delphi macOS app?

I have a resource DLL for a Windows Delphi app. I want to port this to macOS, and eventually to iOS (for iPad only, not iPhone). I have yet to dip my toes into developing outside of the VCL (I don't even own a Mac yet, though I know I will need one eventually). The FireMonkey stuff, no problem (yet). I just wonder what approach to take to port a Windows resource DLL to other platforms.
For Firemonkey, you can user the dialog box in menu "Project / Resource and images".
This help page will give you code sample to use it in your program :
http://docwiki.embarcadero.com/RADStudio/Tokyo/en/Resource_Files_Support

Can I run my winRT application as a screensaver?

Is there a way to make my winRT application as a screen saver in xaml?
As Jerry says, there's no straightforward way to make a Windows Store app screensaver. However, there's a roundabout solution that might work for you on Windows 8, but not Windows RT. I have it nearly working. I'll share what I have so far.
A screensaver is just an executable with a .scr extension that's kept in C:\Windows\System32. For example, look at C:\Windows\System32\Bubbles.scr. The solution I have in mind is to create a .scr screensaver whose only purpose is to launch your Windows Store application, which you say will use XAML.
You can't launch a Windows Store app from the command line directly, so you'll create a launcher app. Take a look at a blog post called Automating the testing of Windows 8 apps by Ashwin Needamangala. Partway down the article, look for the section called Automating the activation of your app. It contains a sample C++ application which can launch Windows Store apps in the following way:
C:>Win8AppLaunch.exe Microsoft.BingNews_8wekyb3d8bbwe!AppexNews
The sample launcher on that page needs to be modified, but before you do that just copy the code into a C++ console app:
You're almost ready to test it out from the command line, but you need to specify the name of the app as an AppUserModelId. The details are in Ashwin's post, but to paraphrase you first want to allow the execution of PowerShell scripts on your system with:
PS C:> Set-ExecutionPolicy AllSigned
Then run this PowerShell script:
$installedapps = get-AppxPackage
foreach ($app in $installedapps)
{
foreach ($id in (Get-AppxPackageManifest $app).package.applications.application.id)
{
$app.packagefamilyname + "!" + $id
}
}
You might like running it in the Windows PowerShell ISE. It's pretty slick. Find the AppUserModelId of your app and then test Win8AppLaunch.exe from the command line, as shown above. This should launch your Windows Store app from command line.
Next, modify the C++ launcher to hard-code the AppUserModelId of your application instead of parsing it from a command line argument. I created a Gist of this. The important part is the line where I declare myApp.
Build the new executable, rename it MyScreenSaver.scr and put it in C:\Windows\System32. It will then appear in the Screen Saver Settings Control Panel. You can preview the screensaver there, and it works. However, if you wait for the screensaver to launch, it will briefly bring up a console window and never fully launch. I'm not sure why. I tried disabling the creation of the console window by switching the project to a Windows app, but that didn't help. You can try that yourself by changing Properties | Configuration | Linker | System | SubSystem to WINDOWS. It's a little more involved, as you'll also need to change the entry point from _tMain to _tWinMain. Contact me through my blog if you want the details. My StackOverflow profile lists it.
At this point it's almost fully working. You might try starting with a blank C++ screensaver that you know works, and then copy in the above code. If I get more time, maybe I'll try this myself.
Cool idea. But, no.
If you want your application to really do something for Windows other than run as a simple app, then you write an extension app. Here's the official word:
Extensions An extension is like an agreement between an app and Windows. Extensions lets app developers extend or customize standard Windows features primarily for use in their apps and potentially for use in other apps.
There are these types of extension apps right now:
Account picture provider (extension)
When users decide to change their account picture, they can either select an existing picture or use an app to take a new one. If your app can take pictures, you can use this extension to have Windows list your app in the Account Picture Settings control panel. From there, users can select it to create a new account picture. For more info about this extension, see the UserInformation reference topic. You can also check out our Account picture name sample.
AutoPlay (extension)
When the user connects a device to a computer, Windows fires an AutoPlay event. This extension enables your app to be listed as an AutoPlay choice for the one or more AutoPlay events.
Background tasks (extension)
Apps can use background tasks to run app code even when the app is suspended. Background tasks are intended for small work items that require no interaction with the user.
Camera settings (extension)
Your app can provide a custom user interface for selecting camera options and choosing effects when a camera is used to capture photos or video. For more info about this extension, see Developing Windows Store device apps for cameras.
Contact picker (extension)
This extension enables your app to register to provide contact data. Your app is included in the list of apps that Windows displays whenever the user needs access to their contacts.
For more info about this extension, see the Windows.ApplicationModel.Contacts.Provider reference topic. You can also check out Managing user contacts.
File activation (extension)
Files that have the same file name extension are of the same file type. Your app can use existing, well known file types, such as .txt, or create a new file type. The file activation extension enables you to define a new file type or register to handle a file type.
Game Explorer (extension)
Your app can register with Windows as a game. To do this, you must create a Game Definition File (GDF), build it as a binary resource in your app, and declare that resource in the package manifest.
Print task settings (extension)
You can design an app that displays a custom print-related user interface and communicates directly with a print device. When you highlight the features that are specific to a particular make and model of print device, you can provide a richer, more enhanced user experience.
Protocol activation (extension)
Your app can use existing protocols for communication, such as mailto, or create a custom protocol. The protocol activation extension enables you to define a custom protocol or register to handle an existing protocol.
SSL/certificates (extension)
Digital certificates are used to authenticate one entity to another. For example, certificates are often used to authenticate a user to web services over SSL. This extension enables you to install a digital certificate with your app.
cite: http://msdn.microsoft.com/en-us/library/windows/apps/hh464906.aspx
Unfortunately, nothing has to do with screen savers. The technical reason, at this time, you cannot write a Windows 8 app that functions as a screensaver is because Windows 8 apps are fundamentally tied to run inside the WinRT execution environment. That shell does not extend out past the Start menu in this current version of Windows. So, there's no way to execute outside - like as a screen saver. Screen savers are still built the "old fashion way".

How can Windows Sidebar Gadget communicate with my desktop app?

I've got a .NET 2.0 Windows desktop application (time-sheets) which i develop and wanted to add a Gadget interface to it (so that app runs hidden and is controlled via the gadget).
What is the easiest way to get my gadget to communicate to my app?
An idea that i had was to have a built-in web server inside the app, and the gadget controls communicates with the app using ajax. However i'm hoping there's a simpler solution.
You didn't specify what technology the gadget and app were written with, so it's hard to answer. Assuming you can use .NET, WCF with a named-pipes binding would be very simple. Just a few lines of code to set it up.
We use win32 APIs in one of our gadgets' ActiveX control to communicate with other instances of the same gadget. Unfortunately, I can't give you the code (because I don't have permission and I don't write the .net stuff) but it boils down to using a window (in your case the application window) as a server and the gadget ActiveX control as the client and use the SendMessage function.
You can see an example of using COM interop with windows desktop gadgets at http://www.codeproject.com/KB/gadgets/GadgetInterop.aspx
NB: make sure the interop assembly is in the application's directory and NOT the gadget directory, otherwise you'll run into problems when updating/uninstalling the gadget.

Resources