Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Programming Windows 3.1: Charles Petzold

Programming Windows 3.1: Charles Petzold

Scheduled Pinned Locked Moved The Lounge
c++comgraphicshardwaredata-structures
28 Posts 18 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Richard Andrew x64R Richard Andrew x64

    This old book has proven itself indispensable for Winsock programming: Network Programming for Microsoft Windows, Second Edition[^]

    The difficult we do right away... ...the impossible takes slightly longer.

    J Offline
    J Offline
    Jeremy Falcon
    wrote on last edited by
    #15

    Fancy, seeing that book makes me wonder whatever happened to Tom Archer. He be gone.

    Jeremy Falcon

    Richard Andrew x64R 1 Reply Last reply
    0
    • P PIEBALDconsult

      raddevus wrote:

      Not everyone had a mouse

      The first PC I bought (a CompuAdd 486 in 1992) came with DOS 5 and Windows 3.1 -- I assumed it included a mouse and then had to return to the store for one. :(

      T Offline
      T Offline
      trønderen
      wrote on last edited by
      #16

      A mouse story from the very early 1990s: The program that was so large that you had to take the PC cover off to give it enough space: In the days of DOS / Windows transition I was teaching at a small tech college. Another teacher was running a DOS database application (db II? My memory may fail on this), but her PC crashed fatally at application startup. She suspected a hardware problem, and took the PC to the service guys. They put it on their work desk, attached monitoring equipment at vital points on the mainboard. The db application ran flawlessly. They put the cover back on, returned the PC to the teacher's desk - and it failed. They took it back to the service desk: No problems. This turned out to be consistent: At the service desk, no problem occurred. At the lecturer's desk it failed. When the problem was diagnosed correctly, it turned out to be a function of the cover being off or on. When the cover was off, it worked fine; with the cover on, it failed. The cover was of the slide-backwards type. Lots of tower cabinets of the day was deliberately made that way to make sure you unplug the power cable to get access to the electronics. You would unplug everything at the rear panel, to the all the cables out of the way. Then you plug back in the things you need for the testing. The DOS database application was not mouse based. At least it didn't require a mouse (anyway, the crash occurred at start up). So, at the service desk, noone thought of plugging in the mouse. When returned to the teacher's desk, the PC was installed properly, plugging in the mouse as well. When the PC booted, DOS loaded the mouse driver, maybe a couple hundred bytes. It searched for a mouse, found it and said 'Fine - mouse available!' So a couple hundred bytes less RAM was available for the application. Most DOS applications were poor at detecting/handling out-of-memory conditions; they just assumed where there is an address, there will be RAM. There wasn't. At the service desk, there was no use for the mouse, so the service guys never thought of plugging it in after sliding off the cover. At boot time, the driver sought for a mouse, found none, and unloaded itself, releasing RAM used by the driver code. These couple hundred bytes extra was enough for the database application not to run into an out-of-memory condition. Until the real reason was detected, it appeared as if the application would work with the cover off, but not with the cover on.

      Religious freedom is the fre

      1 Reply Last reply
      0
      • R raddevus

        I was writing a response to a thread and talking about one of the first programming books I ever read (after C++ For Dummies), Programming Windows 3.1 by Charles Petzold. I discovered you can read the entire book at archive.org: Programming Windows 3.1 : Petzold, Charles, 1953- : Free Download, Borrow, and Streaming : Internet Archive[^] Before you start reading you should know about the hardware requirements as listed by the author: To best run Windows and the development tools, you need the following hardware: ■ An IBM personal computer (or compatible) based on the Intel 80386 microprocessor with a hard disk and 4 megabytes (MB) of memory running MS-DOS 3-3 or later. ■ A graphics display and video board, preferably compatible with the IBM VGA (Video Graphics Array) or better. ■ A mouse. Although a mouse is generally optional for most Windows programs, some of the programs in this book require one. Not everyone had a mouse. :laugh: It's such a stroll down memory lane. Also, he mentions:

        from Preface

        The chapter on text and fonts focuses on another Windows 3.1 enhancement — the introduction of the scalable outline font technology known as TrueType.

        Because you've probably never heard of TrueType fonts (TTF). :rolleyes: #### UPDATE : Get Source Code ####### If you want the source code for the examples in the book you can download them via this link: https://charlespetzold.com/src/ProgWin31.zip[^]

        R Offline
        R Offline
        Ryan Peden
        wrote on last edited by
        #17

        I still have a hard copy of this book on my shelf! The fun thing is that most of the Win16 code in the book still works with very few modifications in Win32 on Windows 11.

        1 Reply Last reply
        0
        • D Daniel Pfeffer

          I still have my dead-tree version of this book and of its sequel, Programming Windows 95. But then, I'm a packrat (aka hoarder).

          Freedom is the freedom to say that two plus two make four. If that is granted, all else follows. -- 6079 Smith W.

          J Offline
          J Offline
          jmaida
          wrote on last edited by
          #18

          ditto for me, Daniel. and not just books.

          "A little time, a little trouble, your better day" Badfinger

          1 Reply Last reply
          0
          • R raddevus

            I was writing a response to a thread and talking about one of the first programming books I ever read (after C++ For Dummies), Programming Windows 3.1 by Charles Petzold. I discovered you can read the entire book at archive.org: Programming Windows 3.1 : Petzold, Charles, 1953- : Free Download, Borrow, and Streaming : Internet Archive[^] Before you start reading you should know about the hardware requirements as listed by the author: To best run Windows and the development tools, you need the following hardware: ■ An IBM personal computer (or compatible) based on the Intel 80386 microprocessor with a hard disk and 4 megabytes (MB) of memory running MS-DOS 3-3 or later. ■ A graphics display and video board, preferably compatible with the IBM VGA (Video Graphics Array) or better. ■ A mouse. Although a mouse is generally optional for most Windows programs, some of the programs in this book require one. Not everyone had a mouse. :laugh: It's such a stroll down memory lane. Also, he mentions:

            from Preface

            The chapter on text and fonts focuses on another Windows 3.1 enhancement — the introduction of the scalable outline font technology known as TrueType.

            Because you've probably never heard of TrueType fonts (TTF). :rolleyes: #### UPDATE : Get Source Code ####### If you want the source code for the examples in the book you can download them via this link: https://charlespetzold.com/src/ProgWin31.zip[^]

            T Offline
            T Offline
            TNCaver
            wrote on last edited by
            #19

            raddevus wrote:

            Because you've probably never heard of TrueType fonts

            Wait, are TrueType fonts no longer a thing?

            There are no solutions, only trade-offs.
               - Thomas Sowell

            A day can really slip by when you're deliberately avoiding what you're supposed to do.
               - Calvin (Bill Watterson, Calvin & Hobbes)

            1 Reply Last reply
            0
            • J Jeremy Falcon

              Fancy, seeing that book makes me wonder whatever happened to Tom Archer. He be gone.

              Jeremy Falcon

              Richard Andrew x64R Offline
              Richard Andrew x64R Offline
              Richard Andrew x64
              wrote on last edited by
              #20

              Which Tom Archer do you mean? Google returns about 10,000 Tom Archers.

              The difficult we do right away... ...the impossible takes slightly longer.

              J 1 Reply Last reply
              0
              • Richard Andrew x64R Richard Andrew x64

                Which Tom Archer do you mean? Google returns about 10,000 Tom Archers.

                The difficult we do right away... ...the impossible takes slightly longer.

                J Offline
                J Offline
                Jeremy Falcon
                wrote on last edited by
                #21

                This [Tom Archer](https://www.amazon.com/Inside-C-Second-Tom-Archer-dp-0735616485/dp/0735616485/ref=dp\_ob\_title\_bk). He used to be an active CPian and we were good buddies. Been years since I last chatted with him though.

                Jeremy Falcon

                1 Reply Last reply
                0
                • B BernardIE5317

                  That book started me on my so called career as a programmer. After reading his implementation of a hex editor I thought long and hard for 15 minutes and decided I could do better. I then spent the next 4 years implementing the world's then only user configurable binary file editor aka "FileRay". A copy can be found on the Wayback machine. By the way if you need such an editor I highly recommend the only one of its kind today id est "010 Editor" by Sweetscape Software. It is a pleasure to utilize. "If you try to fail, and succeed, which have you done?" - George Carlin

                  D Offline
                  D Offline
                  den2k88
                  wrote on last edited by
                  #22

                  Well mate you just suggested me a piece of software I always looked for. Kudos to you!

                  GCS/GE d--(d) s-/+ a C+++ U+++ P-- L+@ E-- W+++ N+ o+ K- w+++ O? M-- V? PS+ PE Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- r+++ y+++*      Weapons extension: ma- k++ F+2 X The shortest horror story: On Error Resume Next

                  1 Reply Last reply
                  0
                  • R raddevus

                    I was writing a response to a thread and talking about one of the first programming books I ever read (after C++ For Dummies), Programming Windows 3.1 by Charles Petzold. I discovered you can read the entire book at archive.org: Programming Windows 3.1 : Petzold, Charles, 1953- : Free Download, Borrow, and Streaming : Internet Archive[^] Before you start reading you should know about the hardware requirements as listed by the author: To best run Windows and the development tools, you need the following hardware: ■ An IBM personal computer (or compatible) based on the Intel 80386 microprocessor with a hard disk and 4 megabytes (MB) of memory running MS-DOS 3-3 or later. ■ A graphics display and video board, preferably compatible with the IBM VGA (Video Graphics Array) or better. ■ A mouse. Although a mouse is generally optional for most Windows programs, some of the programs in this book require one. Not everyone had a mouse. :laugh: It's such a stroll down memory lane. Also, he mentions:

                    from Preface

                    The chapter on text and fonts focuses on another Windows 3.1 enhancement — the introduction of the scalable outline font technology known as TrueType.

                    Because you've probably never heard of TrueType fonts (TTF). :rolleyes: #### UPDATE : Get Source Code ####### If you want the source code for the examples in the book you can download them via this link: https://charlespetzold.com/src/ProgWin31.zip[^]

                    D Offline
                    D Offline
                    den2k88
                    wrote on last edited by
                    #23

                    Memories of learning programming with GWBASIC on DOS 4.0. It was already OLD when I started (it was the year 1998) but I could use a dismissed Compaq 486 laptop as my test bench and I already knew how to set up a machine with any DOS and Windows system (learnt way back in 1995, I was 7) so I wasn't new to the command line and I couldn't mess the home computer. In 2002 my dad got me VisualStudio 6 and a very good VB6 book, which actually got me into "serious" programming. Boy did I suck. My only software wrote as a self-taught programmer did work but was everything a program shouldn't be. Fortune wanted the language we developed in high school from the 3rd year was exactly VB6 and the teacher was awesome in teaching the basics (from flow chart to pseudocode, troubleshooting technicques and formal verification). I also later learnt she also taught my first Computer Science college professor, who was awesome as well. Sorry for rambling, it was just a trip down memory lane.

                    GCS/GE d--(d) s-/+ a C+++ U+++ P-- L+@ E-- W+++ N+ o+ K- w+++ O? M-- V? PS+ PE Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- r+++ y+++*      Weapons extension: ma- k++ F+2 X The shortest horror story: On Error Resume Next

                    D 1 Reply Last reply
                    0
                    • R raddevus

                      I was writing a response to a thread and talking about one of the first programming books I ever read (after C++ For Dummies), Programming Windows 3.1 by Charles Petzold. I discovered you can read the entire book at archive.org: Programming Windows 3.1 : Petzold, Charles, 1953- : Free Download, Borrow, and Streaming : Internet Archive[^] Before you start reading you should know about the hardware requirements as listed by the author: To best run Windows and the development tools, you need the following hardware: ■ An IBM personal computer (or compatible) based on the Intel 80386 microprocessor with a hard disk and 4 megabytes (MB) of memory running MS-DOS 3-3 or later. ■ A graphics display and video board, preferably compatible with the IBM VGA (Video Graphics Array) or better. ■ A mouse. Although a mouse is generally optional for most Windows programs, some of the programs in this book require one. Not everyone had a mouse. :laugh: It's such a stroll down memory lane. Also, he mentions:

                      from Preface

                      The chapter on text and fonts focuses on another Windows 3.1 enhancement — the introduction of the scalable outline font technology known as TrueType.

                      Because you've probably never heard of TrueType fonts (TTF). :rolleyes: #### UPDATE : Get Source Code ####### If you want the source code for the examples in the book you can download them via this link: https://charlespetzold.com/src/ProgWin31.zip[^]

                      T Offline
                      T Offline
                      theoldfool
                      wrote on last edited by
                      #24

                      Yup, had that book. Dipped my toes in the Windows development world. 386SX system, Microsoft C on diskettes. Had some Microsoft book on graphics for DOS (memory vague here). First project was creating a "bird" (2 triangles) flying around the screen bouncing of the 4 edges. Proud, I was. First comment was something like: "that looks like crap!". Truth often hurts. Real project was on a fabricated, vehicle mounted "laptop" with mono screen. No flying birds.

                      >64 It’s weird being the same age as old people. Live every day like it is your last; one day, it will be.

                      R 1 Reply Last reply
                      0
                      • D Daniel Pfeffer

                        I still have my dead-tree version of this book and of its sequel, Programming Windows 95. But then, I'm a packrat (aka hoarder).

                        Freedom is the freedom to say that two plus two make four. If that is granted, all else follows. -- 6079 Smith W.

                        D Offline
                        D Offline
                        dandy72
                        wrote on last edited by
                        #25

                        I threw out a number of old books some years ago (unrelated: my local library doesn't accept anything older than 5 years, WTF) but I made a point of keeping that one.

                        1 Reply Last reply
                        0
                        • D den2k88

                          Memories of learning programming with GWBASIC on DOS 4.0. It was already OLD when I started (it was the year 1998) but I could use a dismissed Compaq 486 laptop as my test bench and I already knew how to set up a machine with any DOS and Windows system (learnt way back in 1995, I was 7) so I wasn't new to the command line and I couldn't mess the home computer. In 2002 my dad got me VisualStudio 6 and a very good VB6 book, which actually got me into "serious" programming. Boy did I suck. My only software wrote as a self-taught programmer did work but was everything a program shouldn't be. Fortune wanted the language we developed in high school from the 3rd year was exactly VB6 and the teacher was awesome in teaching the basics (from flow chart to pseudocode, troubleshooting technicques and formal verification). I also later learnt she also taught my first Computer Science college professor, who was awesome as well. Sorry for rambling, it was just a trip down memory lane.

                          GCS/GE d--(d) s-/+ a C+++ U+++ P-- L+@ E-- W+++ N+ o+ K- w+++ O? M-- V? PS+ PE Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- r+++ y+++*      Weapons extension: ma- k++ F+2 X The shortest horror story: On Error Resume Next

                          D Offline
                          D Offline
                          dandy72
                          wrote on last edited by
                          #26

                          den2k88 wrote:

                          Boy did I suck. My only software wrote as a self-taught programmer did work but was everything a program shouldn't be.

                          Some would argue this is exactly where VB leads beginners. I personally probably haven't done enough VB to make that judgement call myself, but it *is* the comment that keeps coming back - that it teaches bad habits that are then hard to break out of.

                          D 1 Reply Last reply
                          0
                          • T theoldfool

                            Yup, had that book. Dipped my toes in the Windows development world. 386SX system, Microsoft C on diskettes. Had some Microsoft book on graphics for DOS (memory vague here). First project was creating a "bird" (2 triangles) flying around the screen bouncing of the 4 edges. Proud, I was. First comment was something like: "that looks like crap!". Truth often hurts. Real project was on a fabricated, vehicle mounted "laptop" with mono screen. No flying birds.

                            >64 It’s weird being the same age as old people. Live every day like it is your last; one day, it will be.

                            R Offline
                            R Offline
                            raddevus
                            wrote on last edited by
                            #27

                            386SX -- 32-bit chip (internally) with 16-bit bus access. :thumbsup:

                            1 Reply Last reply
                            0
                            • D dandy72

                              den2k88 wrote:

                              Boy did I suck. My only software wrote as a self-taught programmer did work but was everything a program shouldn't be.

                              Some would argue this is exactly where VB leads beginners. I personally probably haven't done enough VB to make that judgement call myself, but it *is* the comment that keeps coming back - that it teaches bad habits that are then hard to break out of.

                              D Offline
                              D Offline
                              den2k88
                              wrote on last edited by
                              #28

                              Oh no it wasn't anything inherent to VB, writing 1000 lines undocumented functions can be done (and I saw it multiple times by so-called professionals) in any language. I worked a lot on VB6 in my first company and honestly I liked it. It lacked some features and had a few quirks but for its role it's really comfortable. It gives a lot less bad habits than its strongest current competitor, which in my opinion is Python. As a quick GUI to call library functions it's just unbeatable, but take my opinion with a massive grain of salt - if some crazy mofo in MS will ever release a VB7 I'd jump on it in .3 nanoseconds.

                              GCS/GE d--(d) s-/+ a C+++ U+++ P-- L+@ E-- W+++ N+ o+ K- w+++ O? M-- V? PS+ PE Y+ PGP t+ 5? X R+++ tv-- b+(+++) DI+++ D++ G e++ h--- r+++ y+++*      Weapons extension: ma- k++ F+2 X The shortest horror story: On Error Resume Next

                              1 Reply Last reply
                              0
                              Reply
                              • Reply as topic
                              Log in to reply
                              • Oldest to Newest
                              • Newest to Oldest
                              • Most Votes


                              • Login

                              • Don't have an account? Register

                              • Login or register to search.
                              • First post
                                Last post
                              0
                              • Categories
                              • Recent
                              • Tags
                              • Popular
                              • World
                              • Users
                              • Groups