velo-toolchain Press
The Velo CE Primer Programming Windows CE 1.0 and 2.0 on the Philips Velo 1
Includes six example programs and screenshotsA beginner's guide for competent programmers: from an empty folder to windows, dialogs, sockets and two real projects, built on your Mac with velo-toolchain and tested in velo-emu.
What's Inside
Each chapter builds on the last, but the later ones work as a reference too. If you've written Win32 programs before, skim chapters 1 to 3 for the parts marked as different on CE.
- Meet the VeloThe hardware, Windows CE 1.0 and 2.0, and how CE differs from the Windows you know.
- Toolchain and EmulatorInstall, build your first program, run it in velo-emu, debug it with GDB and VS Code.
- Win32 in a HurryWinMain, the message loop, window procedures, painting, the pen and the keyboard.
- Screen Layout CookbookFive layouts with screenshots: two panes, list and details, a dialog, tabs and controls, custom drawing.
- Strings, Memory, Files and the RegistryLife without a C library, Unicode, the object store, cards, settings, processes and DLLs.
- Networking and ThreadsWinsock, HTTP through the proxy, worker threads and talking to the user interface safely.
- Project: A Bluesky ClientThe AT Protocol calls, sessions, JSON, pictures and how velo-bluesky fits together.
- Project: An App StoreCatalogues, downloads, installing, shortcuts, uninstalling and free space.
- ReferenceWhat exists on CE 1.0 and 2.0, messages, gotchas, a glossary and further reading.
Before You Start
You'll need a Mac or Linux machine with these, all covered in chapter 2:
- velo-toolchain (this repository) with Homebrew's
llvm,lldandcmake. - A built velo-emu checkout and its ROMs, to run what you build.
- Optionally Homebrew's
gdband VS Code with the C/C++ and CMake Tools extensions, for debugging.
You should be comfortable with C: pointers, structs, function pointers and building with CMake. You don't need to know anything about Windows.
How to Read This Book
Code you can type or copy is printed on green-bar paper. The label at the top says which file it's from:
#include <windows.h>
int WINAPI WinMain(HINSTANCE instance, HINSTANCE previous, LPWSTR command_line, int show) {
MessageBoxW(0, L"Hello from velo-toolchain!", L"Hello", MB_OK | MB_ICONINFORMATION);
return 0;
}
Listings marked with a file name are copied from that file in the repository, as it was when this primer was written. Names in this style are functions, messages, files and settings. Keys look like Ctrl+N.
Screenshots come in pairs, CE 1.0 on the left with its four greys and CE 2.0 on the right with sixteen, taken from velo-emu's simulated LCD. To make them again:
make primer-screenshots
That needs the same settings as make test, listed in the repository's README.md. The example programs are in docs/primer/examples, and build with:
make primer