How to Write a Windows Application? [closed] - c

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 8 years ago.
Improve this question
I'm very new to programming, and I'd like to write a Windows Application. So far I've read Teach Yourself C in 24 Hours, what should I do (tutorial to read) next to accomplish my goal? Thanks

When I first started developing applications for Windows (about 15 years ago) I recall reading some very useful stuff by Charles Petzold. His more recent books are about C#, but his older books are still relevant because the Win32 API has not changed that much when it comes to the basics.

Hello, World!
Write the famous "Hello, World" program (Google it if unsure):
To output text to the console.
To output text to a dialog window.
To make the dialog appear after selecting a menu item.
Then, if you are still keen:
Write a program that allows a person to type in text into a text field. Display that text in a dialog window after clicking a button.
Save the text to a file.
Write a program to read the file and display its contents in a window.
That should get you started learning the fundamentals of what is happening when writing a Windows application.
Also, read all the links that people recommend you read, in this thread and others.
Old vs. New
Advice for learning .NET, C#, and C++ is great. Those technologies hide a lot of the boring "grunt" work for you. I still feel it is good to have an understanding of what is happening at a lower level for various reasons, including:
Learning C is applicable to more than Windows-based applications (some would argue .NET and C# are portable, which is true in theory, whereas ANSI C and Java are portable in practice).
Understanding what is hidden will allow you to avoid technical blunders and diagnose deep technical issues.
At this point it really depends on your goals. If all you want to do is write a Windows application, then use modern technologies that are better suited to such a task. If you want to write a Windows application with an understanding of how to write applications in general (not necessarily just for Windows), then keep pursuing the C path for now, and branch into other technologies as you expand your knowledge.

Depends on the application. But what you need now is to familiarize yourself with an API. APIs are basically premade functions that you use as tools to do... whatever it is the API was designed to help you do. You're looking for a graphical user interface API. Windows has its own but I recommend you use something crossplatform so your application will work on multiple platforms.
Look these up on wikipedia:
GTK+
Trolltech's QT4
They can pretty much do anything the windows API can do with the added benefit of working on multiple platforms like windows, linux, mac, etc.

http://winprog.org/tutorial/
These are pretty good for learning Win32. Charles Petzold is good resource if you can get your hands on a copy but The Forger's are free and you can have them in your hot little hands right now.
In general though you should spend some time just writting C/C++ apps that use the standard libraries first. Opening files, writing output, writing files, reading/writing stdio and get a good handle on the basics of the language first.
Looking up books on data structures, and analysis of algorithms are fundemental to any type of programming you want to do as well.

Read this.
Are you suggesting that you'd like to write a Windows desktop app in C? That's reaching back a long way. You're back in 2002, according to this.
Most people writing on Windows are using .NET, which means C++ or C#.

If you need some GUI or complex features,
You need some oriented object programming skills...
You can read some of this book serie : Head first... from O'Reilly
Head first Object-Oriented Analysis and Design
Head First Software Development
Head first C# or Java (It doesn't matter which language...)
Trolltech Qt4, it's a must, too ! Thanks CptAJ
They are very nice books for beginners... and advanced programmers too ;-)
Nice reading !

I disagree with a lot of the answers here... learning from the ground up is not a bad thing.
I wouldn't go out and make a whole app in C, but certainly making a little app in C is a good way to both learn the language and to appreciate (or more likely, detest) the win32 API.
Besides, you can't really appreciate what the newer languages/frameworks do for you if you don't experience the old painful way of doing things.
That said, recognize that there are newer languages and frameworks out there and learn them as well; particularly if you're trying to land a job.

I highly recommend theForger's Win32 API Programming Tutorial. It's very concise and easy to follow, and it's free.

