Want to learn Windows Programming,some suggestions? [closed] - windows

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
Someone told me to use MFC,but it seems that MFC will be dead,although its not already...
so if i want to learn windows programming now, which one should i choose? thx.

I encourage you to learn C#, personally is one of the best programming languages for windows nowadays (personal opinion)

If you want to go to the raw Win32API (Which I think you will learn the most and a must-have for your bookshelf)... Charles Petzold's Bible is a must-have... MFC, ATL, C# Winforms are all basically wrappers for the true API architecture using nice properties/events....

If you really want to learn windows programming, start with Petzold's Programming Windows book. You'll get a good understanding of how Windows actually works, which is invaluable when dealing with the more abstracted frameworks.
Then skip over to Windows Forms or WPF. MFC isn't worth the headache.

If you are going to program at the windows api level, you would be better off using something like Qt.

learn plain win32 API not waste your time on MFC ... that is my opinion

I'm with Andres on this one, learn C#.
Additionally you might consider working with java some. There is a huge knowledge base there and in my experience it and C# cross over a lot in syntax and form.
If you are looking for problems consider Project Euler or Programming Praxis

If your goal is to learn the Windows API, MFC isn't a bad place to start. It's a really thin wrapper around the API, nearly transparent in most cases. Perhaps the biggest difference is in the message handling mechanism. In MFC you use macros to generate a table of message handling functions, and many messages get rerouted automatically from parent to child or vice versa. In a raw API program you'll typically see a message loop with a huge switch statement, and it all gets handled in one place.

Depends on the type of application you want to create? The latest forms-based programming is WPF... that is the latest and greatest, but Windows Forms programming is also an option too (there's a lot leveraged in this still).
HTH.

Depends, like everything in the IT world depends of what you need.
But C# or Java is a good start!.

WPF or WinForms with C#.
With WPF you can create very flexible GUIs, WinForms is more traditional.
Try Expression Blend for creating GUI (WPF) and Visual Studio for coding :)

