Click here to Skip to main content
15,885,878 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hi,

In my desktop app, there is a section where I listed some apps like PowerPoint, Excel, WOC(a custom app). When user clicks on it, the app must launch without closing my desktop app. Also, how to make my as full screen by default? Is it possible to achieve this using javascript only?

What I have tried:

well, I've not done much about this! All I tried is creating a separate project using "Office Extension" using Visual Studio 2019, but I couldn't able to get what I expected.
Posted
Updated 9-Jul-21 9:03am

Your code can request full-screen display using the fullscreen API:
Fullscreen API - Web APIs | MDN[^]

The user/browser is free to block the request. And the user can always exit full-screen by pressing the Esc key.

However, Javascript running in a web page cannot launch applications on the local computer. The closest you can get is to link to a file which would normally open in the desired application. However, the user is free to save that file instead of opening it, or to cancel the download.

And before you ask, this is a security feature. There is no way for your code to work around it.
 
Share this answer
 
 <script type="text/javascript" language="javascript">
function openSudoku() {
	document.getElementById('myP').style.display='none';        	
	WshShell = new ActiveXObject("WScript.Shell");
	WshShell.Run("C:/Apps/NextGame.exe", 1, false); 
    }
</script>
.

Works for me. Win 10 & Google Chrome.
There is always more than one way to make a cat purr... :-)
 
Share this answer
 
Comments
Richard Deeming 12-Jul-21 7:01am    
Chrome does not support ActiveX controls. They only work in Internet Explorer on Windows, and only if your security settings are sufficiently weak.

If you think you have this running in Chrome, then you probably have an add-in called "IE Tab" installed, and your page is actually loading in an Internet Explorer instance within Chrome.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900