Thanks both. With your help I've got it working now.
What I was doing was looking into my idea for a real-time worms game. I had to dig out my old copy of the game to remember how the pointer pushes around the map, and discovered that as the pointer nears the edges, the game slides it back at the same speed that it scrolls the map, so it just feels like a really wide virtual screen... Hence the need for the mouse API.
At the moment I've got a 4096x1536 pixel game world. I've created some projectiles and got them to fly about and crash into the terrain and explode out a circle of it. Then I started on collision detection and had projectiles bouncing... which wasn't the best bouncing I've seen. (It's not obvious how to find normal vectors from bitmapped terrain.)
I've had some trouble with collision detection though. Each delta-time step the projectiles are moving 20 pixels or so, and sometimes that step takes them inside the terrain, (or could miss a tiny lump of terrain if it skips over it in one time step.)
So I've changed this and introduced a pixel by pixel stepping within each delta-time step. But with 100 projectiles, delta time increases, causing more pixels being traced next time step, causing delta time to increase again, etc. And the program steadily grinds to a halt, and numbers explode because of the large delta-time, causing it to crash.
I could buffer the terrain to an array instead of sampling pixels from the bitmap for the collision detection. I expect that will give me more speed. But if that isn't enough, I'm not sure how I'll fix this.