Process.Start() is not working in windows 10 - c#-4.0

I am using this below code to open a browser programmatically,this is not working in windows 10 whereas it is working in all the previous versions like Windows 8.1, Windows 7, etc.
Process.Start("http://stackoverflow.com");
Is there anyway to open a browser window programmatically in windows 10?

Try to open it with explorer (not internet explorer):
var startInfo = new ProcessStartInfo("explorer.exe", "http://stackoverflow.com");
Process.Start(startInfo);
It probably has to do with the default browser being a modern app... it used to happen with Chrome/ModernUI when it was your default browser on Windows 8 too

Related

Launching pgAdmin v4 on a browser that is not the default one

I have pgAdmin v4 installed, my default browser is Firefox, but I would like to open pgAdmin as a standalone app on Chrome. I fixed that problem following the procedure described in various Stackoverflow answers such as Launch pgAdmin 4 as a standalone app using chrome browser commands and pgAdmin 4 v3.1 How can I use another browser? (Win 7), i.e. configuring the "Browser command" option of pgAdmin to use Chrome.
That worked till sometime ago, but with the latest versions (at least 4.24 an 4.25) there is a problem: when I launch pgAdmin it still opens the default browser and not Chrome, as I configured. However, if I right click on the icon of the system tray and select "New pgAdmin 4 window..." it correctly opens Chrome.
I thought it was just me, but I found that there is at least another user with the same problem.
As pointed out by a developer of EnterpriseDB (the company behind pgAdmin) in this answer, that is a bug in the QT library that happens on Windows platform; it has already been reported and developers are working on that.

prevent windows 10 mobile from locking

I have finally upgraded my windows 8 app to windows 10 app. Unfortunately some of the features are not working in windows 10. One of the features I am looking is preventing automatic lock screen while my application is running.
In windows phone 8 I am using below code to prevent auto locking of windows phone, however, in windows 10, I didn't find this feature.
PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;
What is the alternate of the above in windows 10?
Thanks!
you might use the new DisplayRequest class
Pretty simple to use :
displayRequest = new DisplayRequest();
displayRequest.RequestActive();
//Do your always on stuff
displayRequest.RequestRelease();

How to change System locale in Windows 7 using Command prompt

Earlier in Windows XP, Our projects Uses the following code to change the system locale in Windows XP.
driveStr.Format("RUNDLL32.EXE SETUPAPI.DLL,InstallHinfSection %.8x 128 %s\\inf\\intl.inf", lgid, getenv("windir"));
Now we migrated the project to Windows 7, Whenever we try to change the language using above format, Application crashes. Later figured it out that the file Intl.inf which used in Windows XP is not part of the Windows 7 anymore which causes the application to crash.
Please let me know, Is there any way to change the system locale on Windows 7 using Command prompt

MSHTML Browser Emulation set to 0x0 crashes application in Windows 10

If you are using mshtml as an embedded browser in Windows and want it to render in the latest installed render model (i.e. using the latest installed IE) you can use the following registry Key:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION
And add your program name and the number "0x0". Normally you set it to a value to correspond to a specific IE version, but in my program I always want to use the latest installed version.
In Windows 10 this does not work anymore. Setting "0x0" then crashes the application if rendering a local page or gives a blank page for an Internet page. The "0x0" setting works fine with IE6-11 and Windows XP to Win 8.1.
Not setting anything gives either IE6 quirk mode or IE7 quirk mode. Setting it to "11001" in Windows 10 also works.
Is this a bug in Windows 10? (I know that the "0x0" setting is not documented...)
How do I get the latest installed Browser Emulation no matter what Windows version or IE I have installed?
P.s.
If an upgraded IE is installed after my application I still want the latest version.

Watir not opening webpages on IE9

I use cucumber + watir.
My code works fine in Windows XP Mode for both IE7 and IE8.
However, when I try to run the code in Windows 7 with IE9, it would only open a blank page.
My computer runs Windows 7 64-bits, and it opens the 32-bit IE9 browser.
The initializing code is as follows:
if ENV['FIREWATIR']
require 'firewatir'
Browser = FireWatir::Firefox
else
case RUBY_PLATFORM
when /darwin|linux/
require 'firewatir'
Browser = FireWatir::Firefox
# require 'safariwatir'
# Browser = Watir::Safari
when /win32|mingw/
require 'watir'
Browser = Watir::IE
when /java/
require 'celerity'
Browser = Celerity::Browser
else
raise "This platform is not supported (#{PLATFORM})"
end
end
What might be the problem?
are you running your scripts from a command line that is opened 'as administrator' when running on Win7? It's been my experience that is required for things to work correctly
Watir 1.9 was recently released, with fully support for IE9. Which version are you using?

Resources