GithubHelp home page GithubHelp logo

petzold-pw5e-zig's Introduction

petzold-pw5e-zig

Zig transliteration of Charles Petzold's excellent book Programming Windows 5th Edition ISBN-10 157231995X


Not much content yet. The Zig (beta) release is at 0.10.0 at the time of writing.

The code works with Zig 0.9.1 - it requires tweaking to work with 0.10.0 and that won't happen until after zigwin32 has been updated to work with Zig 0.10.0


Notes

  • This project uses zigwin32 to eliminate importing the Windows header files directly. (Which is good as @cImport() has issues parsing the complexities of said Windows header files.)

  • Unlike C/C++ there is no WIN32_LEAN_AND_MEAN to reduce the #include C header file burden. Zig is quick enough.

  • marlersoft/zigwin32gen#9 causes occasional memory align panics with CreateWindowExW and other functions. To fix align(1) needs to be added to the offending parameter in the zigwin32 declarations.

    • CreateWindowExW(), CreateWindowExA() - 2nd (lpClassName) parameter
    • LoadImageW(), LoadImageA() - 2nd (name) parameter
  • TextOutW(), TextOutA() the lpString parameter does not need to be zero terminated.

  • IDC_ARROW is present in zigwin32, but IDC_WAIT and others have been skipped. Probably to avoid the align(1) issues.

  • LoadIcon & LoadCursor functions have been superseded by the LoadImage function.

  • GetWindowLongPtr/GetWindowLongPtr functions are correctly mapped to GetWindowLong/SetWindowLong for 32 bit systems. No need to panic.

  • There is no replacement for the CreateWindow macro in WinUser.h that maps to CreateWindowEx

  • missing StringCchCopy and its ilk from strsafe.h

petzold-pw5e-zig's People

Contributors

recombinant avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.