Listen, everyone. Matthias really doesn't like all of these "ooh, fancy seeing my favorite YTer here" comments because they're usually a waste of time. Comments should add something to the conversation.
Agree and you here in the comments make me belive that youtube might be really small after all. It happen often that people I watch, watch and comment on other channels that I find interesting, but not in theire own topic. :-)
This takes me back years and years. My first university C-programming class gave us a project to build a Yatzi (Nordic version of Yatzhee) in pure C. I was a bit ahead of the class and chose to do mine in Win16 which was still cool and new - I remember a lot of the basics from here still vividly. And the best part is the teaching assistant who looked at my code (a basic HP-UX nerd) could not figure any of it out - he actually claimed this code will neither compile nor run. He had an interesting expression after the compiler went through some 100,000 lines of .h, maybe 1000 lines of my code and all of the sudden you had a Win 16 app that actually worked and had a bunch of nice Windows behavior like mouse roll-over gray scoring. Today everyone would consider that normal, but back then it was a "WOW!" moment. Love your content, takes me back as a former blue badge, too.
Recently I went retro and installed Visual Studio 5.0 (Visual Studio 97) into Windows NT 4.0. My hello world app is only 4kB in size when linking with dynamic CRT (basically libC in DLL instead of inlined inside the EXE). Then I went full masochist and switched to Visual C++ 1.10 and C (not C++ because the compiler's ability to handle templates drove me crazy). Now my app can run on both Windows 95, Windows NT 3.1 and newer, can detect missing unicode (wide) functionality and switch to current ANSI code page at run-time (no need to have separate ANSI and unicode builds). Currently I don't care about 16bit Windows and Win32s. I also customized the program's entry point in order to replace the CRT. Don't confuse real program's entry point, that the OS calls, (usually wWinMainCRTStartup inside CRT you link against) and the wWinMain entry point, that the CRT calls, you as app developer writes. I want to say how much I LOVE the offline MSDN documentation in HLP/CHM format.
I think it may be "vgafix.fon," "vgasys.fon" and other similarly named files. They're tiny six, seven, eight kilobyte files and have been included at least as far as Windows XP.
@@sycration Actually dos ended with windows ME. After that windows 2000 and forward (for consumers at least, windows NT had it earlier) were all based on the NT kernel.
This sure brings me back. I was always frustrated with how MFC hid the foundational stuff, so I bought books on win32 and did a deep dive into win32. I still have those books, more than 20 years later :-)
Let's take some red C++, add some blue Haskell to it and a tiny bit of yellow COBOL......let's put a bug...right there. Gotta make those little noises or it won't work. And...ah, you know me - everybody needs a friend! Let's hide a another small hard-to-find bug or a cute little zero day exploit right behind it - nobody can see it, but _we_ know it's there! Maybe we'll paint a patch for it later...or maybe we won't. It's up to you! Once you grab your keyboard, you get a programmer's license - in this piece of code, you have total and absolute freedom!
Dave, .. I personally started programming when I was around 10 or so with QBasic.. Finding QBasic and opening nibbles was great.. changing the game and modifying the code and seeing what I did and it come to reality on the screen started it all! You coded what I was learning on.. lol
In a world where people are only using java and using "else if" instead of a bloody switch statement! One man, rises from the ashes to show us all how it's done. *Phat synth bass track plays.* DAVE PLUMMER!!!
As a fellow nerd who learned to code way back in the 80s and 90s, I cut my teeth on 6502 assembly, learned C, and progressed to x86 ASM, C, CPP, Pascal once my mom got me a PC and I have since that period on my 10th birthday built a life on knowing how machines work and how to solve problems and provide tools and experiences to others, I salute you! I really love your channel, and I love all the insider things from Microsoft and I especially love this video and your x86 ASM video that shows the Millenials how it's done...
I’m a millennial, and I learned HTML and pascal in computer science high school class in the early 2000s. Your generational assumptions just serve you negatively.
@@toyotasupra97 I am sorry if I offended you, it was not my intention. My point was actually that my generation had an advantage when it comes to this bare metal stuff, simply because we didn't have the comforts of modern era software development tools. I am not in any way or form claiming that the younger generations are not capable of learning how to program a machine directly. I just found it so cool and fascinating to see Dave show and explain all the steps necessary to make some simple Windows API calls using nothing but the native tongue of the CPU.
Thanks, Dave, this brings me back to my days of reading Petzold's "Programming Windows" and Prosise's "Programming Windows with MFC." I don't think reading those books made me a better person but they sure did make me a better programmer.
That was so interesting to watch, almost mesmerising! As someone, who is striving to become a junior C++ dev soon, that blast from the past was a great learning experience of how far we've come :D
I haven't written windows code like this in 15 years. I was a kid learning to code with Borland C++ because VC++ used to not have a free version and Borland came with a C book my parents got me :-) I kinda miss doing it this way...
Realy I didn't get the book. But the manuals were great. I recall back in college they threw a lot away, I got my mates to dive in and grab some for me. In return, I wrote "their" code.
@@johnh10000 The bundle I got was actually put together by McMillan Publishing and included both Borland C++ 5.02 and Sam's Teach Yourself C in 24 Hours. The Sam's book got me started with C and basic C++. The Borland compiler was one of the most heavily used pieces of software on my PC all through grade school and high school.
I still have both Turbo Pascal 1.0 on 8" floppy for CP/M 86 and MS-DOS V1. I went on to all versions of turbo Pascal, Delphi, Borland C++, C, Prolog (loved prolog).anyone here use their B-tree library for Turbo Pascal?. Really miss them. They did a Turbo Pascal .Net for V1, then gave up.
I just started up my old TI-85 from high-school and walked my son through coding a Sierpiński triangle app in TI-BASIC. I absolutely love this content :)
Dave, I really enjoyed this topic. Please cover more of this stuff! I'm a now retired EE and have been able to return to my hobby of software and electronics as opposed to my job of S/W and H/w. No more deadlines for me!
I absolutely love that you comment your code!!! Fire some reason things seems to have moved to “code is enough documentation” and I hate it. It’s much easier to get what the people before yo did if they’d bothered to tell you rather than relying on “good naming standards” :)
You have inspired me to learn C++ ! I’m using my dads old books and some online sources (including your awesome channel!), and it’s a really handy language
I don’t get it. C++ is still a hugely utilized high level language used every day. In fact, if you take computer science in a university, it’s the first language you learn.
thanks for bringing back the memories, i almost forgot how much work it used to be to do the simplest things. Its cool how you still remember it as if it was yesterday
This was great, especially the extra tips that only someone from the inside would know. Would love to see more tutorials or walk-throughs like this. I wouldn't even mind a dedicated video on how the WndProc works behinds the scenes, or how to draw flicker-free like you had done with Task Manager.
This brought back so many memory’s of banging my head against the table - a good choice for the editor colours, the blue and white mad the memories more real
"They call it engagement, I call it.. dopamine." Loved that one! My comprehension of the coding here is elementary at best but I was still paying close attention from start to finish. Dave, have you ever considered publishing some content in a podcast format? I found myself listening to Dave's Garage whilst working in my own garage; video sometimes optional!
Holy hell. This was amazing. Thank you so much for your knowledge, experience, and willingness to teach everyone on youtube. I look forward to each of your videos. I would love to see bare-metal basics for all of those topics you listed. Thanks again, and keep up the good work!
I went to school for game dev at Full Sail about 10 years ago and we took a windows programming class. We did stuff just like this to make a simple pong game. We had to start with an empty cpp just like this. That’s how we learned about a main game loop. Basically it’s a while(true) loop but we had to make sure we ended it when the right messages came through. It was cool because we did it before they taught us directx and OpenGL. We got to learn about brushes, painting, etc. Our second Windows programming class was in c# using forms, so we got a bit of the old and a bit of the new way to make windows applications.
Thanks for doing this Dave, I find that even though I never write code at this level (usually in c# with VS), just knowing what happens at this level behind the scenes help write better code and troubleshoot faster.
I've written many programs in Assembly Language. I have never written a Windows application in pure assembly language. I have written routines in Assembly to speed up a process but this was really fascinating. Thank you.
Hello Dave. Thank you for your videos. We're about the same age, and although life took me on a different path, I always nurtured an interest in computers, and coding in particular. Today's internet is so incredibly rich with content about programming, it's hard to imagine that in the 90s, even as the computer revolution was in full swing, taking an hobbyist interest in coding was quite challenging. Getting an overview of how a system worked, and getting a grasp on the concepts essential to understanding where your "Hello World" beginner's program fitted in the seemingly endless complexity of a windows system, was just impossible for the casual coder that I was. Dave's garage back then would have changed my life. Cheers !
I recently had to create a DLL plugin for a popular app. I built it using VC++ 2019 and ensured I didn't use any APIs introduced after Windows XP, or the DLL version of the VC++ runtime. As a result the DLL can be copy deployed and will work on just about any configuration likely to be in production today. This type of programming is one of the few ways you can write dependency-free code that just runs "out of the box"
Great content Dave. I'd love to see my retrocoding for Windows, particularly esoteric things, such as native mode applications in NT, simple drivers, etc. I'm more interested in Windows-related stuff, but I'm sure that the other platforms would be interesting too.
This is a fun channel. I used to program for the DoD back in the day, trying to write very tight code for the pitiful machines that were running (as a fresh upgrade!) Windows 95. I look back at those days fondly, but rarely write any code, except for the odd microcontroller board. Still have a copy of _Writing Solid Code,_ which was needed at the time, 'cuz Windows was as stable as a SpaceX Starship.
Please make more of these, I realize they might not be so popular for a general audience but still, it's so inspiring to see you code, has made me better my code, and think multiple times "the perfect is the enemy of the good." In any case, thanks!
As someone a little too young to have caught this era of programming but infinitely fascinated with how everything was built off it - thank you. This was a treat to compare with today's Javascript everywhere reality.
Back in 1992, this is exactly what we did for a 'client-server' commercial Windows product my company was selling. I still have the code somewhere. The big challenge was the limited resources on the PCs. It made me a better developer, for sure. Every byte was important. Thanks for the trip back. And hey, you are using Hungarian notation, cool.
As someone who has tried unsuccessfully to get into coding of any type its super nice to hear about the why behind everything instead of just hearing about the how.
Oh man, haven't wrote this level of code in mannnny years. I learned this about 10 years ago. I actually learned this by memorizing it then once I knew it, I made small changes. This brings me back.
Oh man, this episode brought back some memories of when I wanted to make my own game engine. I remember being stuck for days trying to understand the Windows api coding this very same stuff.
One thing to note is that GetMessage should not be used in a while loop like that, while it should mostly just return nonzero for success and zero when the quit message has been posted, there is also -1 which is returned in case of an error. I know you left out error handling deliberately in this case, just thought it would be nice to remark, great tutorial :)
It all came flooding back to me as you were writing this application. Including the SetWindowLong & SetWindowLongPtr. I distinctly remember these 2 commands as it took me ages to find our how I was supposed to do it. I can't tell you what I used them for, I just remember I needing to call them. Now days I write all windows applications with C#. I also remember using Borland Turbo C 1.0 for writing windows applications & command line tools. I missed out on using ADA programming language which came out. My current boss hired me purely for my diverse experience & languages from the early games industry Z80 & 6502 assembly (ZX Spectrum [1992 edition with the rubber keys] & Commodore 64) as well as 8086, 80286, 80386 code which I still have from my MSDOS 5.0 days using protected mode application. I ported this code when we switched to using Windows 95.
"I'll leave the typos, so as not to distract anyone" And everyone with an OCD for typos is now totally distracted, staring at the broken lines. Wanting to reach into the screen and fix it themselves. "FIX IT! FIX IT!! FIX IT NOW!!!". You and I, Dave, have a different definition of what's distracting.
I couldn't get over the fact he was using sz as the prefix for the wide character strings instead of wz. I know different teams in MS have different standards, but come on! sz == single byte char, wz = wide char...
It was a pleasure following your tutorial, recalling the good old days of windows programming from the 90's. The MSDN documentation was an amazing source for help for me, when I used the Win API and Win DDK.
Loved the blooper cuts at the end of this video. Thanks Dave. Ever reminded why I prefer to work in the space of interpretive script programming languages rather than compiled languages. Hats off to you working in compiled languages so I am able to be productive in interpretive script languages.
Very nice, fun to finally understand the code I copy-pasted early on learning programming. And to see the small, fast and lean version of what Qt has been hiding from me for 15 years (and that the API is actually quite nice).
Dave: We won't use any fancy Visual Studio, frameworks, etc. to write this. Also Dave: * literally runs whole another OS in the VM just to run the text editor *
As someone who has enjoyed a few of your videos and learned programming on an old Atari 130xe (years after its primary use), I used to have interest in Windows programming but now am a FreeBSD user so prefer to put my personal time there. I pretty much got out of programming entirely for most of the past 15 years but may change that and get back into learning C (studied c/c++ already a bit in high school). In any case, this video is why I hit subscribe; it was a great explaining video as best I can tell even if it is not an intro to C/C++. I recall a friend tried to write hellow world in Windows GUI but assembly and had it just below 1K in size back in the day.
This is great. To see absolute bare metal Win32-programming done by an Microsoft-engineer is just incredible. This is just what makes RUclips so great. I hope that this series continue! Thank you for the time you put in to make these, and of course all the great stories from the 90's!
Interesting, also which oldest APIs are still supported in latest Windows? I know that there's the Win3.1 file dialog still used in some built in program, but what about even older APIs from 3.0, 2.x etc.?
I wouldn’t necessarily call File dialogs an “API”. But virtually all of the original Windows 1.0 API is still valid today. Only some small corner cases might have been removed, and out of the blue I can’t think of any. A few functions still exist (kind of) but are dead now and don’t do anything (like MakeProcInstance()). Everything you saw Dave type in the video is almost valid Windows 3.0 16-bit code (the most notable change needed is that he used some UNICODE function names instead of the original names. And correcting the typos :-) ). With a handful of additional touch ups, the code can even become valid Windows 1.0 code! (If you can find the ancient SDK and compiler needed to compile it, that is)
Even though I barely understand python programming, I can see how clever and intelligent this code is. I really appreciate all the intense effort that went into something like Windows.
@@DavesGarage but i thought you are just in it for the subs and likes? I'd totally join a paid option on this channel for all the interesting stuff you share.
Can always put together the best of both worlds with a pidp-11 kit if you enjoy the blinky lights/toggle switches of an original pdp-11 front console but also the convience of the SIMH emulator over having to potentially restore an original pdp11.
As I young programmer about 20 years ago, I dreamed of understanding something like this. But whenever I opened up Visual C++ as part of Visual Studio and asked it to create a default program, it was like looking at some kind of dark magic. So Visual Basic became a starting point and later, it was Java I was taught in school. Later I learned .NET on my own. Now I finally actually get a good explanation of how that black magic actually works! 🙂 Keep up the good work!
In my internship 1991 it was the first time I worked on a PC, before that I had mainly worked with the university systems (some form of Unix, if I recall correctly) and at home with my Atari ST. I was shocked to see how much work it was to get a simple message up and running. Yet again, once you have this scaffolding up, it's straightforward. I'm really happy that you included the part that makes your Hello World localizable. I'm sure that I have bugged you with this request at least once in the early nineties. I remember how in 1993 or so I had to explain to the developer of File Manager that shortcuts (like Ctrl + F) had to be localized. She couldn't believe it :) Fun times.
This is what I picked up just along the way, sonewhere at some time in my mostly non-microsoft career. I wouldn't put up with any amount of time living in a dorm just to learn this.
Looks like he was running a debug build. I wonder if a release build would hit 60. Honestly don't know if it would make any difference for an app of this simplicity or not.
@Dave's Garage I used to program the C64, C16, PLUS 4, AMIGA. ATARI 400 right up to ST and of course PC. Assembly on all using Mikro for the 64. Ataris Asm Cartridge for the 8 bit. Lattice C and Seka Asm and not forgetting Devpac and Borlands offerings at the time on the Amiga, ST. I learnt Asm on a Vic 20. Used to write code straight in to a machine code monitor. Great Days and nights. I vote C64 or Amiga retro programming. I Like what your doing with the channel. Its refreshing that the old Coding breed is still living and getting that all important dopamine reward when that code just happens to work.
Now we're going from fascinating to really interesting. More of this stuff, yes please! Bonus points for all those little "side-explanations" of why certain things are the way they are, or how you could use a quirk to your advantage. More retro coding!
One can tell a true programmer by his ability to stroke his chin without interrupting touch-typing with both his hands at a machine gun rate.
Thanks! I left that in intentionally, hoping someone would notice :-)
That's what managers really want! If you need to think, at least don't interrupt your work.
Can you tell us the timestamp?
@@sirploko 10:04
@@lohphat Thank you!
I understood about 10% of this but couldn’t stop watching & found it really interesting
As a developer i know c++ a bit but 25% max for me
1% here. Fascinating anyway.
10% more than I understood but still super interesting
I do c based terminal linux programs so same
Agreed
Which I got to 10%!
more tutorials along the lines of the old charles pezold books would be nice
Interesting seeing you here. Taking a break from woodworking and bandsaws? Or maybe just getting ready for your next mouse maze?
I bet you've got some interesting RIM war stories to tell?
👋Matthias, cool seeing you here.
Listen, everyone. Matthias really doesn't like all of these "ooh, fancy seeing my favorite YTer here" comments because they're usually a waste of time. Comments should add something to the conversation.
Agree and you here in the comments make me belive that youtube might be really small after all.
It happen often that people I watch, watch and comment on other channels that I find interesting, but not in theire own topic. :-)
This takes me back years and years. My first university C-programming class gave us a project to build a Yatzi (Nordic version of Yatzhee) in pure C. I was a bit ahead of the class and chose to do mine in Win16 which was still cool and new - I remember a lot of the basics from here still vividly. And the best part is the teaching assistant who looked at my code (a basic HP-UX nerd) could not figure any of it out - he actually claimed this code will neither compile nor run. He had an interesting expression after the compiler went through some 100,000 lines of .h, maybe 1000 lines of my code and all of the sudden you had a Win 16 app that actually worked and had a bunch of nice Windows behavior like mouse roll-over gray scoring. Today everyone would consider that normal, but back then it was a "WOW!" moment. Love your content, takes me back as a former blue badge, too.
Hahahaha that's great
Recently I went retro and installed Visual Studio 5.0 (Visual Studio 97) into Windows NT 4.0. My hello world app is only 4kB in size when linking with dynamic CRT (basically libC in DLL instead of inlined inside the EXE). Then I went full masochist and switched to Visual C++ 1.10 and C (not C++ because the compiler's ability to handle templates drove me crazy). Now my app can run on both Windows 95, Windows NT 3.1 and newer, can detect missing unicode (wide) functionality and switch to current ANSI code page at run-time (no need to have separate ANSI and unicode builds). Currently I don't care about 16bit Windows and Win32s. I also customized the program's entry point in order to replace the CRT. Don't confuse real program's entry point, that the OS calls, (usually wWinMainCRTStartup inside CRT you link against) and the wWinMain entry point, that the CRT calls, you as app developer writes. I want to say how much I LOVE the offline MSDN documentation in HLP/CHM format.
The speed of coding is insane. Also, the flow of thought and organization of his initial code is insane.
I love how it rendered the text in the old System font. I honestly didn't even realise it was still available in Win10.
In C# you may just comment out "Application.EnableVisualStyles();" and application will look very oldschool :-)
I think it may be "vgafix.fon," "vgasys.fon" and other similarly named files. They're tiny six, seven, eight kilobyte files and have been included at least as far as Windows XP.
I can see part 2 jazzing that up. By the end of this i predict we will have recreated pinball, in fact.
@@artifactingreality That ended with XP. NT is much better
@@sycration Actually dos ended with windows ME. After that windows 2000 and forward (for consumers at least, windows NT had it earlier) were all based on the NT kernel.
This sure brings me back. I was always frustrated with how MFC hid the foundational stuff, so I bought books on win32 and did a deep dive into win32. I still have those books, more than 20 years later :-)
Getting big Bob Ross vibes from this, and I am here for it.
I was thinking that! A big wig... "We'll just put a little comment over here, next to the return..."
Let's take some red C++, add some blue Haskell to it and a tiny bit of yellow COBOL......let's put a bug...right there. Gotta make those little noises or it won't work. And...ah, you know me - everybody needs a friend! Let's hide a another small hard-to-find bug or a cute little zero day exploit right behind it - nobody can see it, but _we_ know it's there! Maybe we'll paint a patch for it later...or maybe we won't. It's up to you! Once you grab your keyboard, you get a programmer's license - in this piece of code, you have total and absolute freedom!
@@zeropointzer0 🤣 _"...a cute little zero day exploit..."_ 😝
"There are no mistakes"
C64 / 6502 Assembly course would be amazing. Thank you for your videos ! Learned a lot.
You got it!
@@DavesGarage if you are tuned in on the 6502, have you had a look at Ben Eater’s channel, where he builds a computer with bread boards?
I could have done this on my Apple II in 6502 assembly language with much less typing.
Dave, .. I personally started programming when I was around 10 or so with QBasic.. Finding QBasic and opening nibbles was great.. changing the game and modifying the code and seeing what I did and it come to reality on the screen started it all! You coded what I was learning on.. lol
Me too. Our school had old IBM DOS computers for way longer than they should've, but Nibbles and Gorillas were awesome games, for the time.
In a world where people are only using java and using "else if" instead of a bloody switch statement!
One man, rises from the ashes to show us all how it's done.
*Phat synth bass track plays.*
DAVE PLUMMER!!!
I think this guy is one of the legends of our times
I'd be particularly interested in the same thing, but opening the same sort of Window on an Amiga, so yes, more of this please!
Easily my favourite channel at the moment, thanks for all the great content! Cheers from the UK.
Wow, thanks!
As a fellow nerd who learned to code way back in the 80s and 90s, I cut my teeth on 6502 assembly, learned C, and progressed to x86 ASM, C, CPP, Pascal once my mom got me a PC and I have since that period on my 10th birthday built a life on knowing how machines work and how to solve problems and provide tools and experiences to others, I salute you! I really love your channel, and I love all the insider things from Microsoft and I especially love this video and your x86 ASM video that shows the Millenials how it's done...
I’m a millennial, and I learned HTML and pascal in computer science high school class in the early 2000s. Your generational assumptions just serve you negatively.
@@toyotasupra97 I am sorry if I offended you, it was not my intention. My point was actually that my generation had an advantage when it comes to this bare metal stuff, simply because we didn't have the comforts of modern era software development tools. I am not in any way or form claiming that the younger generations are not capable of learning how to program a machine directly. I just found it so cool and fascinating to see Dave show and explain all the steps necessary to make some simple Windows API calls using nothing but the native tongue of the CPU.
Thanks, Dave, this brings me back to my days of reading Petzold's "Programming Windows" and Prosise's "Programming Windows with MFC." I don't think reading those books made me a better person but they sure did make me a better programmer.
That was so interesting to watch, almost mesmerising! As someone, who is striving to become a junior C++ dev soon, that blast from the past was a great learning experience of how far we've come :D
I haven't written windows code like this in 15 years. I was a kid learning to code with Borland C++ because VC++ used to not have a free version and Borland came with a C book my parents got me :-)
I kinda miss doing it this way...
I've had a 20+ career out of what I learnt using Borland's free compiler
Realy I didn't get the book. But the manuals were great. I recall back in college they threw a lot away, I got my mates to dive in and grab some for me. In return, I wrote "their" code.
I started in the '80's on Borland Turbo Pascal for CP/M
@@johnh10000 The bundle I got was actually put together by McMillan Publishing and included both Borland C++ 5.02 and Sam's Teach Yourself C in 24 Hours. The Sam's book got me started with C and basic C++.
The Borland compiler was one of the most heavily used pieces of software on my PC all through grade school and high school.
I still have both Turbo Pascal 1.0 on 8" floppy for CP/M 86 and MS-DOS V1.
I went on to all versions of turbo Pascal, Delphi, Borland C++, C, Prolog (loved prolog).anyone here use their B-tree library for Turbo Pascal?. Really miss them. They did a Turbo Pascal .Net for V1, then gave up.
Appreciate all your content, but this does really hit my heart. Would really appreciate more old school win32 C coding 🙌🏻
Didn't understood a thing. Loved every bit of it. Awesome videos Dave.
Me neither :-). Glad you liked it though!
Thankfully this is absolutely not overcomplicated and verbose.. you just have to love how clear and easy everything is on Windows.
This was great! Excellent explanation of what I thought previously to just be magic.
Glad you enjoyed it!
I just started up my old TI-85 from high-school and walked my son through coding a Sierpiński triangle app in TI-BASIC. I absolutely love this content :)
Dave, I really enjoyed this topic. Please cover more of this stuff! I'm a now retired EE and have been able to return to my hobby of software and electronics as opposed to my job of S/W and H/w. No more deadlines for me!
I absolutely love that you comment your code!!! Fire some reason things seems to have moved to “code is enough documentation” and I hate it.
It’s much easier to get what the people before yo did if they’d bothered to tell you rather than relying on “good naming standards” :)
You have inspired me to learn C++ !
I’m using my dads old books and some online sources (including your awesome channel!), and it’s a really handy language
I don’t get it. C++ is still a hugely utilized high level language used every day. In fact, if you take computer science in a university, it’s the first language you learn.
Our modern industrial civilization depends on C++
thanks for bringing back the memories, i almost forgot how much work it used to be to do the simplest things. Its cool how you still remember it as if it was yesterday
This was great, especially the extra tips that only someone from the inside would know. Would love to see more tutorials or walk-throughs like this. I wouldn't even mind a dedicated video on how the WndProc works behinds the scenes, or how to draw flicker-free like you had done with Task Manager.
This brought back so many memory’s of banging my head against the table - a good choice for the editor colours, the blue and white mad the memories more real
"They call it engagement, I call it.. dopamine."
Loved that one! My comprehension of the coding here is elementary at best but I was still paying close attention from start to finish.
Dave, have you ever considered publishing some content in a podcast format? I found myself listening to Dave's Garage whilst working in my own garage; video sometimes optional!
So glad I found this channel; Dave is an old-school ASM/C dinosaur... just like me.
More old-school windows code Dave!
Really love this kind of content Dave, it's really intresting to see how it was done back in the days by the pros!
Dave is proper dev GOAT, with smooth jazz included! 10/10
Holy hell. This was amazing. Thank you so much for your knowledge, experience, and willingness to teach everyone on youtube. I look forward to each of your videos. I would love to see bare-metal basics for all of those topics you listed. Thanks again, and keep up the good work!
I went to school for game dev at Full Sail about 10 years ago and we took a windows programming class. We did stuff just like this to make a simple pong game.
We had to start with an empty cpp just like this. That’s how we learned about a main game loop. Basically it’s a while(true) loop but we had to make sure we ended it when the right messages came through.
It was cool because we did it before they taught us directx and OpenGL. We got to learn about brushes, painting, etc.
Our second Windows programming class was in c# using forms, so we got a bit of the old and a bit of the new way to make windows applications.
Thanks for doing this Dave, I find that even though I never write code at this level (usually in c# with VS), just knowing what happens at this level behind the scenes help write better code and troubleshoot faster.
Ahh this brings me back to my beginning programming days.
I still have my coffee stained copy of Programming Windows by Charles Petzold.
I have done a bunch of c/c±± on Linux and some embedded. But the massive windows boilerplate just seemed impenetrable. This is awesome
I've written many programs in Assembly Language. I have never written a Windows application in pure assembly language. I have written routines in Assembly to speed up a process but this was really fascinating. Thank you.
We need more videos like this, capture his knowledge before it’s lost.
Yes! Please!
Hello Dave. Thank you for your videos. We're about the same age, and although life took me on a different path, I always nurtured an interest in computers, and coding in particular. Today's internet is so incredibly rich with content about programming, it's hard to imagine that in the 90s, even as the computer revolution was in full swing, taking an hobbyist interest in coding was quite challenging. Getting an overview of how a system worked, and getting a grasp on the concepts essential to understanding where your "Hello World" beginner's program fitted in the seemingly endless complexity of a windows system, was just impossible for the casual coder that I was. Dave's garage back then would have changed my life. Cheers !
Borland TurboC, god that brings me back to the mid 90s when I was leaning it in school..
me too!
I recently had to create a DLL plugin for a popular app. I built it using VC++ 2019 and ensured I didn't use any APIs introduced after Windows XP, or the DLL version of the VC++ runtime. As a result the DLL can be copy deployed and will work on just about any configuration likely to be in production today.
This type of programming is one of the few ways you can write dependency-free code that just runs "out of the box"
My preferred method
Great content Dave. I'd love to see my retrocoding for Windows, particularly esoteric things, such as native mode applications in NT, simple drivers, etc. I'm more interested in Windows-related stuff, but I'm sure that the other platforms would be interesting too.
This is a fun channel. I used to program for the DoD back in the day, trying to write very tight code for the pitiful machines that were running (as a fresh upgrade!) Windows 95. I look back at those days fondly, but rarely write any code, except for the odd microcontroller board. Still have a copy of _Writing Solid Code,_ which was needed at the time, 'cuz Windows was as stable as a SpaceX Starship.
Awesome Video. You got me at old school. I love retro coding. Thanks.
Glad you enjoyed it!
I've been subscribed for a while and never saw this video. I'm grateful creators like you pass on your knowledge.
Now it's really getting fun.
Love the content.
Please make more of these, I realize they might not be so popular for a general audience but still, it's so inspiring to see you code, has made me better my code, and think multiple times "the perfect is the enemy of the good." In any case, thanks!
As someone a little too young to have caught this era of programming but infinitely fascinated with how everything was built off it - thank you. This was a treat to compare with today's Javascript everywhere reality.
Back in 1992, this is exactly what we did for a 'client-server' commercial Windows product my company was selling. I still have the code somewhere. The big challenge was the limited resources on the PCs. It made me a better developer, for sure. Every byte was important. Thanks for the trip back. And hey, you are using Hungarian notation, cool.
Thank you sir. Bare metal coding rules. I loved it. Already subscribed.
Thanks and welcome!
As someone who has tried unsuccessfully to get into coding of any type its super nice to hear about the why behind everything instead of just hearing about the how.
Oh man, haven't wrote this level of code in mannnny years. I learned this about 10 years ago. I actually learned this by memorizing it then once I knew it, I made small changes. This brings me back.
Hi Dave. Since stumbling on your channel yesterday, I’ve been glued! Look forward to more videos! 👍🏼
I don't understand C and it's family, but I just love to hear your stories
Oh man, this episode brought back some memories of when I wanted to make my own game engine. I remember being stuck for days trying to understand the Windows api coding this very same stuff.
One thing to note is that GetMessage should not be used in a while loop like that, while it should mostly just return nonzero for success and zero when the quit message has been posted, there is also -1 which is returned in case of an error. I know you left out error handling deliberately in this case, just thought it would be nice to remark, great tutorial :)
Whoa! Showdown with the master! Grabbing popcorn now.
It all came flooding back to me as you were writing this application. Including the SetWindowLong & SetWindowLongPtr. I distinctly remember these 2 commands as it took me ages to find our how I was supposed to do it. I can't tell you what I used them for, I just remember I needing to call them. Now days I write all windows applications with C#.
I also remember using Borland Turbo C 1.0 for writing windows applications & command line tools. I missed out on using ADA programming language which came out. My current boss hired me purely for my diverse experience & languages from the early games industry Z80 & 6502 assembly (ZX Spectrum [1992 edition with the rubber keys] & Commodore 64) as well as 8086, 80286, 80386 code which I still have from my MSDOS 5.0 days using protected mode application. I ported this code when we switched to using Windows 95.
"I'll leave the typos, so as not to distract anyone"
And everyone with an OCD for typos is now totally distracted, staring at the broken lines. Wanting to reach into the screen and fix it themselves. "FIX IT! FIX IT!! FIX IT NOW!!!".
You and I, Dave, have a different definition of what's distracting.
Same here! And he did not go through and show what he fixed. Literally unwatchable. When's the next one?
I couldn't get over the fact he was using sz as the prefix for the wide character strings instead of wz. I know different teams in MS have different standards, but come on! sz == single byte char, wz = wide char...
If I don't fix it immediately the error squiggles in the IDE will distract me even more.
It was a pleasure following your tutorial, recalling the good old days of windows programming from the 90's.
The MSDN documentation was an amazing source for help for me, when I used the Win API and Win DDK.
Would love to see more like this.
Brings back memories of using Quick C for Windows.
Another great video, thanks for the blast from the past!
Is it just me who wants Dave's real typing speed reveal at 100k ? 😆
Loved the blooper cuts at the end of this video. Thanks Dave. Ever reminded why I prefer to work in the space of interpretive script programming languages rather than compiled languages. Hats off to you working in compiled languages so I am able to be productive in interpretive script languages.
This was awesome! Thanks so much. If you don’t mind, how did you learn to program? Maybe talk about that in a video. Thanks again. Excellent stuff.
Very nice, fun to finally understand the code I copy-pasted early on learning programming. And to see the small, fast and lean version of what Qt has been hiding from me for 15 years (and that the API is actually quite nice).
Dave: We won't use any fancy Visual Studio, frameworks, etc. to write this.
Also Dave: * literally runs whole another OS in the VM just to run the text editor *
That was WSL (Windows Subsystem for Linux), it's a part of Windows.
@@aetch77 WSL 2 runs Linux kernel in a VM.
As someone who has enjoyed a few of your videos and learned programming on an old Atari 130xe (years after its primary use), I used to have interest in Windows programming but now am a FreeBSD user so prefer to put my personal time there. I pretty much got out of programming entirely for most of the past 15 years but may change that and get back into learning C (studied c/c++ already a bit in high school). In any case, this video is why I hit subscribe; it was a great explaining video as best I can tell even if it is not an intro to C/C++. I recall a friend tried to write hellow world in Windows GUI but assembly and had it just below 1K in size back in the day.
Ah, the programming I did before I knew what a "stand up" is
Looking forward to the Amiga programming as I am starting to learn 68000 assembly on an Amiga. Keep you the good work.
Are you sitting comfortably?
Good, then we'll begin
Such a Canadian!
Platinum Blonde
Beautiful layout and alignment on the fly. A joy to watch this composition!
More Retro Windows please! MFC, GDI, DirectX, Drivers :)
Thank you and I enjoy watching the video and will be back next time.
Awesome, thank you!
I would love a basic hello world intuition example on Amiga.
This is great. To see absolute bare metal Win32-programming done by an Microsoft-engineer is just incredible. This is just what makes RUclips so great. I hope that this series continue! Thank you for the time you put in to make these, and of course all the great stories from the 90's!
Interesting, also which oldest APIs are still supported in latest Windows? I know that there's the Win3.1 file dialog still used in some built in program, but what about even older APIs from 3.0, 2.x etc.?
WinExec api
I wouldn’t necessarily call File dialogs an “API”. But virtually all of the original Windows 1.0 API is still valid today. Only some small corner cases might have been removed, and out of the blue I can’t think of any. A few functions still exist (kind of) but are dead now and don’t do anything (like MakeProcInstance()). Everything you saw Dave type in the video is almost valid Windows 3.0 16-bit code (the most notable change needed is that he used some UNICODE function names instead of the original names. And correcting the typos :-) ). With a handful of additional touch ups, the code can even become valid Windows 1.0 code! (If you can find the ancient SDK and compiler needed to compile it, that is)
@@euromicelli5970 i would, like MessageBox api or the api that calls that dialog that winver shows.
Two (one) thumbs-up for any retro-coding fun. Always good to see bloopers. I get tongue-tied just watching...
Engagement for the algorithm gods. Loved the content :)
Pushing this awsome content :) too
Even though I barely understand python programming, I can see how clever and intelligent this code is. I really appreciate all the intense effort that went into something like Windows.
holy butts, you could hold a class about this stuff and charge admission and people would line up.
Let's pretend the video was the class - just send money! :-)
@@DavesGarage but i thought you are just in it for the subs and likes?
I'd totally join a paid option on this channel for all the interesting stuff you share.
Great memories, thanks Dave! Started my windows journey on Win 1.x I was a C programmer on VAXs, purchased the Windows SDK as I saw it as the future.
PDP-11 please ... life before MS just for those that can remember when that was true.
I've got to find a good emulator for it where it's set up so that I can build a MACRO-11 program. I love MACRO11, it'll be fun...
@@DavesGarage yes, please
@@DavesGarage Emulator? Someone with your means can surely pick up an actual machine. :-)
I have a real 11/23+ in my shop but I often just use SIMH with an RT-11 configuration. SIMH is great if you’ve never used it.
Can always put together the best of both worlds with a pidp-11 kit if you enjoy the blinky lights/toggle switches of an original pdp-11 front console but also the convience of the SIMH emulator over having to potentially restore an original pdp11.
Quite amazed by the programming work in this video. I also liked the accompanying music a lot.
This brings back memories of reading Charles Petzold's book cover to cover :)
As I young programmer about 20 years ago, I dreamed of understanding something like this. But whenever I opened up Visual C++ as part of Visual Studio and asked it to create a default program, it was like looking at some kind of dark magic. So Visual Basic became a starting point and later, it was Java I was taught in school. Later I learned .NET on my own. Now I finally actually get a good explanation of how that black magic actually works! 🙂 Keep up the good work!
too right, that was fab you made it look too easy!
In my internship 1991 it was the first time I worked on a PC, before that I had mainly worked with the university systems (some form of Unix, if I recall correctly) and at home with my Atari ST. I was shocked to see how much work it was to get a simple message up and running. Yet again, once you have this scaffolding up, it's straightforward.
I'm really happy that you included the part that makes your Hello World localizable. I'm sure that I have bugged you with this request at least once in the early nineties. I remember how in 1993 or so I had to explain to the developer of File Manager that shortcuts (like Ctrl + F) had to be localized. She couldn't believe it :) Fun times.
This brings back memories. I used to write code like this.
I'd love to see you code something for the Commodore 64.
No one appreciates us former Borland C programmers
Wow, that makes programming for the X Window System using nothing but Xlib look concise and clear!
This is what I wished I would have learned in college :-/
This is what I picked up just along the way, sonewhere at some time in my mostly non-microsoft career. I wouldn't put up with any amount of time living in a dorm just to learn this.
This is the most comfy Win32 video I have ever seen. Thanks Dave !
25 times per second? Let me know when you get up to 60fps as nothing short of that is acceptable these days!
Dave's video player; start a image viewer over and over with a new image.
I want 144 fps!
Looks like he was running a debug build. I wonder if a release build would hit 60. Honestly don't know if it would make any difference for an app of this simplicity or not.
@@elerius2 Yup, debug build :-) I imagine retail is faster!
@@rudeviper Yeah Dave! Come back when you have a 144 fps 4K Windows app written in Nano; what's wrong with you?
@Dave's Garage I used to program the C64, C16, PLUS 4, AMIGA. ATARI 400 right up to ST and of course PC. Assembly on all using Mikro for the 64. Ataris Asm Cartridge for the 8 bit. Lattice C and Seka Asm and not forgetting Devpac and Borlands offerings at the time on the Amiga, ST. I learnt Asm on a Vic 20. Used to write code straight in to a machine code monitor. Great Days and nights. I vote C64 or Amiga retro programming. I Like what your doing with the channel. Its refreshing that the old Coding breed is still living and getting that all important dopamine reward when that code just happens to work.
We’re you Working directly with the win api?
Yes, functions like RegisterClassEx and CreateWindow are part of, and exported by, user32.dll
Now we're going from fascinating to really interesting. More of this stuff, yes please! Bonus points for all those little "side-explanations" of why certain things are the way they are, or how you could use a quirk to your advantage.
More retro coding!