I need to create an application for all versions of windows (XP, Vista, 7) without the need to install .NET or other 3rd party tools.
The application needs to download files asynchronous which are received in a json format and display a html page which can communicate with the application using javascript.
Is there a way to do that using an advanced IDE like Visual Studio but without requiring anything besides the application exe?
Are there any open source alternatives?
Thank you.
Look into the WebBrowser control. It's basically an Internet Explorer control you can embed in your application, and it has an interface that allows all sorts of manipulations. And given Internet Explorer is always a part of windows, it'll always be available without further installations.
Using the control requires some work. You can start by looking at Using the WebBrowser control, simplified. It uses MFC, but you can use the control with plain C++ as well.
The way I'd use it is push as many complicated tasks as possible to the browser control, and run them using JavaScript. A-synchronously downloading JSON is a pain in C++, but a no-brainer in JS. So you can basically divide your logic between C++ and JavaScript, and figure out some interface (by using, say, the DOM).
Related
I have a light/simple app (Winodws GUI), I want to know what is the development tool of this app? most of the app's files are as bellow.
I am newer to app development, I expected to know like "this app is developed by WPF&C#, Electron&Js, Qt&C++" this message. I am not sure if this message could be idenfied from the files shown
btw, there is an .exe with them
It is impossible to say exactly because these libraries are pretty common.
msvcp140 implies that the base is C++ developed with Visual Studio 2015 or later.
d3d* means something there is using Direct3D as well (could be Chromium). EGL/GLES is more graphics stuff, probably used by Chromium.
The presence of Chrome* means it is either using Chromium to display some web content or the entire app is HTML/Javascript based like Electron.
You should inspect the .exe in a hex editor. And a strings tool.
Use something like WinSpy to inspect the main application window. What is the class name?
I have looked at the Microsoft Forms 2.0 Object Library (FM20.DLL) and Microsoft Windows Common Controls (comctl32.dll), as both exist (I think) as OLE providers on my system. (I am doing this by opening them in VBA in Excel to look at the libraries with their members) and playing around with them in VBA.
My bigger problem is that I don't understand the relationship between the libraries themselves and ActiveX - how do I know which members can be created as ActiveX objects? (For example, you can create "Excel.Application", but not "MSForms.UserForm").
I want to be able to script (using OLE) a form using some library, display it, respond to events, etc. I would prefer using something that is already available (like the libraries mentioned above, if possible) to prevent having to install extra software.
If you can give an example (in any language) to get me started, that would be very helpful and much appreciated.
As per HansPassant's comment, what worked is using MS Forms 2.0, which has an ActiveX object, "Forms.Frame.1", which can be created and used in my program.
I found a program called ActiveXHelper, which allows one to see all the registered ActiveX objects on the system.
I hope this isn't a stupid question:
I wonder if there’s a way to build a web client and a windows desktop client (that looks the same and offer the same features) with the same code (not just same language), at least till a certain point - in other words, having an abstract code that will fit the web server and windows?
Thanks!
You should take a look at Adobe's FLEX, you can have same classes/layout for both web apps (run under Flash) and desktop app (run under AIR). The only difference will be in the main file, you will have one for each flash and air app. (The rest of code will can be compiled into one SWF, also have in mind that you should use same functionalities for both web and desktop )
I believe Java can do what you want, with minor modifications to have it run as a full-blown desktop application vs a Java applet.
One thing you'll need to do, is ensure that for the app, your main function is very small (ie, only call the main JFrame or whatever), and replicate that simple call in the applet code.
For the differences between the two, see for example, here and here. You'll need exactly one tiny source file that's different for the applet vs application.
Real Studio will also let you do this to some extent. Newer versions can create web applications and desktop applications. Non-UI code can be shared with web and desktop apps. The UI code will have to be different, though.
My goal is to control an application from VB.NET. There is no API, and I do not have the source, only the compiled EXE file. Is there a way to find the opened application, find a button within the application, click a button and know it was clicked? Is there a way to read the contents of a textbox within the application?
Yes, with Windows Vista (or Windows 7, or Windows Server 2003 and later) there are "UI Automation" APIs.
There are managed options; System.Windows.Automation is one, shipped with .NET 3.0, as part of WPF... Though System.Windows.Automation was shipped as part of WPF, it does not require that the target application uses WPF.
You can read more:
the UI Automation blog.
the MSDN Magazine article - talks about using PowerShell with System.Management.Automation.dll (an alternative to System.Windows.Automation).
Blog post by Samuel Jack - describes using System.Windows.Automation to automate the Paint.NET program (C#).
CodeProject article #1 shows using UI Automation to test an installer
CodeProject article #2 provides a basic introduction to using System.Windows.Automation
Yes, you can, but first it might be easier to use 'AutoIt' as a prototyping script first to find the application. Look for the handle of the window of that application, enumerate through that window's child controls, look for that text box specifically and the button...once AutoIt prototype works, then dive into the real coding and it would be possible to use P/Invoke's to enumerate and find the windows, get the handles of it and perform the automation on it...
Have a look at the sample in C# from Stack Overflow posting Calling SendMessage (P/Invoke) keeps crashing. The OP was trying to access a third party window application, to extract texts and to use that texts within their program...notice how in that given link, 'FindWindow' was used to iterate through the child windows of the main process's window.
Yes, but you will have to resort to using native API calls such as EnumWindows and EnumChildWindows for example. Take a look at How To Enumerate Windows Using the Win32 API. It is for Visual Basic 6.0, but the concept is the same.
I need to write quickly this application: a simple window that wraps
a web browser control, that runs html pages.
The Browser UI (e.g. Navigation buttons) should be suppressed.
As a .net developer, I would embed the WebBrowser OCX in a Windows Form.
But this has to run on Mac as well!
I found the following cross-platform candidates.
Which one would you choose (in terms of simplicity, stableness, community support, etc.):
wxWidgets: http://www.kirix.com/labs/wxwebconnect.html
QT: http://www.youtube.com/watch?v=Ee8eRwjbcFk&feature=related
MONO: http://www.mono-project.com/WebBrowser
Why not to use embedded Webkit?
QtWebkit:
The Qt port of WebKit currently compiles and runs on Linux (including Maemo), Windows, Mac OS X and Symbian.
Click here for build instructions.
A very simple test browser is built along with the port.
Since you have (assumption made from your post) .Net experience I'd go with Mono.
Have you considered Adobe AIR?
http://www.adobe.com/products/air/
Mono is probably the best choice if you're primarily a .NET developer and don't care very much about making a well-integrated Mac app (one that behaves like a Mac app in all the many ways Mac users expect). Given your problem space, that sounds like where you are. That said, pay special attention to this limitation from the WebBrowser page if it applies to your problem:
The Mono Webbrowser currently lacks
support for window.external, the
bridge that allows Javascript code
embedded in the browser to communicate
with the managed world using the
ObjectForScripting.
QT is very well established, and a great platform if you want to develop this in C++. Remember that there are licensing fees if this is a commercial app.
I've played a bit with wxWidgets. It's big advantage here is that it's probably going to be the smallest distribution, since you only have to include what you need. If all you need is the web browser, I'd look at this, but in my experience it's hard to make wxWidgets programs look good or act correctly on Mac (or on Windows for that matter).
Another option may be to write it as a Java app using the Eclipse Standard Widget Toolkit. This includes a browser control that embeds IE, Safari or Firefox, depending on the current platform, and generally behaves well on OS X.