C语言的问题,注释1和2,3有什么区别啊,怎么2,3就行,而1就不行static CRect m_largewindow(0,0,0,0);static CRect m_smallwindow(0,0,0,0);GetWindowRect(&m_largewindow);m_smallwindow.right=m_largewindow.right-100; //1//m_smallwindow=m_larg
来源:学生作业帮助网 编辑:作业帮 时间:2024/07/18 22:57:09
![C语言的问题,注释1和2,3有什么区别啊,怎么2,3就行,而1就不行static CRect m_largewindow(0,0,0,0);static CRect m_smallwindow(0,0,0,0);GetWindowRect(&m_largewindow);m_smallwindow.right=m_largewindow.right-100; //1//m_smallwindow=m_larg](/uploads/image/z/14632761-57-1.jpg?t=C%E8%AF%AD%E8%A8%80%E7%9A%84%E9%97%AE%E9%A2%98%2C%E6%B3%A8%E9%87%8A1%E5%92%8C2%2C3%E6%9C%89%E4%BB%80%E4%B9%88%E5%8C%BA%E5%88%AB%E5%95%8A%2C%E6%80%8E%E4%B9%882%2C3%E5%B0%B1%E8%A1%8C%2C%E8%80%8C1%E5%B0%B1%E4%B8%8D%E8%A1%8Cstatic+CRect+m_largewindow%280%2C0%2C0%2C0%29%3Bstatic+CRect+m_smallwindow%280%2C0%2C0%2C0%29%3BGetWindowRect%28%26m_largewindow%29%3Bm_smallwindow.right%3Dm_largewindow.right-100%3B+%2F%2F1%2F%2Fm_smallwindow%3Dm_larg)
C语言的问题,注释1和2,3有什么区别啊,怎么2,3就行,而1就不行static CRect m_largewindow(0,0,0,0);static CRect m_smallwindow(0,0,0,0);GetWindowRect(&m_largewindow);m_smallwindow.right=m_largewindow.right-100; //1//m_smallwindow=m_larg
C语言的问题,注释1和2,3有什么区别啊,怎么2,3就行,而1就不行
static CRect m_largewindow(0,0,0,0);
static CRect m_smallwindow(0,0,0,0);
GetWindowRect(&m_largewindow);
m_smallwindow.right=m_largewindow.right-100; //1
//m_smallwindow=m_largewindow;//2
//m_smallwindow.right -=200;//3
C语言的问题,注释1和2,3有什么区别啊,怎么2,3就行,而1就不行static CRect m_largewindow(0,0,0,0);static CRect m_smallwindow(0,0,0,0);GetWindowRect(&m_largewindow);m_smallwindow.right=m_largewindow.right-100; //1//m_smallwindow=m_larg
从道理上说,应当都可以.
前两句是初始化,矩形的四个参数都是0.
然后是计算:
1,两个成员间的right的计算
2,结构给结构赋值
3,成员right的自减.
GetWindowRect 函数调用失败?你可以测定一下
int flag;
flag = GetWindowRect(&m_largewindow);
if (flag == 0) 函数调用失败.
另外,试试 去掉 static 看能否通过.