Bitmap scroll issues
I read up on msdn's scrolling example and I applied it to a large bitmap. I made it just about equal to msdn's example and it works, but not quite right.
I start my app with a small portion of the bitmap visible, and I can scroll up and down just fine; to the end and back with no issues. When I resize the window to view more of the image though, things go wrong.
Say, when the horizontal scroll bar is in its startup position at the far left, resizing the window works as normal (resizing beyond bitmap area gets black like I want), but when the bar is changed, resizing the window has very strange effects. If I resize it beyond the width of the bitmap, the image either gets warped, or other pieces of he bitmap show up, rather than just being black.
I ask if there's antoher write up on the scrolling funcutionality or if there's a common problem I have.
You should regard the samples on MSDN as example proof of concept implementations, not bullet-proof solutions you can use in any circumstance.
Sounds like you need to trap some of the resize/scroll messages and make appropriate adjustments to your coordinate data before redrawing.
This stuff is extremely confusing...I'd like to make the window so it cannot be resized beyond the dimensions of the bitmap but WM_SIZE gets processed even if I return from it. I want it to be unresizeable from the moment it hits the bitmaps dimensions or when the maxmize button is hit I want it to expand to the dimensions of the bitmap.
I can't find a WM_MAXIMIZE so I'm not sure where to look for that.
Have a look at the WM_GETMINMAXINFO message instead.
Thanks, looks like what I'm after.