While I won't say you've wasted your time learning some C, I'm guessing it's not where you're going to end up either.
If you really want to get rolling, without too much trouble, I'd highly suggest getting:
Visual Studio C# Express (it's free, and it's a great development environment)
A book on C#...Petzold is great, so a book like Programming Microsoft Windows with C# is perfect.
This should get you pretty much exactly what you want. You'll have everything you need, and Petzold starts you out very simply, and ramps you up to making interesting apps without losing you.
(You may wonder why I, and many other people are directing you to C# or other languages after you specifically said that you've already read and learned about C. This is because programming in windows using the old Win32 API is much more tedious. It is easy to quickly become overwhelmed by the sheer amount of extra chaff that has to go into it.)

At Microsoft, we have been working hard to come up with some great resources for simply creating Windows applications. Our page, Start Programming with Windows 7, will be sourced with tons of new resources for intermediate and advanced programmers.
There are two really important new learning series that we have been working on:
The Hilo Project: An application built from the ground up to show how you can develop programs that are specifically taylored to Windows 7 features using the most modern programming and application design methodologies.
The Learn to Program for Windows Module: An introduction to Windows programming written by a developer education expert at Microsoft. This module sounds more like what you are looking for, I recommend you check it out.
We're working on ways to surface learning resources as best we can on the Windows Developer Center - a collection of developer learning resources for people new to developing Windows or new to developing using the latest Windows features.
Additional guidance is coming through the new Home and Hub resources for client / Desktop applications on the MSDN homepage.

Try Ramp Up's Developer Basics, a microsoft learning road that shows stpe by stpe how to start windows programming. You can use the Visual C# Express version of Visual Studio as a development enviroment.

Read this book, Learn to Program with C#.
Then, make small projects in WPF; the best WPF book is Windows Presentation Foundation Unleashed; try that after reading the C# / beginning-programming book.
C#, the .NET Framework and WPF were created to move beyond the C Win32 API, to make it easier to create Windows applications.
If you want to make a standard Windows application, follow that path.

I would suggest using VB rather than C#. The syntax is a little friendlier, and it has all equivalent features and performance.
Why not follow the MSDN tutorials? If you don't like them try googling "VB tutorial".
http://msdn.microsoft.com/en-ca/library/hewcw458.aspx
Either VB or C# has a zillion examples of everything that can be googled. I would stick to either of these languages, if only for the "google support" alone.

Related

MS SQL and my need for a little direction [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I've been lurking around for several weeks and have been totally blown away by the amount of information and how the community quickly responds. I have noticed that questions like this typically receive sarcastic remarks and sometimes get down voted. Please bear with me as I attempt my first post :)
I little background..
I work at a tiny software company as the "QA department". Our application has a MS SQL back to store customer data and short term loan information for financial service companies. I started working here 6 years ago as a gernal technician to provide support for their call center, so I've been overly exposed to SQL and have become fairly familiar with working with it. You probably wouldn't pay me to develop a enterprise level database, but at this point I've become familiar enough to do most things in SQL.
Why I'm asking my question..
I want to develop an application to store and track our software issues and new dev. I've done research on this website along with asking around and I still feel sort of lost as to which direction I should take. I want the core of the application to be pretty basic at first, to provide various screens between my entities/modules and to create reports to show their various relationships. In the future I want it to be more complex, to provide a web portal of some sort and to start getting into various complex QA software concepts. I've read around and it sounds like I might want some variation of C/VB for the windows portion, but all of the topics have sort of overwhelmed me. Do I want to start with a more basic one that was created 20 or 30 years ago? (I think that's C and C++, right?) or a more recent one like C#? Will I be able to develop a web portal with both of these? (by web portal I'm thinking it would provide access to our database of defects and have username/password sign-in). I've seen that the various .NET languages lean more towards web development, should I start with one of these?
I am at the very beginning of this and I fully understand that I'm jumping into some deep waters here. I want to make sure I don't end up spinning my wheels and that I focus my energy on something that won't end up being a bad idea in 1 or 2 years after I start. So far I've found this website very helpful, if I can pick a direction I know I won't have any problems finding what the next step is. It might help to know that I have no formal or informal programming background (if it wasn't obvious). I'm a 27yo techie who is starting his first venture into programming, go easy on me! Thanks for taking the time to read this :)
I won't recommend that you go to C, C++, or VB. C and C++ are used mainly for developement of system software, compilers, etc. VB is deprecated by now; there is a .net version VB.NET, but my preference is C#.
Looks like you are a Microsoft shop. Steer youself towards using C#. Visual Studio provides great support for development of Web Applications with support for holding state in entities backed by MS SQL.
I would start with a simple example as given in MSDN http://msdn.microsoft.com/en-us/library/dd410597.aspx.
This example uses an Model View Controller based framework that is fairly easy to configure and use. They have great examples.
There is a free framework that also supports MS SQL Entity store http://www.coderun.com/ide/
Enjoy
Don't write a line of code. There are literally hundreds of open source and commercial software packages that already do what you want to do. You'd be better of spending time researching them and finding the package that most closely meets your requirements. A good solution will also be extensible enough that you'll be able to modify it to meet all of your requirements.
Since you work for a small company I can guarantee you that using your limited development hours "writing your own" will be counterproductive. You'd be better off adopting something off the shelf and becoming proficient at it. You'll learn more about developing systems like this once you've become intimately familiar with one of them.
Check out JIRA or
http://en.wikipedia.org/wiki/Comparison_of_issue_tracking_systems for some other ideas.
For the benefit of your company I would recommend to use an existing
solution. But if you want to learn and build something of your own, I
would suggest that you check out some popular web application
frameworks, like:
Django
Ruby On Rails
Zend
Good Luck with your project!
Given that your intent is to learn and create something yourself I think you should consider a LAMP stack and PHP with one of the PHP frameworks on top (Cake PHP, code-igniter or the like).
The C++ route is a long hard way (C++ is my language of choice) to learn; as a learning experience I think you will get quicker and more satisfying results with PHP.
I also think that this is a realistic project for someone of your skills over a period of a 6 to 12 months - start with a simple requirement and then build it up to have all the features you need.
If you just want a bug tracking system obviously there are many options that won't demand any development.
How much experience do you have with things like installing Linux, Apache, Mysql, etc? If you are completely new to this, then this will be a much tougher task, because there are many layers you'll have to learn before you can even get to the point of writing an end-to-end application.
I would avoid C/C++/C# because there are a lot of things you would need to learn about basic programming before you even got to the stage where you could make database calls.
On the assumption that you don't have experience with LAMP (Linux/Apache/Mysql/(Perl/Python/PHP)), my suggestion would be to start simply, by using a scripting language like Python or Perl. You can very easily get a database connection, and start writing queries, and extracting data from there. If you are used to Windows, I would install ActivePerl or ActivePython, and start from there. You can start building a command line program that does what you want, and then from there, you can move on to creating a web application that can do something similar.
Building a web application would likely be much easier than writing a Windows application, so after you have gotten comfortable with the scripting language, that's the direction I would go afterwards.
Good luck!

MUD Programming language

I have been playing a MUD game now off and on for over a year. I have scoured the internet looking for the best computer language to learn to develop my own. So far, I have come up with nothing but C. Is C the best language to learn for this application, or is there something better?
I know SMAUG was written in C, but that was years ago. I am new to programming in general and have some experience with Python. I have been playing Aardwolf, which allows it users (after a certain level) to create their own area's. The user does this using Lua. This was interesting to me, because Lua is a "scripting" language. So this begs another question - Do you build the game's format in C (or something else) but create the world with a script?
Also, this would be a game with only my friends, so a direct connection would be required since I would not be hosting it online. So, once again, I would like to dive into this world and use this as a pet project to also help me learn a programming language... but which one would be the best that would also allow me to scale it uo in the funture
P.S. - Any open source code out there that I can look at and study?
So, once again, I would like to dive into this world and use this as a pet project to also help me learn a programming language... but which one would be the best that would also allow me to scale it uo in the future
Most MUD codebases tend to be in C, but this is mainly for historical reasons. MUDs were fairly popular a while back, and at the time, C was by far the best language for portability which was supported by most hosting options out there.
That being said, a MUD is really fairly simple, in many ways. You could easily write a MUD in any language, provided it supports sockets and text parsing. Using a language with a good string parsing and high level socket support would actually be far simpler than some of the classic MUD code bases.
There are a ton of available MUD engines available online : a quick look at MudConnector will give you a ton info of available servers, software and code bases.
As for your programming language of choice, if you intend on only making it available to you and your friends, Python would be fine - I made one entirely in Lua a few years ago and it was a breeze. It's a great learning experience !
perhaps you should look for a MUDOS
http://www.mudos.org/

Web based development for the C language [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
Improve this question
I am a C programmer and new to web development. Which web-C-technology (open source) suits me to learn quickly for web-development?
Update: my question is based on both client and server technologies.
I know this is going to sound arrogant, but instead of saying that you are ‘a C programmer’ you should say that you are ‘a programmer’ and learn some language better suited to web programming. It will be fun, you will become a better programmer and the applications are very likely to be better, too.
I know that in theory you can write a good web application in any language, but in practice there are lots of aspects that make writing in a more popular (in the ‘webapp sense’) language easier. Lots of examples, if nothing else.
You could try KORE
Kore is an easy to use web application framework for writing scalable web APIs in C.
Kore exposes an easy to use API to build your applications. Below is an example of how simple it is to get going with writing web applications in C. The code will respond to all requests with an "Hello world" response
#include <kore/kore.h>
#include <kore/http.h>
int page(struct http_request *);
int
page(struct http_request *req)
{
http_response(req, 200, "Hello world", 11);
return (KORE_RESULT_OK);
}
Kore makes it easy to get started without having to fiddle with build frameworks such as make.
Using the builtin commands you can create, compile and run Kore applications.
However if you prefer building Makefiles and linking the libraries together yourself, go for it
$ kore create myapp
$ cd myapp
$ kore run
compiling myapp.c
myapp built succesfully!
[parent]: running on https://127.0.0.1:8888
[parent]: kore is starting up
[wrk 0]: worker 0 started (cpu#0)
Source
I'm not aware of any present-day heavy use of C (not C++) for web development, much less one that could be "learned quickly". It's not the right language for the task at large, though some specific modules in a web application could certainly be written in C for performance - and even then C++ would be most likely.
On the client side, you have little choice. You need to know your way around HTML/CSS/Javascript.
On the server-side, you have a ton of options.
I was a C programmer before I got into web development, and when PHP came along, I was attracted to it because it has syntactical similarities with C, and (even better), a lot standard C library functions are there too ( sprintf, fread, etc).
PHP is also a decent place to start as it performs just fine as procedural language, and if you've never done anything remotely OO, you might find that it provides a nice way to get your feet wet.
This is not to say that PHP is the most wonderful language on the planet. There are plenty of issues. But as a "first web-oriented language" for someone coming from a heavy C background, I'm hard-pressed to think of anything significantly better.
I'm not aware of any present-day heavy use of C (not C++) for web development
While not open-source, the G-WAN Web server is the only example I know of Web development in C.
It lets you write C scripts that are run on-the-fly:
http://g-wan.com
Given your experience in C, that may help.
On the client side, you can do nothing in C. On the server side one could argue that it's still possible to create a set of cgi's in C and these cgi's together with some cleverly crafted client code (html+css+javascript) could result in a state of the art web application.
This is, however, based on my experience, a very hard road, and one that's virtually impossible to follow without having a good insight in the very special environment that a web application is. Plus, the end-result will be a Frankenstein-like beast at best. Trust me, been there done that.
My suggestion to you would be to start studying web development as such. That is, client side html+css+javascript and a server side scripting solution. You'll probably benefit from choosing a scripting solution like php, because of its syntactical proximity to C, but IMHO that's the easy part of the job. Understanding how the client side (html+css+javascript) works together to create beautiful, reliable and user friendly web applications is where you need to focus on. Because of your background in C programming, the scripting side will be easier to get started in.
Good luck!
A lot of "web programming" nowadays happens client-side. Unless you investigate (or invent) a cross-compiler from C to Javascript, you're not going to be running a lot of C code in people's browsers.
Server-side, of course, you're free to write stuff in C if you feel like it, and some people do.
Before someone comes to suggest that you use language substitute-fashionable-one, I'd like to tell you that what you need to do the web development with c is to know how to do development in c and understand the nature of protocols, markup, etc. Library needs are minimal here. And no one will tell you which one suits your needs and your perception of beauty.

Help needed in writing a GUI app in C

I want to write a standalone GUI based app for administering one of the most popular enterprise middleware products from a very big company. But that big company already has a admin tool and its free.
But guess what , its very very slow , since its written on the java/Eclipse platform.
I want to write a very fast responsive GUI tool natively for windows.
I do not have much experience programming for windows , So what library(open source preferably) i can use on windows to get the job done.
Note: I need to write it in C, Not C++ , But if i dont have any choice I guess i can do with C++.
So I basically need to write a GUI app in C with some good GUI library.
Please help me out.
Thanks.
Edit : I do not know OOP and don't prefer using it.
Edit : So my choice is down to Win32API and Qt.
my requirement is that of a simple GUI , nothing fancy. I will be using simple windows ,buttons and menus. But I may need to do some processing , which means GUI should not take up much resources.
Based on this I m thinking of using Win32 API , even if I have to take the pain to hopefully satisfy the users.
its very very slow , since its written
on the java/Eclipse platform.
Are you sure that this is the reason for the application's slowness? I am no
fan of Java, but before you reach any conclusion, have you made sure that
writing the software in c makes it noticably faster? It could be that the
application is slow for reasons that are not under the control of the GUI programmer,
such as a slow database or bad network latencies.
Also, I don't mean to be rude here, but do
I want to write a very fast responsive
GUI tool natively for windows.
and
I do not have much experience
programming for windows
not contradict each other?
If you want to write a C GUI app, stick to Win32 or GTK+.
Win32 is blazingly fast, and will let you access everything available to Windows. Take a look at this tutorial.
GTK+ is extremely easy to use, cross platform, and provides tons of extra functionality. Start by downloading the all-in-one bundle, and move onto a tutorial and the documentation.
Personally I'd recommend going straight to Python if you need quick, responsive GUIs, and just need to wrap some lower level stuff.
Why are you limiting yourself to C? Windows Forms and WPF and SIlverLight are all viable UI frameworks that are responsive and have tons of books. There's a reason you can't find much info about writing GUI apps in C - people don't do it.
For plain C, cross platform, native look, simple, scriptable UI, I suggest to have a look at IUP: http://www.tecgraf.puc-rio.br/iup/
If you really have to use C then you can use GTK+. Otherwise, I'd suggest a C++ library like QT or wxWidgets. However, that being said I still think it would be preferable to build a .NET (Windows Forms or WPF) solution. They should provide a better UI experience than Java/Swing.
If you really want to do it in C, you could use the Win32 API. But it's hell working with it. The Object Oriented variant isn't much better either, but it takes away a bit of the pain (MFC).
I strongly recommend you to use C++ with the Qt library, which is both cross-platform and open-source (LGPL). C++ Qt GUI applications are as fast as native Win32 applications, although they take more memory. And you can't even start comparing the productivity gains - Qt is a great library, terrifically designed for GUI programming with tons of other useful tools.
Most GUI toolkits are written in C++, so restricting yourself to C will limit your options somewhat. One option that is cross platform and written in C is GTK; it's originally for X, but runs on Windows as well.
edit: Of course, you could always just program directly against the Windows API (formerly know as Win32) itself. For simple GUIs, it's not too bad.
GUI components map very well into Object oriented paradigm. Using C for GUI applications is a bad idea, I've been there and it's much more confortable to do it in an propper OO fashion with C++. Of course you can sort of do OO with C but it's ugly to say the least.
In my opinion, more than the GUI frameworks you need to really work on the design of the application you building.
For a normal GUI in C/C++ Win32 provides enough of controls for a decent looking application with good response time.
What you should really focus on is how to make it multi-thread based upon the time your modules take for execution.
Consider this small example: You have a DataBase connection monitoring in your GUI which is probed every second. Another module may be sending some big files to other applications. Now if an application is single threaded, your GUI is bound to have response problem. If you database connection is very slow due to some network/db issue your app will hang irrespective of the GUI frameworks or hardware chosen, if it was a single threaded app.
But if you write a good design and dedicate a separate thread for GUI handling and other threads for handing background tasks, you will have a really good GUI response. That way you can perform other tasks in background and GUI gets updated when notification is obtained. Remember, it wont happen magically and you need to sync you threads and update GUI.
Also, avoid creating threads for each and every task. You need to check things which can take more time like sending big files or faster tasks like checking/reading if config file exists or not.
By using third party GUI frameworks you are increasing your dependencies in your application and you would require to ship additional dlls etc with you main application. With win32 things are pretty neat.

How relevant is Win32 programming to modern professionals? [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.
As a big fan of Charles Petzold's books Code and The Annotated Turing I came across his book Programming Windows which teaches Win32 programming in C. I am a freshman computer science student who learned C first, but I use C# and .NET for Windows programming now, so I was wondering if Win32 is still relevant to professional Windows programs. Would it be worth it to me, as a student who wants to program Windows applications, to learn the Win32 API to the depth that the book covers?
It really depends on the kinds of applications you want to develop. For most purposes these days, C# and .NET are completely suitable. However, there are certain kinds of applications that need as few dependencies as possible (shell extensions come to mind) that are not practical to do as .NET applications. For those you would need Win32.
As always, it pays to have at least a basic understanding of Win32 even if you're using .NET for most of your work.
I completely agree with what Joel Spolsky writes in one of his many great articles. I think it is crucial to know the lower layers of the machine not only to be able to write quality code but to be able to solve problems that will inevitably appear.
So, YES, it is important to at least know the basics of WIN32 API maybe not in depths but at least to know it's there, at the base of everything you will code.
It's very relevant if you are writing C# on Windows. Not all the features of the Win32 have been exposed via the .Net libraries. A concrete example of this is the WM_SETREDRAW message technique I describe here: WM_SETREDRAW. It's also needed at other times for control focus issues.
Also, understanding how Win32 and Windows work will give you a better understanding of various aspects of C#/.Net such as:
What does Control.Invoke() actually do?
What is the difference between Control.BeginInvoke and Control.Invoke?
What actually causes my control's events to fire, e.g. OnClick etc and how can I debug that.
That said, WPF changes all this and if you are only writing .Net 3/3.5 code then my argument loses some its relevance.
In my opinion, no. I learned it a long time ago, so you wouldn't have to!
I think it's great that you learned C first, and I'd keep writing C programs now and then, but I don't see why the win32 API would be useful to dig into. Honestly, it was a big mess.
I think it's important to learn the basics. If you learned just enough to display a window with some fields, some buttons, and a menu. Maybe draw something in a separate window. It would help you learn the fundamentals of how Windows is really working. I believe understanding the message loop and the realization that almost everything you see is a window are fundamental things that everyone should know. My eyes were really opened the first time I realized that a button was it's own window. It then helps you understand that features of things can be turned on and off by sending these windows messages. Subclassing windows let's you get access to features not exposed to you in things like .NET or VB Classic and let's you enhance the window's functionality.
Definitely learn the basics as AlexDrenea mentions. Whilst .NET shields you from a lot of Win32 API Calls. Win32 API is so enormous you're bound to run into situations where .NET hasn't wrapped it for you.
A real life common situation sort arrows on ListViewColumns
I don't really think "learning Win32 API" is realistic for anyone. The APIs (yeah, there's more than one) are huge, and you will hardly ever need to know all of them in detail. I would recommend reading up on some basics (i.e. Window creation, window messaging, window procedures, maybe some GDI, etc.) and using MSDN to look up the rest whenever you need it.
As per Greg's comment, it is to some extent domain dependent. I do a lot of Windows CE / mobile programming, where .NET is too hoggish for many devices and other frameworks such as MFC aren't fully implemented. In this context, much of Win32 is still very relevent.
That said, I wouldn't go learning it all upfront, I'd simply go through the basics, and dig out the rest as and when I needed it. The documentation and examples out there are good enough for this approach, as is the online help available from communities such as this.
Unless you need some functionality that is not in the .NET Framework (such as getting detailed info on printer drivers), no. That's about 99% (of course, an arbitrary value I just made up) of what you'll do.
Even if you were using Win32 and not .NET, is there really a need to learn the same depth as the book? Browse thru the sections, learn that if you encounter some problem in the future you know where to look for it. Then stop. Go in depth when you need it or have the free time.
I think it's already been answered but if you do .NET 2.0 development or anything winforms in .NET, you're bound to run into a lot of problems with how some parts of the framework is wrapping win32 and mfc and you'll need to dig into that to actually get stuff working as intended.
If you're trying to solve Business Problems, then there's better tools out there than C for programming Win32 systems. Clarion. Delphi. And others I have no doubt.
But I guess for learning how things work you're in good stead with C.
Some stuff can not be done without win api calls but with each version of .net those things become less and less so no i would not learn the win api if i where you..
You have to know it exists, since most of the native functions of more "advanced" managed language end up calling them.
Plus it can be encapsulated in script languages like Autoit with DllCall
I'm still earning part of my money using it. We do have a C IDE which is based on the WinAPI. It's now around for 15 years or so, and still running ;-). The complete download of it is around 5 MB for that you do not get anything in the .NET world. So for us it's still a valuable thing....
This has been discussed many times on Professional Win32 api Newsgroup (
news://comp.os.ms-windows.programmer.win32)
(by the greatest gurus and best-sellers authors (Petzold, Russinovich, etc) in the world...)

Resources