WPF C# OpenFileDialog does not show Network Storage - c#

At the moment i am working on a C# WPF-Project. It uses the Microsoft.Win32.OpenFileDialog and the System.Windows.Forms.FolderBrowserDialog, which both work as expected except for the following problem:
They both do not show my Networkdrives!
While the default Windows explorer (Win 8.1 btw.) and the OpenFileDialog in an older Winforms-Project do show all the devices, the WPF Application only shows local drives.
I have no Idea why this happens and how to fix it. Any ideas?

Apparently this happens when the application runs with elevated permissions like bernd commented on my question.
Look at this MSDN Post for all the details.

Related

Bypass windows file assignation reset

i am developing a music player in C# winforms.
My program has code which sets the .mp3 files deafult app to my program.
The code works but everytime it runs, windows resets the app:
(dont mind the extension in the image i got it from the internet cuz i wasnt able to screenshot it on my pc)
Is there a way to bypass this reset?
Since Windows 10, you cannot change the default application of a file type programmatically. The user is meant to change by himself the default programs from and only from the OS.
You can see the "Important" note in the MS doc : https://learn.microsoft.com/en-US/windows/win32/shell/default-programs?redirectedfrom=MSDN

AcroPDF viewer control problems

I'm at the point of giving up.
I need to view pdfs in my Winforms application, so I've tried using Adobe's ActiveX control, and the vanilla WebBrowser control. The pdfs are local, and can be opened from Explorer with no problems at all.
The weird thing is that the application views the pdfs fine when running in Visual Studio, but the built application simply shows a grey area where the pdf is supposed to be. The exact same thing happens with both the Adobe control and the WebBrowser control. After a while, I usually get an Adobe error saying There is a problem with Adobe Acrobat/Reader. If it is running, please exit and try again. (103:103). I've looked this error up, which advised me to do things that didn't work (turning off a security setting).
Moreover, if the WebBrowser control is called with a .Navigate(path, true), the application opens an IE window that displays the pdf just fine.
I've tried running as administrator, which makes no difference. I'm at wits' end, so any help would be greatly appreciated. Maybe going for a 3rd party control?
Some further detail: I tried both Adobe 11 and Adobe DC, on Windows 10 and 8.1 VMs, .Net 4.6. Only a Win7 VM seems to work fine.
I solved this by building to x86 targets. Apparently AcroPDF.dll doesn't support x64. Of course, the error messages weren't at all helpful.
My previous answer was incorrect. The real issue is Adobe's Protected Startup mode. This has to be turned off for the application to use the viewer directly without problems.

Mapped drives not visible on open dialog

I have a user that has Windows 10 and is saying that their mapped drives are not showing up on one machine specifically and only in my program. I am using a standard Microsoft.Win32.OpenFileDialog to allow the user to browse to a file to open. On this machine they sent me a screen shot where there is one windows explorer window open that shows the mapped drives just fine, then the open dialog in my program that doesn't show them at all (simultaneously). The really strange thing is that other machines on their network do not have the same issue, they show the drives in my program as well.
I'm not sure even where to start with this. I googled it but didn't really turn up anything; I also searched here and didn't find anything. Does anyone know if there is some obscure setting or something that could be causing it not to show mapped drives?
If you are attempting to run the program as an administrator you will not be able to see mapped drives.
Thanks to #jcolebrand who said this:
Are they running it as an administrative user? If so, mapped drives don't run across UAC elevations, and this could be what you're running into. – jcolebrand Sep 25 '15 at 21:15
In a comment above.

How to create a registry that allows the Silverlight applications access to camera and mic

I need to know how can I create a registry that allow the Silverlight applications access to camera and mic.
Scenario:
I have a Silverlight application that start the WebCam, before it works it shows a Silverlight dialog asking if the user allows the application to access it.
Finally I'm creating a desktop app that loads the Silverlight application in a web browser. I want my application desktop to creates a registry or something like that to allow this access and stopping to show the Silverlight dialog.
Exists some solution to this?? If yes, how can I do this?
For someone who has the same issue here is the solution:
https://stackoverflow.com/a/17829842/2882534
Just create a subkey named whit your Url plus port(ex: http://localhost:54895) at the HKEY_CURRENT_USER\Software\AppDataLow\Software\Microsoft\Silverlight\Permissions
After that, create a registry named WebcamAndMicrophone with DWORD and value 11.
Shazan! The silverlight dialog is not more necessary.
Tutorial to manipulate registrys:
http://www.codeproject.com/Articles/4808/All-you-wanted-to-know-about-the-Registry-with-C-P

How can I place a Desktop App shortcut on the Windows 8 Start screen without using an installer?

My Desktop Application is just a single exe file. For reasons that aren't important, I can't use an installer which would add an icon to the Windows 8 Start screen. Can one be added programatically with C#?
Thanks
If you right click on the exe you can click pin-to start
This worked for my example in the image, which is a stand-alone exe without any sort of installation. It will then appear on the start bar.
Hope this helps.
EDIT: I realized after that you said programmatically.
It looks like a link to the start page is put in C:\Users[UserName]\AppData\Roaming\Microsoft\Windows\Start Menu\Programs
So perhaps you could tell it to deposit a short cut there?
EDIT 2 this previous question may also be helpful: Creating application shortcut in a directory. It is in C#
Take a look at the code samples for enabling desktop notifications, a prerequisite of which is the existence of a shortcut installed to the Start screen. The sample is C++ w/COM, but you should be able to incorporate this small bit into a C# app (or rewrite the sample code in C# directly).

Categories