The book PDF and sample codes provided in the floppy disk of Charles Petzold's book Programming Windows 3.1.
Individual files are in the disk-files directory. Disk image of the original disk is program-win31-disk-image
Book PDF was originally obtained from this archive.org page.
Copyright for this still belongs Charles Petzold. I just felt given the age of Windows 3.1, if you have to develop an app for this, this hard-to-find content will definitely be useful.