RECT rec;
::GetClientRect(hWnd, &rec);
int windowWidth = rec.right - rec.left, windowHeight = rec.bottom - rec.top;
::printToDebugWindow(windowWidth,windowHeight); //prints 2 numbers
MoveWindow(hWnd,100,100,windowWidth,windowHeight,FALSE);
问题是 windowWidth 和 windowHeight 出于某种原因正在改变。MoveWindow 似乎正在改变窗口尺寸。并将 repaint 设置为 TRUE 不会改变任何内容。
输出:
x:560,y:178
x:544,y:140
x:528,y:102
x:512,y:64
x:496,y:26
为什么每次迭代都会改变尺寸?
我也试过:没有变化
int windowWidth = rec.right, windowHeight = rec.bottom;