Well it depends on what you want to do. Are you new to programming in general? If so then I would suggest picking up a good programming book or going to a college and enrolling in a CS degree program.
If you already know how to program and just want to write windows programs you have several options. Which one you pick depends on what you want to do and who your target audience is.
Win32 API - The lowest level you can get. It's OLD OLD OLD school C code, but you can write small fast good looking programs. You have to do pretty much everything yourself. The Win32 API is pretty complicated and you have to know the ins and outs to write the best code possible.
MFC (Microsoft Foundation Classes) - Takes the Win32 API and encapsulates it in C++ classes. It's again OLD OLD school but has recently been upgraded from MS with the new 2008 feature pack so it's far from dead.
.NET (C#, VB) - The brand spanking new stuff from MS. It's incredibly easy to write code and create programs. However it does hide all the lower level stuff from you so you just write C# or whatever and it always works.
And of course you can always write in Delphi, Qt, WxWidgets but these are simply wrappers for the win32 API.
As far as my personal choice goes it depends on what I'm doing. At my job I write C# because the hardware/software is under my control. I know what version of the framework is going to be installed, how much RAM, hard disk space, etc. For my own projects I create I almost always use MFC. It hides the nastiness of the Win32 API and gives me C++ power. Would I prefer to make everything .net, absolutely but I've found not a lot of people have the .net framework installed so I was severely limiting my user base.

Related

How to start programming in Windows? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I've made simple programs in C and C++ with simple compilers (learned it in university; I'm Statistics student). Also I'm amateur PHP programer.
Now I want to start programming for Windows.
apps with user interface
apps without user interface
My aim is just to see how it is done. And I might make a basic app that interacts with a database which is in a web server.
Where should I start? Windows Visual Studio? .NET? What should I know?
If you actually want to learn the underlying API then you should start off without one of the frameworks.
Learn it the way we did it all those years ago with Charles Petzold's book, Programming Windows. A really good foundation of knowledge of how windows and messages work will serve you well.
In the longer term, a good framework, e.g. WinForms, Qt, VCL etc. will increase productivity. But if you start with one of them, then you are in danger of not knowing the difference between sent and queued messages, not knowing the difference between an HWND, an HDC and a HANDLE, and so on.
A good framework, is great, but you'll get more out of it if you understand what's underneath it.
See this question:
C# GUI programming for beginners: Where to start?
Especially this answer there.
I think you should start with Windows Form, WPF is the new thing for Windows Dev and its getting all the lime light, but I would really not recommend starting off with it.
Get Visual Studio 2010 Express
See this MSDN page on Windows Forms
Programming Windows Forms by Charles Petzold is nice book (Charles is very cool) , windows forms hasn't changed all too much since Visual 2005, you should learn C# 4, the latest language.
Visual C# 2010 Step by Step is a good book to get a gist of the .NET world and all your options (including WPF)
See these SO questions:
Beginners book for .NET and C#?
https://stackoverflow.com/questions/4807574/best-c-programing-books-for-absolute-beginner-or-someone-just-starting-with-net
https://stackoverflow.com/questions/52926/beginning-c
Hope that helps.
Update
Incase you were thinking of going with C or C++ for windows development, is it not easy. I've done some Win32 API and believe me you'll be writing seriously long/complicated programs for even simple things
You have two MS options, you can just use the C or C++ language and call the Win32 API functions.
This book is the Bible for that.
The other MS option is using MFC, people have some rather strong (bad) views about MFC. I haven't done much of it myself so can't say too much.
See : https://stackoverflow.com/questions/557114/stick-with-mfc-or-go-to-net
There are of course tons of non-MS options, which again I wouldn't recommend.
See : Native Windows Application Development Options
Bottom line, in my opinion, C# is a very well done language, you will get TONs of support here, Visual Studio is one of the best tools around, and you will have fun learning C#/.NET, and the biggest advantage is you can use your C# knowledge to write even Web Apps, Cloud and Mobile apps and lots more.
I'm not sure why people don't use cross-platform GUI toolkits more often. I tend to write my GUI in Java, and transfer control over to C++ for the actual program logic. If you know about the MVC architectural pattern, you can use Java to implement the view and controller, and C++ to implement the view. If the program is simple and performance isn't critical, then I often code everything directly in Java. I've listed a few pros of cons of using Java for coding UI instead to other languages below.
Pros
Java already has a large library full of useful utilities, and is a good starting point from which one may learn other languages. There's many well-tested Swing components that are ready to use, and tutorials online that give you good starting points for many common use cases.
Check out the JogAmp website, and try out their demos. I prefer using C/C++ to do the rendering and Java only for the user-interface, but if performance is not critical, the JogAmp APIs a lot of flexibility in terms of controlling which subset of OpenGL you would like to use.
Java has extensive support for databases and servlets - check out the JDBC API.
Java is open-source, and does not restrict you to using a particular IDE (or operating system!).
Java comes with a builtin documentation generator called Javadoc, and it works really well. In fact, documentation for the JDK is generated using it.
Cons
Java is an interpreted language, so performance will typically be worse than that of other compiled languages.
Java forces you to frame your entire program logic using objected-oriented principles, even when they aren't a good fit for your particular use case (e.g. simple, one-off experiments). Sometimes your code can end up being much more verbose than it needs to be in order to accomplish a particular task.
Edit: There are plenty of resources for beginners, such as this one.
I'm going to go out on a limb and recommend C# using Visual Studio 2010 C# Express. It keeps you familiar with the C/C++ style your probably familiar with.
There are various sample codes available for download. I found them very helpful when I was starting to learn to program for windows phone.
Visual Studio works great for C#. You should probably consider creating an account with microsoft whether via outlook.com if you plan on publishing what you develop.
If you want to develop for windows 8, I would advise that you install windows 8 and develop using that.
I think you can start with C#.net and then ASP.net

