One interesting thing about WordPad (at least from the Windows XP / 7 era) was that it supported the complete OLE2 / ActiveX stack.
This let you do all kinds of things like embed other types of controls (like canvases or images from Paint, or Excel tables) inside your document, and WordPad's UI would jump through all the hoops to update and transform into the embedded application's UI when that control gained focus. This made it a pretty useful testing app when I was interning at MS and working on embeddable Inking surfaces for Tablet PC. (Yes, I'm a dinosaur)
I have a story which predates WordPad, but concerns OLE support in it's predecessor Write:
At my secondary school, a long time ago now, they used PCs from educational vendor Research Machines (RM). These ran a locked down version of the Windows 3.11 Program Manager which didn't allow you to start any unapproved programs. I discovered you could embed EXEs from a floppy disk as OLE objects in a Write document and then start them from within Write by double clicking. In this manner, I could bring my LibertyBasic programs in from home and run them on the school's machines :-).
We also used PCs from RM at our secondary school in the late 2000s. At that time there was still a very similar exploit that allowed me to embed and run unauthorised programs inside of PowerPoint slide shows. Fun times.
Who can forget the first time they opened Wordpad and then tried to drag a text document into the window to edit it, just like you do with Notepad, only to have the text document turn into an icon inside of the empty text document you had open. Fun times.
"The WordPad sample demonstrates how to implement an application that imitates the functionality of WordPad, including the user interface elements and some of the capabilities."
I should have known it wasn't the real Win95 WordPad source code since this version is written using MFC and C++.
C++ was not an approved programming language for Win95 components in its quest to run on Brad Silverberg's (Win95 manager) mom's 4MB RAM PC.
Hmm. Murray Sargent's blog post states that Win95's WordPad IS written in MFC.
from https://web.archive.org/web/20070127011040/http://blogs.msdn...:
"...RichEdit 1.0 was wrapped in MFC to produce WordPad as an example of how MFC could be used for text processing. This was shipped with Windows 95 as mentioned in the previous post."
Lots of MS groups were using C++ before Win95, including the Exchange group.
Windows for Workgroups 3.1+ included C++ code.
I recall that in the initial Win95 group meeting, C++ wasn't allowed. I moved to another team, so I don't know if that restriction was relaxed or not and/or when they allowed C++.
The email client included with Win95 wasn't allowed to use C++, including the RichEdit windows control, which had to use C for OLE code - not many other codebases could boast about that - no one signs up for that sort of masochism by choice.
One neat OLE object (btw this works even in Windows 10 - i don't know about 11) is the "package" which allows you to embed any file as an OLE object. So basically you can drop an image file, PDF, video, program or anything else in WordPad and it'll put an icon representing it that if the user double clicks it'd be equivalent to them doubleclicking a file.
Of course most of the time it isn't very practical (and WordPad chokes at anything above a handful of MB) since you're making a bad archive file (using the default .rtf format will encode the binary data in hex which will actually increase file size), but i always liked how general the idea was.
(also it isn't limited to WordPad but to anything that uses OLE - e.g. you could do the same with Delphi which has a "OLE object" control that can embed any OLE object and the object becomes part of the executable - so you could, say, throw a PDF file in a package OLE object in a form and when the user doubleclicks it the control opens the default PDF viewer)
Seems like the implementation was impractical, but it's basically what we do with Obsidian and any modern knowledge management software. Feels to me like it was ahead of its time.
OLE has always fascinated me. I’ve wanted to play around with it just to see what sort of cursed things I can do, but my eyes glaze over looking at WinAPI docs.
OLE isn't any more "malware riddled" than anything else you install on your PC, at its core it is just a fancy plugin system for embedding stuff in a document without the document editor knowing about it. OLE is as susceptible to malware as any other plugin system - in other words unless you somehow[0] install malware, you wont get malware.
[0] "somehow" here includes said malware taking advantage of unrelated security holes but this is true for everything, not just OLE
This let you do all kinds of things like embed other types of controls (like canvases or images from Paint, or Excel tables) inside your document, and WordPad's UI would jump through all the hoops to update and transform into the embedded application's UI when that control gained focus. This made it a pretty useful testing app when I was interning at MS and working on embeddable Inking surfaces for Tablet PC. (Yes, I'm a dinosaur)