PDA

View Full Version : Best way to write a self executable .exe program for Windows?


skcin7
08-03-2010, 11:10 AM
Hi. This is a general programming question. So far I have been doing a lot of programming but I have no idea how to make a self executing .exe file that would run on an operating system such as Windows. I have a little bit of experience with layout managers in Java and I have been able to make some pretty cool programs that had GUIs (basic sound player, basic image editor, etc) but it would not compile into a .exe file for some reason. I have the feeling that even if it could compile, it would not be as efficient as if it were written in another language such as C++. What is the most efficient language to write programs such as this in? Does anybody have any example source code (even if it's just Hello World) that they could share to help get me started? I would like to be able to develop my own basic self-executing text editor. Plus I am sure the experience would be invaluable. Thanks in advance!

abduraooft
08-03-2010, 12:21 PM
I would like to be able to develop my own basic self-executing text editor. What's that?

Spookster
08-03-2010, 03:26 PM
What's that?

A text editor that is contemplating suicide?

skcin7
08-04-2010, 12:34 AM
LOL. No. I meant like a simple text editor that can execute in an OS like Windows. Like Notepad except my own. Mostly I want to do it for experience.

Spookster
08-04-2010, 02:23 AM
Unless you want to create an application that just uses the command line prompt you would need to choose what graphics toolkit you are going to use in order to create a GUI based application. Qt is an example of one toolkit you might use.

iamscottj
08-04-2010, 05:57 AM
I would suggest creating one using Visual C#. Its very easy to do it in it. It has inbuilt controls which will certainly help you in creating a text editor. Beware thought this will only work on Windows OS.

skcin7
08-11-2010, 02:32 AM
Ok thank you for all of your replies so far. Does anybody know how to do it in C++?

ghell
08-14-2010, 09:57 PM
as iamscottj suggested, C# would create an exe (though not native; for most users, for all intents and purposes, it's the same) and would be incredibly easy to write a text editor in.


Unless you want to create an application that just uses the command line prompt you would need to choose what graphics toolkit you are going to use in order to create a GUI based application. Qt is an example of one toolkit you might use.
No you don't. On Windows, you can create a GUI with the basic Win32 API functions or if you're using C++ rather than C you could also use MFC.

There are lots of "guides" and "tutorials" and examples on the web for how to write a GUI with Win32, using a WNDCLASS structure and a WndProc callback. You can probably even find some reasonable examples on MSDN.

Likewise, there are plenty for MFC (http://www.google.co.uk/search?sourceid=chrome&ie=UTF-8&q=mfc+example)

Spookster
08-14-2010, 10:06 PM
as iamscottj suggested, C# would create an exe (though not native; for most users, for all intents and purposes, it's the same) and would be incredibly easy to write a text editor in.



No you don't. On Windows, you can create a GUI with the basic Win32 API functions or if you're using C++ rather than C you could also use MFC.

There are lots of "guides" and "tutorials" and examples on the web for how to write a GUI with Win32, using a WNDCLASS structure and a WndProc callback. You can probably even find some reasonable examples on MSDN.

Likewise, there are plenty for MFC (http://www.google.co.uk/search?sourceid=chrome&ie=UTF-8&q=mfc+example)

yes you do. MFC is still just an application framework like Qt or any others. My point was that they need to select what graphical interface they want to work with if they want a GUI beyond a command prompt window.

ghell
08-15-2010, 01:29 AM
Somewhat a matter of semantics but CreateWindow (http://msdn.microsoft.com/en-us/library/ms632679(VS.85).aspx) is as much a "graphics toolkit" as CreateFile (http://msdn.microsoft.com/en-us/library/aa363858(VS.85).aspx).