[C/C++ 11 - win32] - getting problem for resize a window :(

i know resize a window, but by some reason the width isn't changed correctly :(
1
2
3
4
5
RECT a;
                GetWindowRect(hwnd,&a);
                SetWindowPos(hwnd, 0, a.left ,a.top ,intWidth,a.bottom-a.top,
                             SWP_NOZORDER | SWP_NOACTIVATE | SWP_DRAWFRAME | SWP_FRAMECHANGED | SWP_NOCOPYBITS| SWP_NOREPOSITION);
                MessageBox(NULL,to_string(GetLastError()).c_str(), "erro", MB_OK);

the error is zero... so no error.
see the image
https://onedrive.live.com/?cid=C3EF456E15C8DEB6&id=C3EF456E15C8DEB6%211264&v=3

the width is '2'(for test), but the width result isn't :(
(the window is the on off text)
so what i'm doing wrong?
Last edited on
now i found my problem: i need change the window minium size.
seems that i must use the WM_GETMINMAXINFO message. but seems not working :(
1
2
3
4
5
6
7
8
9
10
case WM_GETMINMAXINFO:
                {
                    MINMAXINFO *minformsize = (MINMAXINFO *)lParam;
                    POINT x;
                    x.x=1;
                    x.y=1;
                    minformsize->ptMinTrackSize=x;
                    return 0;
                }
                break;

what i'm doing wrong? :(
after much more tests, i found the real problem.
i changed the size before take off the window border. what i mean is the buttons(minimizate/close/maximizate/menu) give the window a minium size. so how resolve that?!? i change the order: take off the border and then i resize the window.
now works fine thanks for all
Topic archived. No new replies allowed.