'Can I learn the Win32 API without C++ (with only C)?

I'm sorry about asking a weird question about this. I googled and looked up to here for a solution, but none of the answers satisfy what actually I want.

I am really confused about this question. It's been almost 2 years that I have been studying for security based work. So, I have good knowledge about Python and C.

The company that I referred gave me advise to learn about Win32. But when I begin to learn about it, I encountered that Win32 is C++ based. But I don't want to waste time again to study it. Some blogs talk about Windows Programming in C/C++, and this makes more confusion for me as C and C++ are essentially separate from each other, I think.

My questions are:

  1. Can I learn Win32 with only C?

  2. If no, then can I learn it over C?

  3. If yes, how deep do I have to go (so, all context of it or specific)?

So again sorry. I'm really very confused at the moment that I don't know what I have to do.



Solution 1:[1]

As far as I know - yes, it should be possible. The older Windows APIs were in fact C based and that's what I learned myself 20 years ago. They're quite straightforward. The newer ones are based on COM which is a bit more of a hassle to do in C, but by no means impossible. I remember reading some good tuorials on doing just that (COM in C), although I don't have any handy links to give out I'm afraid.

That said, C and C++ are quite close. In fact, C++ was originally intended to be a superset of C - every valid C program was supposed to be a valid C++ program. Now, they didn't quite make that happen, but the differences are subtle and for the most part shouldn't bother you much. So you might as well continue writing code in C, using just a bit of C++ for interfacing with COM. The C++ compiler should accept this just fine.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1