r/C_Programming • u/Beneficial_Mall2963 • Jul 19 '26
Question Where do we learn the windows.h library of C?
Pardon me if i have said something highly wrong or misleading since i am a really new beginner.
After learninng C's string.h, stdio.h, stdlib.h and string.h. I wanted to learn windows.h to further increase my knoweldge. But i cannot find a source to learn it, can anyone point me out?
big thanksss :)
23
Upvotes
•
u/AutoModerator Jul 19 '26
Looks like you're asking about learning C. Should you have posted in the weekly megathread instead?
Our wiki includes several useful resources, including a page of curated learning resources. Why not try some of those?
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
40
u/WildCard65 Jul 19 '26
Microsoft's Documentation website.
16
u/peno64 Jul 19 '26 •
Learning each function of a library is very dull, isn't it. Specifially all the Windows functions. There are thousands... and you maybe ever a hundred. I learned Windows C programming with Charles Petzold. A very good book.
17
u/Hoshiqua Jul 19 '26 •
Microsoft's documentation for it is actually pretty well-made, and even better, on Visual Studio you can press f1 on any symbol you don't know and it will mooooooooostly get it right and open the relevant documentation page about it.
There ARE some gotchas that can take a while to figure out. My main advice is to just start with a normal C Hello World program, include Windows.h, and define WIN32_LEAN_AND_MEAN right before that. And then, as a first objective, replace main with WinMain (although that's not strictly-speaking necessary).
If you're looking to use the library to roll out "no-library" games, Casey Muratori's Intro to C on Windows and Handmade Heroes series are a great learning resource, although he doesn't write pure C, rather mostly C with some C++ features in there.
5
u/Medical_Amount3007 Jul 19 '26
The windows.h is in C, all functions is C, but seeing as Microsoft push for C++ they will show code in C++ thought take away classes and stuff it’s mostly C. Look at their MSDN and also their GitHub for examples.
But you would end up writing C++ for all things that used COM, as Microsoft has removed support for COM in Direct2D and other libraries.
COM is still available if you write it yourself as C structs with vtbl definitions
4
u/Rynok_ Jul 19 '26
This is is the header used by. Win32 Api. Check https://winprog.org/tutorial/
Also recomended books https://winprog.org/tutorial/references.html
3
u/v_maria Jul 19 '26
i dont think it makes sense to learn a file. you mean you want to learn how to call functions from windows.h, or maybe something else?
2
u/mlugo02 Jul 19 '26
What do you want to do with it?
2
u/lmemsm Jul 19 '26
There are some books for learning Win32 programming (including windows.h). Most people recommend Charles Petzold's books. I personally preferred Paul Dilascia's work: https://web.archive.org/web/20071010132744/http://www.dilascia.com/wpp.htm The older memory model information in these books is typically outdated and you can just use standard C memory handling now in many cases. However, a lot of the information in the older books is still very useful. I haven't seen newer books or online resources that do a better job overall.
1
u/Deep-Piece3181 Jul 20 '26
I think you can do as you learn you can look up api calls as you need them
-1
u/Living_Fig_6386 Jul 19 '26
C has no “windows.h” library. in the context of C, files with the suffix “.h” are typically header files — source files that contain macros, type definitions, structure definitions, and function prototypes. Libraries are separate rhings entirely, but their development kits may have C header files pertinent to the library.
Though there are thousands of libraries and pieces of software that have a header file named “windows.h”, one of the most prevalent is Microsoft’s “Windows” operating systems. If that’s what you are interested in, consult Microsoft’s documentation for the product and version that you are interested in.