c#Comprehensive tutorial for beginners on how to write Windows GUI programs

I'm trying to learn how to write Windows GUI* programs in C++, using Visual Studio 2008, but I haven't found any more comprehensive tutorial for beginners.

The more comprehensive tutorials I have found are either only about how to make buttons, menus, etc. OR only about how to write basic C++ console programs.

What I haven't found is a more comprehensive tutorial for beginners on how to combine buttons, menus, etc. with C++ code.

In other words, I'm looking for answers to the question: How do I link menus, buttons etc. to C++ code?

If you know where I can find answers to that question, post them here, please!

Note: "Graphical User Interface (GUI): Includes such things as icons, panels, and interactive windows, to enable users to perform such actions as opening files and creating applications with the click of the mouse" (intoweb.co.za/et-linux-tips.html).

I'm currently reading a C# tutorial at techotopia.com, that seems to include not only C# basics but also useful information on how to use C# to get buttons, menus. etc. to actually do something. I only started reading the tutorial, though, so how useful it actually is I don't know yet.

I've now finished reading the C# tutorial at techotopia.com and learned some basic facts about how to actually make controls on a windows form do something. Had I known what I now know about C# earlier, I most likely would have chosen to learn that language before I started learning C++.

It's beyond me why each and every C++ GUI programs tutorial for beginners aren't written in the same style as the tutorials at techotopia.com. I see no reason why C++ GUI programs tutorials for beginners can't be both crammed with basic facts AND explain even the simplest things to people like me, that need such explanations to understand a new subject. Well, there probably are such tuturials, only I haven't found them.

Now is the time, I think, to make a short list of what steps I have taken to get where I am today when it comes to computer skills in general and ability to write computer programs in particular. I'm posting the list here for the benefit of people who wants to become good at writing computer programs but don't know how to reach that goal or have mislead themselves, as I have time and time again. It's not a final list in any way. It's just a short account of what have worked for me.

Step 1. Use lots of computer programs (word processors, image editors and what else you're interested in) to see what can be done with a computer.

Step 2. Write web pages with HTML and CSS. HTML, Hypertext Markupup Language, are used to tell browsers things like the beginning and end of paragraphs, the structure of tables and where to include images. CSS, Cascading Style Sheets, are used to add things like text-size and background-color to web pages.

Step 3. Improve your web pages with PHP. PHP, Hypertext Preprocessor, reminds of C# and C++ and is a server-side scripting language. Server-side means that something is done to a web page before it is sent to a visitor's browser, like adding code that makes it possible to send a message. PHP is easier for a beginner than C# and C++. Also, if you have written some HTML pages, you can gradually add PHP to these pages. In other words, you can learn how to use PHP in a familiar context.

Step 4. Learn C#. Reminds of PHP and C++. More difficult for a beginner than PHP but easier than C++. This is where I am right now. These links may be of at least some use:

Step 5. Learn C++. Reminds of PHP and C#. More difficult for a beginner than PHP and C#. Allows the programmer to control more than C#. Some people say it's faster than C#, while other people don't. This is where I hopefully will be within a year or so.

Since there are as many roads as there are budding programmers, these steps may not be right for you. Hopefully, though, the list above is of at least some assistence to you when you decide what steps to take to reach your goal.

If you know more about programming than I do and disagree with the list above, feel free to provide your own list. If you do, I think you should also explain why you think your list is better.

Charles Petzold wrote a book on that.

I haven't read it, but his Win32 UI book is widely known as hilarious, so it is expected to be good for beginners.

As you can probably already tell from other answers and comments, the term "Windows Forms" is the name for a specific .NET technology.

You seem to want to ask a question more along line of how to learn to write Windows programs that have a GUI (menus, buttons, windows, etc).

There is no single way to write a Windows program. C++ itself doesn't know anything about Windows. Instead you will end up using some API or framework. So what you need to do is choose which particular one you want to use and then learn that.

  • At the lowest level there is the raw
    Windows API. However it is a very
    C-like interface and few people would
    recommend starting there.
  • Microsoft's C++ based framework for building Windows programs is MFC (Microsoft Foundation Classes). It was created long before .NET and C++/CLI and such. Being so old, there are aspects of it that haven't been able to change to keep with the times and so some people don't like it. But it's still supported and used. In fact, if you have a full version (not an express version) of Visual Studio then you already have MFC available.
  • There are various other C++ frameworks that have come along more recently. Qt and WxWidgets are a couple of the bigger names. Many of these not only give you a way to create Windows programs, but also try to abstract away all the OS-specific details so that your code can be compiled to work on other OS's (like Linux or Mac) too. In my opinion, these are often more pleasant to work with than MFC once you learn how.
  • Even though its not what you're asking for, many people would actually recommend using C# and .NET for making GUI programs in Windows. There are some nice aspects of that language and framework that make GUI programming easier.

So you probably need to do a little investigation to determine what technology you actually want to learn and use. Then you can go searching for appropriate tutorials.

A somewhat old thread but here's what could arguably be the updated Petzold replacement:
"Windows System Programming (4th Edition) (Addison-Wesley Microsoft Technology Series)"

Related Articles
  • i have a lot of interest in programming, particularly creating gui programs. i have done some searches on the web and know that i need some libraries(qt for example) in order to create the gui interface, which i have no problem with. my question is t
  • This is a recursive function that works fine. It sums up all things in a vector. The specs for the driver are: Create a driver function to call the recursive function; the driver function returns the value returned by the recursive function. The driv
  • Hello all I'm a C++/Java developer and have no idea about .net or GUIs. I need to develop a windows app for 2000/XP/Vista/7. I think I've come to conclusion that C# is the best and the fastest way to go (please correct me if I'm wrong). What do you r
  • Is there any good tutorial for learn how to use Class Based Generics Views in Django? I think that the documentation is not quite good and i'm a little bit lost when i try to do not usual things with the ListView, DetailView, CreateView, UpdateView a
  • Possible Duplicate: Functional approach to basic array construction I am new to js. I just want to know which one is the right approach. Below I have posted my code. var doubles = (i*20 for (i in it)); var doubles ={i*20 for (i in it)}; Thanks You sh
  • My son asked if there was an easy language to pick up and do some foundational programming with. I thought QuickBasic at first, but then thought I should just show him VB. I downloaded Visual Basic Express 2008, but I am completely lost. Where is the
  • I can't seem to find any concise and precise tutorial for WordNet's C API. Has anyone of you used it and can guide? Have you tried http://code.google.com/p/wordnet-blast/ ? From the google code site: DEPENDENCIES: boost 1.46+ INSTALL: cmake CMakeList
  • I'm looking for simple beginner's tutorial for CUDA with OpenGL, and how to set the CUDA environment on Ubuntu. For setting the CUDA dev tools: http://lifeofaprogrammergeek.blogspot.com/2008/05/cuda-development-in-ubuntu.html The official documentati
  • Photoshop for Beginners Course
    Staring Tuesdady Sept 29th (7pm - 9.30pm) a new six week workshop for beginners & artists at The Lawrence art studio in Hove. If you're a Small Business, Event promoter, DJ, Music producer or Artist that wants to create your own artwork or promotiona
You Might Also Like