about window size
I create a window in the height of 691. Then i create a rectangle and fill it with some paint. The rectangle (which is the "STATIC" class actually) is also height 691, but the problem is that it exceed the window, I have to pull the border (to make it higher) pretty much in order to see its end.
Any ideas what happening?
You are getting window size confused with client size. The window size is the entire window, which includes the borders, and title bar. The client size is the part of the window that you can actually draw on. When you draw your rectangle, call GetClientRect() to see the size of the client area which you can draw on.
If you want the whole window to be 691 then call GetClientRect() and the area you can draw (client area) on will be returned (as Bithub says).
If you want an area to draw on (client area) of 691 then look at AdjustWindowRect() to find the required window size.