3 ms·
TheForger's Win32 API Tutorial
- dnamlin 1y agoSoooo many handles to remember to free in the right order, even before you got into OLE/COM. It was a lot of fun to come up with your own C++ wrappers to put them under RAII -- and this was before "smart pointers." You sort of had to iterate on a few versions of that, trying out mechanisms to scope sharing, to understand why MFC was the way it was. Fond memories of the #winprog IRC channel. Discussions there, theForger's tutorial, and Charles Petzold's books got me going on Startup Control Panel and the like. https://web.archive.org/web/20131106030702/http://www.mlin.net/StartupCPL.shtml https://web.archive.org/web/20131106030702/http://www.mlin.n...
- gitroom 1y agoOh man, I remember fighting with handle leaks back then too - that stuff was a rite of passage.
- PlunderBunny 1y agoI remember that on Win 9x, once you leaked too many handles, bitmaps and icons would just become black boxes.
- adzm 1y agoThis is still true; there are maximum limits on the number of open handles in a process.
- hernandipietro 1y agoI learned a lot with this tutorial, decades ago
- Hydraulix989 1y agoA textbook example of poor API design.
- notepad0x90 1y agoI just love how Win32 has its own set of system calls as a subsystem separate from the main NT kernel. Imagine making syscalls to control X11 or wayland window/gui. These days I think MS wants you to use WinRT/UWP stuff: https://blogs.windows.com/windowsdeveloper/2016/11/28/standard-c-windows-runtime-cwinrt/ https://blogs.windows.com/windowsdeveloper/2016/11/28/standa...
- heavensteeth 1y agoI've referenced this a few times working with Win32, it really saved my ass. I don't remember being able to find many other simple matter-of-fact C Win32 documentation. Win32 is weird and ugly and annoying at times, but I kind of love it. I just wish I actually used Windows so that I could play with it more; unfortunately Linux has no way to create simple lightweight applications like Windows does.
- rossy 1y agoIn my opinion, the Win32 era only ended recently (and I don't think that's a good thing!) Back in Windows 10, you could use C and the Win32 API to make a lightweight dependency-free GUI app that looked exactly like the built-in apps like Notepad, File Explorer, Task Manager, and so on. You could even get the same ribbon component they used, which was implemented in a public DLL. In Windows 11, all those built-in apps have been rewritten with Mica-styled widgets in XAML Islands, and if you want to build your own lightweight dependency-free C app that looks the same way, you'll find out it's not possible. For the first time ever, the Win32 common controls library implements a widget style that's completely different to what the built-in apps look like. Even if you use XAML Islands, if you just use the system XAML, you'll find your app looks like Windows 10, because the Windows 11 look-and-feel is implemented in WinUI, a DLL that you're supposed to vendor with your application. The era of Windows shipping with a C API that you can use to build perfectly native-looking apps ended when Windows 11 came out 3 years ago, and it's a real shame.
- SuperNinKenDo 1y agoIt's important to learn Linux's only stable ABI after all.
- ezbie 1y agoSomeone please tell me what I am missing. Is this really just 10 topics about very basic win32 api?