Is Visual Basic 6 still widely used? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
Are there still enough VB6 shops to make learning the language worthwhile?
I work for a fortune 25 company and we have a few legacy apps there were written in VB6. However all new development (in the Windows world) is strictly .NET. I would suggest learning VB.NET if you're interested in learning VB.
Computing languages don't die easily, and there are always niche markets where those skills are needed. Languages like Smalltalk, Lisp, COBOL, etc. have there loyal followers and clients that need those abilities. There will probably be some need for VB6 for a while yet.
The chief difference between VB6 and the other languages I mentioned is that the newer version of VB (VB.Net) has been declared by Microsoft to replace VB6. That tells me that VB6 will have a shrinking market as newer versions of Windows makes it near impossible to have VB6 apps that look like current modern applications.
My advice is: if you have a current need for VB6, like maintaining a legacy application, by all means learn it. The more useful you are to a company, the longer they'll keep you. If you don't have a current need for VB6 then learn the newer version of the technology. In the Microsoft world, the .NET CLR based languages are the current vision of the future. You'll also have more success finding help for problems you're facing day to day.
I do not think it is worth to learn VB6.
I work for company where main product is written in VB6 and know one another company where main product is written in VB6 too.
In both cases:
All new products/development is done in .NET (mainly VB.NET to keep syntax similar).
None of developers know VB6 when joined company.
In other words:
VB6 is probably still widely used, but companies migrate to VB.NET. Moreover VB6 is so easy to learn that you can start using it really fast with no previous experience.
I also work an Fortune 25 company with a world-wide presence and many legacy VB6 apps are still widely used through the company. Myself, I am a .NET developer and only learn as much VB6 as I need to fix a production issue or to convert something to .NET (typically C#). So no, don't invest time in learning it unless you must on the job.
I don't use vb too often - I know a lot of larger businesses (Insurance, IT you name it) who do use VB functions so managers can input data into their DB's through some kind of 'Excel' sheet.
Learning any language is worthwhile! VB is easy to understand and M$ has many libraries that are easy to use (i.e. look at connecting to Databases/creating Forms... if you're interested in what real world applications are built on it).
I've used it once for the SOAP api (very easy), and some other applications. I thought it was nice enough.
There are still companies using VB6. Where I'm active for example. But we're migrating to .NET. (the sooner the better in my opinion)
So, as mentioned by aioobe, why would you want to learn VB6? I'd say it's a waste of time and I would spend my time in, for example, VB.NET.
Unless you have a really good argument for VB6 ofcourse.
I wouldnt waste my time learning VB6. I worked with it 10 years ago and I'm still thankful everytime I look at my CV that I had the opportunity to start working in C#.NET. VB6 felt like a mickey mouse language.
You might do a search on indeed.com for "VB6" and draw your own conclusions. I find about 900 jobs there as opposed to 112,000 jobs on a search for ".net".
Google
VB6 - About 5,080,000 Results
Visual Basic 6 - About 33,700,000
Results
VB.NET - About 35,200,000 Results
Visual Basic .NET - About 20,800,000
Results
StackOverFlow
vb6 - 1920
VB6 applications are probably still used quite a lot but I believe for new development over the years VB6 has been chosen less and less as a primary platform to develop an application with people opting for .NET alternatives.
In terms of learning it, I would only do this is you need to work with old VB6 applications that will not be upgraded to .NET, or if you are upgrading VB6 applications to .NET then by all means learn it but dont waste to much time on it.
I would hazard an educated guess, based on my own experience, that there are many more programmers writing new COBOL programs than new VB6 programs. VB6 is ten years replaced and, as far as I can tell, no longer supported in any way by Microsoft.
There are still products around that are written in it (I have two myself) but Microsoft have meant to have said that Windows 8 will not work with VB6 programs, also Visual Studio 6 (required to build VB6 projects) does not easily run on Vista and Win7.
VBA is very similar in syntax and it looks like this will be supported for the next few years at least.
My advice: learn VBA if you need it, but only learn VB6 if you have a maintenance project that requires it. If you really want to learn BASIC then go for VB.NET. It is difficult to suggest other alternatives (there are lots!) unless we know about what you want to learn and why. Eg. If you wanted to learn about OOP then I think C# or Java would be better.

What are the disadvantages of using Visual Basic 6? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I hear that Visual Basic 6 is not good.
I want to make very generic program. Would Visual Basic 6 suffice?
The very first reason is that Microsoft no longer offers support for VB6 development. This product is end of life.
http://support.microsoft.com/lifecycle/?p1=2971
http://msdn.microsoft.com/en-us/vstudio/ms788708
It worked well in its time, but it doesn't have a simple path forward. If you want to migrate to a newer version of Visual Basic, it can be a fair bit of work. And no new tools are being developed for it.
If your major interest is in a cheap VB development environment, as previously mentioned, the Visual Studio Express editions are free from Microsoft.
I can't think of many good reasons to use VB6 instead of one of the express versions. Also as previously noted whatever VB skills you learn won't be particularly portable and the apps you build won't be able easily to migrate to more up-to-date environments.
I will also have a look at Real Basic. It is a cross-compiler and your applications will run on different platforms. There are many options available in the market. It all depends on what your definition of "generic program" is.
Real Basic
I have ever listen bad comments about Visual Basic 6 programming, I have written thousands of VB6 lines of code, in the same manner I have written code in object oriented languages (C++, C#, Java). But It seems to me that VB6 is a very good programming language, because it allows you to write powerful-simple applications. VB6 syntax is easier that C/C++ syntax but C#/Java aren't so much difficult that VB6. Also developing enterprise application is such new languages (Java, C#, VB.Net, Rubby) is easier that VB6 because they rely on Frameworks, every body can write C#/Java code that function, but it requires, tricks, good practices and some of imagination to write VB6 strong and rehusable code.
Many developers become quickly frustrating by using VB6 and then are happy programmers using C#/Java. All depends on practices and discipline there is no bad language, each language was designed with some purposes on mind, by selecting the appropriate language, problems solving could be easier.
Forget VB6. It's a dead system. No support, no future. Use the Visual Basic Express Edition, as suggested above. It's free, useful, and about as "generic" as it gets anymore.
Or, you could use something even better: Python (www.python.org). Or IronPython. (www.codeplex.com/IronPython).
Much better system.
If you are approaching the programming world, and you want to do some programs, Visual Basic is more than sufficient.
Once you learned it, you will keep to use it.
As Visual Basic Express (which is the version that was before called Visual Basic .NET) is given free from Microsoft, maybe you could be interested in that.
Depending on what you mean by "Generic Programs" there are plenty of other environments/languages that you can create simple apps with, even at no cost.
Visual Basic is old and no longer supported by Microsoft, sounds like you may just have access to a copy.
Yes you certainly can create generic programs with it, but where do you go from there? Is this hobby programming?
I'd say VB6 is still ok for (throw away) prototyping and probably better than VB.NET in that regard. A larger problem is the lack of true inheritance and being able to use the idioms available in .NET. As such it makes writing clean and maintainable code more difficult.
even bill gates wont suggest you to use it!! they stopped its support to make migration to newer versions faster. So now dont go and start a new project in a dead language. also there is no backward compatibility.
Like others have said, Microsoft's support for VB6 has been discontinued. But no company "supports" C, so I would say that's not really a reason inherent to the language.
Another reason is support for objected oriented programming, which may or may not be important to you. To me, it is.
VB6 is handicapped in this area. It doesn't really support interfaces. Also, arrays are some pain to work with. Checking whether an array has been properly intialized (a fairely trivial task, imho) involves some workarounds. It's not as simple as
If myArray Is Not Nothing Then ...
If you already know some Visual Basic syntax, then switching to VB.NET shouldn't be hard. You'll just have learn your way around the framework class library.
If someone tell you for any language the it's "not good" then just erase this person from your contact list.
There no good/bad languages. Horses for the courses.
As for disadvantages - you'll find such in any language.
vb 6 is very good to approach the programmation with object and to know basic structure of programming . If you understand one language you CAN know the other. Is not important only the programm language, but the FLOW of data.
Check out Xojo as a modern replacement for Visual Basic. It is as easy to use as VB6, but also build cross-platform desktop apps, web apps and iOS apps.
As far as beginner programming is concerned, I suggest to start playing around with VB6, for its BASIC programming style, GUI that is not so complicated, and a bunch of code is available online. I myself start coding using VB6.
But honest advice, if you want to find a job, start learning C++, C#, JAVA, HTML, PHP, and better yet, ANDROID DEVELOPMENT.
Even if VB6 is not suitable for our life today, you can still stick to its new generation: VISUAL STUDIO - which offers a more complex GUI, yet more flexible platform. It offers VB.NET, C# and creates your own Database with powerful connection.
Just want to thank VB6 for teaching me how to code!

Is Learning the win32 API Worthwhile? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I was certain that somebody would have specifically asked this question, but from what I can see no-one has (there's been a question about learning win32 but that doesn't cover whether it's worthwhile doing so).
I am very interested in gaining a deeper understanding of all the systems I use (I mostly program in C#, at least professionally), so I wondered, very simply - is learning win32 worthwhile, or is it overkill? Am I wasting my time? Is the knowledge I'd gain worth the effort?
Similar / related questions on StackOverflow:
Does it still make sense to learn low level WinAPI programming?
How relevant is Win32 programming to modern professionals?
Having a working knowledge of how Win32 works at the lowest level will certainly be invaluable if you are planning on doing Windows development in the future. It gives you a level of insight into things like Windows, Messaging and GDI that are hidden by the time you get to the level of .NET.
I wouldn't recommend you try and use Win32 for writing all your applications, but I feel that any Windows developer would benefit from writing a simple Win32 application using C/C++.
This is less true for things like WPF where there is less dependency on Win32, but just knowing how Win32 works will help you understand or appreciate some of the design decisions in WPF.
I advocate learning the concepts behind low level windows programming if all of the following are true.
You are going to do any windows programming.
You want to be the "go to" guy when the unexplainable happens.
You love to learn.
Abstraction layers like .NET work create and allow developers to do incredible things without having to know a lot. However, when .NET is used in a way unanticipated by its authors which reveals one of its subtle bugs, then that is the time where some win32 API knowledge goes a long way.
Will you ever have to write a message pump? I doubt it. Can it help diagnose problems? You betcha!
The question is much like, "Is learning assembly worthwhile"; and the answer is the same:
"Yes, because you will understand the fundamentals, and be able to perceive deeper than those who only work at the top level of abstraction".
However, by the same token, you probably won't be writing Win32 API directly 99.5% of the time.
When they invented C to replace assembly language, people where probably asking: "is it worthwhile to learn assembly language?" The value in knowing both was being able to drop to assembly to do the things which were impossible to accomplish in C (eg. trigger an interrupt).
The same can be said for Win32. There are some things which are impossible to do in C#. If you didn't know the win32 api, then you would dismiss some things as being impossible. However, once you know what you are missing, in those rare situations, you would be able to "drop to win32" and do them.
Another way of looking at it is this: programming is all about being able to think in multiple levels of abstraction at the same time. For example, if you know your language uses immutable strings, you don't write an algorithm that adds a single character to one 10000 times, because it will be slow. If you know the win32 api, you will be able to think about how each line you write in C# is actually implemented and that will help you write better code.
At least for me, learning an API (I'm assuming that "in-depth" is implied) that I don't use is a waste of time. I'd rather spend my limited amount of time and brain power learning new concepts or exploring new tools than becoming intimately familiar with an existing tool that I don't need to use now. When I need a particular tool that I don't have or have to use a tool that I'm not familiar with, that's the time to learn it in some depth. Before that I might do enough investigation to know whether it is going to be useful to me or not, but not much more.
Yes, the principles of the Win32 API are useful to learn - these principles are the foundation on which everything else is built.
The .NET APIs for GUI development, both Windows.Forms and WPF, do what they do within the constraints of what is possible on top of the Win32 API. Key architectural decisions of these frameworks were constrained and informed by the Win32 API.
On the other hand, you are less likely to get a lot of value from diving deep into the API, as there is a lot to learn, and given that you spend most of your time working in C#, you'll have less opportunity to use the knowledge directly.
BTW, the same applies to other technologies as well - like networking, cryptography and hardware design. Learning the fundamentals will help you become a better developer.
Yes, you should learn the basics of how Windows (a lot of this stuff predates Win32) operates. Why? For the same reason as I understand how a mortise and tenon joint operates, even though I don't make my own furniture, or why I understand how an internal combustion engine works even though I don't do my own car maintenance.
You work at a higher level of abstraction, which is nice, but when that abstraction leaks - that's not an "if", that's a "when" - if you don't understand the basics of Windows, you'll be lost. If you don't know at least some of the API, you won't have a clue where to look if you need to P/Invoke functionality not available in .Net.
Quite apart from that, isn't curiousity reason enough?
If you are trying to write a VB6 application then the Win32 API allows you to do a lot of things that are not natively supported by VB6.
If you're writing a C# WinForms app then I would recommend learning the vast reaches of the .NET Framework first.
Edit
If you really want to know what's going on under the hood in Windows then you might want to check out a copy of Programming Windows 3.1 by Charles Petzold.
I personally think it's still worthwhile learning the Win32 API.
As far as I recall when I started learning Win32 (after doing some VB(A), Pascal, etc.) I learned a lot about Windows and understood how thing works in Windows. Everything was so clearer. :)
So, as per your question - you will learn a lot about Windows through learning Win32.
As you said - you're a C# programmer and I'm not sure if you'll use it often, because almost everything you need is already there, in .NET.
I won't repeat over and over what the others said many times already.
Here's a link to a Win32 tutorial with which I am currently learning along the basics of Win32's. I find it pretty interesting and easy to follow.
This tutorial helps me get what I didn't understand first, back when I've begun to program in my secondary school years.
If I were to start today, I wouldn't learn the entire API. However, I do think that the basic concepts are important to understand, with an understanding of how message loops work as the top priority.
You'll never be able to just "learn" the entire win32 API, it's too much to take in, and it will be a moving target. If you develop in C#, there's no real point.
That said, try creating Notepad using plain C and just API calls. That will teach you enough for a C# developer to at least appreciate it.
A lot of the "No" answers here seem to focus on learning the actual methods, structs, and what not available in the API. I'd say yes, but focus not on the individual components of the API, but the overall design and the way it functions. It's much easier to troubleshoot even .NET code when you understand what's happening at the core level of the operating system.
This question looks a bit dated, but I'll answer anyway.
Answer: Complicated: yes. Simple: probably not necessary.
It really depends on what you need to do. If you need to use a feature not current supported by .NET, have-at-er. But be careful, most of the coddling the Framework provides Win32 does not, and if you do something incredibly stupid, your machine WILL bluescreen.
I know when .NET first came out, I had have no interest to learn Win32, .NET was here and it was such an improvement. But the sad fact about Windows is this: all new features in Windows are implemented in native code first, period. If you want to use any part of Windows before .NET wraps it, you're either using Win32 from C++ or Win32 from C# or from VB.NET. .NET is a wrapper, for all the stuff in Win32. So if you can't wait, yes, you can Interop into the lower bowels of the OS if you'd like.
Knowing Win32 and probably one day Win64 (whatever they happen to call it) will always be a useful skill. Any whizzbang technology requires underpinnings somewhere.
.NET is implemented using win32 api, anyone wishing to possess deeper understanding of .NET would greatly benefit from having at least marginal knowlege of win32api.
In your career it will be unlikely that you will only be creating greenfield applications where you will have the freedom to choose the technology and programming languages used.
Sooner or later you will have to integrate with old code written in Win32 and C/C++. In that case, knowledge of Win32 will help, especially if you are integrating using PInvoke or C++/CLI.
Misuse the .NET framework and Win32 and your machine will blue screen? Somehow I doubt that.
The biggest value to knowing Win32 (or assembly language) is that when something doesn't work as expected and you have to debug it. The more you know about the underlying system, the easier time you will have debugging the problem.
I like to further add to this. I never formally studied Win32 API/MFC. I started using Visual C++ 4 when I first got interested in GUI programming. Anyway, I wish I kept that foundation then, as I never caught on quick enough (I was rather young then, actually), so I studied Visual Basic instead.
For some reason, Delphi never interested me even though I knew Pascal well enough, but I digress. These days, I work in IT and develop installer scripts in NSIS - and every so often I need additional functionality that NSIS doesn't provide, so I make my own plugin and to keep it quick and dependency free, I opt for Win32 API opposed to MFC or even full blown C++.
The main reason for this comment, is that my own curiosity got me hooked. I like to know more, so where is the best resource for learning the API. A book? Website?
Would MFC still be worth tackling as well? I did see a website about a fellow that develops Win32 GUI apps, in assembly! I think that is overkill, honestly, but it is compact, fast code, interesting, the concept, but I never was able to get the hang of 80x86 assembly (hell, even RISC assembly in college I never was able to do!)
I think it's always interesting to know how a system works if your work relies on it. I don't mean you should learn every bit of it, but still get a good understanding, at least to be able to search more by yourself the day you will have to.
Software is not magic - well... ok... for 99% of the cases :-)
Here is a link to an excellent article about "magical thinking" and "GUID goblins" from Eric Lippert's about that subject: It's not Magic

Where is a good place to start programming GUIs for windows? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
I have experience writing console and network client/server applications in C and C++, but I know next to nothing about using the win32 visual API, MFC, Qt, wxWidgets, etc. Where is a good place to start, and what method should I specialize in, so as to be future ready and robust?
This is a rather broad question, as programming GUI applications in Windows can be done in so many ways.
There are two main parts to developing any GUI app: the language and the API/framework. Considering you're interested in learning to build Windows GUI apps, the language isn't really a point of focus for you. Hence, you should pick a language you already know and work with a framework or API that can be harnessed by your chosen language.
If you want to use C you're pretty much restricted to dealing with the Win32 API yourself, in which case reading Petzold or Richter would be great places to start. The Win32 API can be quite daunting, but it's well worth the effort to learn (imho). There are plenty of tutorials on Win32 on the web, and there's always MSDN, with a complete reference/guide to the Win32 API. Make sure you cover not just the API, but other areas such as resources/dialogs as they are building blocks for your Win32 application.
If you want to use C++ you have all of the options that you have when using C plus a few others. I'd recommend going with the Win32 API directly, and then moving on to a known framework such as MFC, Qt, wxWindows or GTK so that you can spend less time working with boilerplate code and instead focus on writing your application logic. The last 3 options I just listed have the added benefit of being cross-platform, so you don't have to worry too much about platform-specific issues. Given that you said you want to work with Windows, I'll assume you're keen to focus on that rather than cross-platform -- so go with MFC, but spend some time with the Win32 API first to get familiar with some of the concepts.
When dealing with MFC and the Win32 API, it's a good idea to try and get a solid understanding of the terminology prior to writing code. For example, you need to understand what the message pump is, and how it works. You need to know about concepts such as "owner-drawn controls", and subclassing. When you understand these things (and more), you'll find it easier to work with MFC because it uses similar terminology in its class interfaces (eg. you need to know what "translate messages" means before you can understand how and when to use PreTranslateMessage).
You could also use Managed C++ to write .NET GUI applications, but I've read in a few places that Managed C++ wasn't really intended to be used in this manner. Instead it should be used as a gateway between native/unmanaged code and managed code. If you're using .NET it's best to use a .NET language such as VB.NET or C# to build your GUIs.
So if you are going to use .NET, you currently have the choice of the WinForms library, or WPF. I personally feel that you'd be wasting time learning to build WinForms applications given that WPF is designed to replace it. Over time WPF will become more prevelant and Winforms will most likely die off. WPF has a much richer API set, and doesn't suffer from many of the limitations that Winforms does. If you do choose this route, however, you'll no doubt have to learn XAML, which is a markup language that drives WPF applications. This technology is coming of age, and there are many great places to learn about it. First, there are sites such as LearnWPF, and DrWPF which have some really great articles. Secondly, there are plenty of quality books on the topic.
So, to sum up, once you've picked your language and tech, the path is actually quite easy. Just pick up a book or two, read some blogs, get into some code samples.. and most importantly ... write code. Keep writing, keep making mistakes, and keep learning from them.
As a final note...
In other words, Silverlight. If you don't want to go the MS route you might give Adobe's Flash/Flex a look see. Both Silverlight and Flash/Flex build RIA's. Which I think is where we are headed. They days of Office like apps are numbered
I don't agree at all. Silverlight is not the same as WPF. Silverlight is web-specific, and only has a subset of WPF's features. Given that the question asks for Windows GUI apps, Flash/Flex Rich Internet Apps are not really a fitting suggestion. I also don't agree that the days of Rich Client Applications (such as office) are numbered at all.
I hope that helps. Good luck :)
I don't know if I'd call it a good place to start, but if you want to be future ready, take a look at the windows presentation foundation which is built entirely for the purpose of programming GUI's for windows
My first experience writing simple GUI applications for Windows was with C# and Visual Studio. The GUI-building interface is a simple drag and drop deal that generates skeleton methods based on potential user actions. I only did fairly basic programming with this, but I imagine it would be an excellent place to start to learn the basics and extend into the more advanced capabilities as you go.
There are plenty of online Win32 tutorials:
http://www.zeusedit.com/forum/viewtopic.php?t=1218
There are plenty of compilers to choose from:
http://www.zeusedit.com/forum/viewtopic.php?t=238
I would also recommend getting the Borland Win32 SDK documentation in WinHelp file format:
http://www.zeusedit.com/forum/viewtopic.php?t=7
It only covers the bare basics of the Win32, but when starting, this can be helpful as it is less daunting and less bloated than the MSDN.
I'd never go down the Silverlight, Flash/Flex or any similar route. It does look nice, but the main problem is that the code of the engine that runs it is completely closed-box and controlled by a single company. Take, for example 64bit versions of both of those. If some new platform emerges, you won't be able to migrate your existing code to it.
For business apps, Windows Forms is very mature. It provides a gentle path from auto-generating a lot for you into allowing fine-grained control and rolling your own. There are tons of high-quality third party controls and a large body of examples, docs, etc out there. It's hard to run into a problem that someone else hasn't solved. I highly recommend acquiring some background Win32 knowledge (e.g. Petzold) as the WinForms framework lives on top of it.
I have no WPF experience, but from the sample apps I've seen it looks like a good choice for apps whose interfaces would benefit from more graphical metaphors. So if you're doing a banking app, probably not worth the extra design overhead. But if you're doing, say, a warehouse management app it could be improved by dropping pretty boxes into pretty bins.
#StephenCox: wrong answer to the wrong question. OP is asking about desktop client apps, and moreover, WPF != Silverlight.
For a simple starting point to get your head around the "event-driven" nature basically all frameworks are created around look at FLTK.
Here are some quick starting videos Link
For professional use I'd recommend Qt, expensive but often worth it in commercial situations.
Since you are already familiar with C and C++ I would recommend learning how to write a simple Windows GUI app using Charles Petzold's book. It will give you the fundamental understanding of how Windows works. It's good to understand that most everything that you see is a window (a button is a window for example) and that these windows respond to messages. I wouldnt' spend a lot of time on this though and you don't necessarily need to do this first if you are going to chose WPF. I just think it's good to have a basic understanding of this.
There was a good podcast recently on .Net Rocks called "Kate Gregory Develops in C++ for Vista!" on there she recommends that someone starting out now should not use/learn MFC (even though it has been recently updated).
As far as getting ready for the future you need to learn WPF, but it isn't complete yet, so depending on the kinds of client side apps you want to create, you will probably need to learn WinForms. The majority of people aren't using WPF yet, so it's a good time to start learning. I think you will find it easier using C# to learn it instead of doing managed code with C++.
Get your basics right first. Best tutorial I've found is: http://winprog.org/tutorial/start.html
After that, although the homepage is hatefully distasteful, the tutorial pages are good in content and aesthetics: http://www.tenouk.com/cplusmfcdotnet.html
Then of course there's MSDN.

Resources