this post was submitted on 24 May 2025
576 points (100.0% liked)

Funny

10406 readers
1180 users here now

General rules:

Exceptions may be made at the discretion of the mods.

founded 2 years ago
MODERATORS
576
2000s internet (lemmynsfw.com)
submitted 1 month ago* (last edited 1 month ago) by [email protected] to c/[email protected]
 

Happy 19th anniversary to freecupholder.exe

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 7 points 1 month ago (1 children)
#! /usr/bin/bash
PATH=/usr/local/bin:/bin:/usr/bin
eject -r
[–] [email protected] 4 points 1 month ago (1 children)

Kind of surprised they didn’t have a batch file command for this. I’m guessing people had to build a whole MFC application just to call the eject API.

[–] scaramobo 2 points 1 month ago (1 children)

It was actually quite simple from what i remember. There was a plain winapi call to control multimedia devices, the mmc api. You could send a control string to the device, such as eject, play or seek. So in maybe 4 lines of C code, this could be written.

Disclaimer: All info from the top of my head based on knowledge from 20 years ago, so take it as it is.

[–] [email protected] 1 points 1 month ago (1 children)

That sounds about right for 4 lines of code to make the call itself. But I remember using VC++ and since everything was a GUI you’d create a project which gave you a bunch of template generated code with all the MFC and WinAPI libs and frameworks…

[–] scaramobo 1 points 1 month ago

You had the option. You could create a fullblown mfc application (in a couple of variants such as single document, multiple document and dialog based), but also a barebones plain winapi one. And a for a DLL too. I miss those simpler times of winapi coding, i found it fun. I moved away from windows as an OS around the time .Net 2.0 was released. Now when I look at modern windows development, I recognise absolutely NOTHING lol. Does winapi even exist still under all those layers?