2

I'm looking to develop a Win32 desktop app - a one off, for a personal need. A GUI is not scrictly needed, though would be a bonus.

What is needed:

  • The ability to monitor the window title of a specific window.
  • The ability to run DOS commands when this window title changes.

I hope my programming ability is up to this - I feel I'm pretty good with PHP, but I'm not ready to spend time learning OO for this one-off project.

What non OO (or at least not mandatorily OO) languages are there for desktop apps that might be suitable for a beginner on a task like?

Any other, more hacky approaches are welcome too - batch scripts etc.

Many thanks for any advice,

Jack

Jack Shepherd
  • 165
  • 4
  • 12
  • 1
    Python! I use it for scripting, web development (serverside), and applications. Here's a small sample: http://blender3d.github.com/Bindery/. – Blender Apr 14 '11 at 18:06
  • Tcl/Tk comes to mind for simplistic needs. There are very working Windows ports. Not the most lovely language, and not sure about the window title reading capability. But it's easy to get started. – mario Apr 14 '11 at 18:10
  • 1
    PHP was intended to replace Perl at one point when it comes to shell scripting - I see no reason why not to use it, no one says it has to be OO, you can freely mix approaches as you feel if you need a console app, I've done loads of them for Windows and Linux. If you want to learn another language while doing a project - that's another thing then. Also, there's GTK available for PHP so you can create a nice GUI for your program. – N.B. Apr 14 '11 at 18:15

5 Answers5

2

Whether or not the language supports OO doesn't really matter for your purposes. After all, PHP supports objects and you seem to do just fine with it.

Personally, i'd recommend Java or C# to get started with. The communities for these two languages are huge and there are plenty of tutorials online to help you get started.

It's extremely easy to get starting writing C# with Visual Studio Express. And a good hello world tutorial.

Also, if you stick with C# you can take advantage of WMI which will allow you to do everything you need for this project (and much much more).

Lastly, most windows machines will be able to run your application without having to install anything extra and Visual Studio builds the .exe for you as part of the build process.

Robert Greiner
  • 29,049
  • 9
  • 65
  • 85
2

You can use PHP for desktop apps if you really want to. Just install the php CLI. You can even do a gui for your desktop app in php: http://gtk.php.net/

EDIT: I'm not sure how easily you can call win32 api functions from PHP, however. There look to be a few articles about this online and a SO question: How to call winapi functions from PHP?

Community
  • 1
  • 1
Matt Wonlaw
  • 12,146
  • 5
  • 42
  • 44
1

I would vote for Python using the included TkInter module for GUI. Dead simple to use. Widgets aren't the prettiest looking, but development is rapid.

EDIT: I mistook "non-OO" in the question for "OO". Python is most definitely not "non-OO", but but is very well suited to doing what you asked.

Michael Berkowski
  • 267,341
  • 46
  • 444
  • 390
  • Or PyQt4. I found it to be a bit more well-documented and intuitive. – Blender Apr 14 '11 at 18:07
  • @Blender I haven't tried PyQt4. Just suggested tkinter because it ships with Python. Qt is definitely a much nicer-looking widget set and I've heard many great things about the quality & consistency of the framework. – Michael Berkowski Apr 14 '11 at 18:11
  • It's a pain to install, however. I'm lucky to have a package manager, but those Windows users are baffled by the 80mb file they have to download. Maybe WxWidgets would work too? – Blender Apr 14 '11 at 18:14
  • Will I have to get my head around polymorphism and all these other OO terms if I'm to get into Python, or can I just use it as I use PHP now - just creating functions etc? – Jack Shepherd Apr 14 '11 at 18:21
  • @Jack Shepherd I've never worried about polymorphism with python in the least. You can write your own code in a strictly procedural way, only needing OO when calling python class methods (like `string.split()`. Unlike something like Java, you are not required to write your own OO code. – Michael Berkowski Apr 14 '11 at 18:51
1

You could write this in pretty much any mainstream language supported by Windows. C or C++ are obvious choices. C# and Visual Basic .NET are going to require the .NET Framework ... not a bad thing, but perhaps more than you want to tackle for a simple project. Come to think of it, you might be able to do this with JScript or VBScript, although I'm not clear on what API functions you have easy access to. And I have to believe that it's possible to do with PowerShell with just a little work.

Your options are wide open.

Jim Mischel
  • 131,090
  • 20
  • 188
  • 351
0

F#

It's an awesome piece of work, has access to the Framework class libraries, supports GUI development, really easy parallel programming, compiles to IL (same as C#) but has a really concise functional syntax.

flesh
  • 23,725
  • 24
  • 80
  • 97