locked
Html5/Javascript for non-Metro Windows exe

    Question

  • Hi,

    I am just coming back to Visual Studio with the release of the Community Express IDE. I used to really be into Silverlight, but that died. :(

    During my absence I started programming with the universal Html5/JavaScript. I am only a hobby programmer, so I do not want to change back to C#/C++ again, otherwise I feel I am just a code converter rather than a programmer, developing programs.

    I have worked out how to do App-Store applications in html5/javscript (I think they are called Metro apps, but I am not up together with the lingo at the moment). However, I do not know how to create a normal Windows Desktop exe file using my javascript/html file.

    It was simple to do in Silverlight (the OOB stuff), but I just do not know how to create a desktop exe which has the html file in the exe as a resource. Surely it can be done.

    I do not mind having a shell of C++ or C# code which will load my html file and accept mouse click, keyups and keydowns etc. That was what you did in Silverlight if you wanted to program in html/javascript.

    Any ideas anyone? Does anyone have an example of the shell code?

    Jon

    Saturday, March 28, 2015 4:18 PM

Answers

  • Thanks for the reply Franklin.

    That is exactly it.

    I want a c++ or c# framework that will produce a standard desktop exe file, whose only function is to display a html/javascript file (which also passes on mousclicks and keyups etc to the html file). That html file is NOT on the web, it is instead contained within the exe file as a resource.

    You can do this as a METRO app:

    https://msdn.microsoft.com/en-us/library/windows/apps/xaml/br211385.aspx?f=255&MSPPError=-2147217396)

    but I want to do it for a proper exe windows program.


    Hi JAA17,

    >>I want a c++ or c# framework that will produce a standard desktop exe file, whose only function is to display a html/javascript file

    If I'm not misunderstanding, I think the answer is yes, for example, in .NET, Microsoft provides WebBroswer control to display website or local webpage in an application.

    See https://msdn.microsoft.com/en-us/library/system.windows.forms.webbrowser%28v=vs.110%29.aspx

    sample code:

    string curDir = Directory.GetCurrentDirectory();
    this.webBrowser1.Url = new Uri(String.Format("file:///{0}/testpage.html", curDir));

    This is a classical Winform application, you will get help on this in this forum: http://social.msdn.microsoft.com/Forums/en-US/home?forum=winforms


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by JAA17 Thursday, April 2, 2015 11:23 AM
    Tuesday, March 31, 2015 1:45 PM
    Moderator

All replies

  • Hi JAA17,

    >> However, I do not know how to create a normal Windows Desktop exe file using my javascript/html file.

    I'm not clear about your requirement, do you mean you want to create a desktop application which has js/html file as resource?


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, March 30, 2015 12:07 PM
    Moderator
  • Thanks for the reply Franklin.

    That is exactly it.

    I want a c++ or c# framework that will produce a standard desktop exe file, whose only function is to display a html/javascript file (which also passes on mousclicks and keyups etc to the html file). That html file is NOT on the web, it is instead contained within the exe file as a resource.

    You can do this as a METRO app:

    https://msdn.microsoft.com/en-us/library/windows/apps/xaml/br211385.aspx?f=255&MSPPError=-2147217396)

    but I want to do it for a proper exe windows program.

    Monday, March 30, 2015 4:01 PM
  • Thanks for the reply Franklin.

    That is exactly it.

    I want a c++ or c# framework that will produce a standard desktop exe file, whose only function is to display a html/javascript file (which also passes on mousclicks and keyups etc to the html file). That html file is NOT on the web, it is instead contained within the exe file as a resource.

    You can do this as a METRO app:

    https://msdn.microsoft.com/en-us/library/windows/apps/xaml/br211385.aspx?f=255&MSPPError=-2147217396)

    but I want to do it for a proper exe windows program.


    Hi JAA17,

    >>I want a c++ or c# framework that will produce a standard desktop exe file, whose only function is to display a html/javascript file

    If I'm not misunderstanding, I think the answer is yes, for example, in .NET, Microsoft provides WebBroswer control to display website or local webpage in an application.

    See https://msdn.microsoft.com/en-us/library/system.windows.forms.webbrowser%28v=vs.110%29.aspx

    sample code:

    string curDir = Directory.GetCurrentDirectory();
    this.webBrowser1.Url = new Uri(String.Format("file:///{0}/testpage.html", curDir));

    This is a classical Winform application, you will get help on this in this forum: http://social.msdn.microsoft.com/Forums/en-US/home?forum=winforms


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by JAA17 Thursday, April 2, 2015 11:23 AM
    Tuesday, March 31, 2015 1:45 PM
    Moderator