Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the quickest path to writing a lightweight GUI program on Windows?

I want a small (< 30MB) standalone Windows executable (a single file) that creates a window which asks the user for the location of a directory and then launches a different program in that directory.

This executable has to run on XP, Vista, Server 2003, and Server 2008 versions of Windows in 32-bits and 64 bits on x86-64 architecture as well as Itanium chips.

It would be spectacular if we only had to build it once in order to run it on all these platforms, but that is not a requirement. This is for a proprietary system, so GPL code is off-limits.

What is the fastest way to put this together?

These are some things I'm looking into, so if you have info about their viability, I'm all about it:

  • Perl/Tk using perl2exe to get the binary.
  • Ruby with wxruby
  • Learn MFC programming and do it the right way like everybody else.
like image 790
Adrian Dunston Avatar asked Nov 07 '08 17:11

Adrian Dunston


People also ask

What is the best way to create GUI?

The creation of applications in Linux can be done through various methods. But, the most efficient way of creating a GUI application in Linux can be done through PyGObject in Python. PyGObject is the next generation from the PyGTK library in Python, we can say that PyGObject = Python + GTK3.

How do I make a Windows application GUI?

Click File > New, then select Dialog System Screenset on the New dialog box, and click OK. Click Yes on the message asking if you want to create a project. Select Windows GUI Project. Enter Welcome as the name of the project.


2 Answers

What about a WSH script? It won't be an exe, right, but to ask for a folder I don't see the need for an exe file, much less a 30Mb one...

A 1Kb script, save it as whatever name you like with vbs extension and run it. This, in case it's not clear, asks you for a folder name and then runs calc.exe from the system32 subdirectory. You can of course do a lot better than this in 2 or 4 Kb.

Set WshShell = WScript.CreateObject("WScript.Shell")
win = InputBox("Please type your Windows folder location.")
If Right(win,1) <> "\" Then
  win = win & "\"
End If
WshShell.Run win & "system32\calc.exe"

To add a Folder Browser dialog instead of an InputBox, check this out.

Clear benefits are:

  • Simplicity (well, VB is ugly, but you can use JScript if you prefer), no need to compile it!
  • Compatibility, works on every windows machine I have available (from 98 onwards)
like image 98
Vinko Vrsalovic Avatar answered Oct 26 '22 23:10

Vinko Vrsalovic


I'd use .NET and WinForms. The idea of scripted solution is appealing, but in practice I often find you end up jumping through hoops to do anything beyond the basic case and still don't have the flexibility to do everything you want.

like image 30
user3891 Avatar answered Oct 27 '22 00:10

user3891