准备睡了,有个问题没弄明白,上来问下,关于SetWindowPos的问题,MSND有一段说明:
If the SWP_SHOWWINDOW or SWP_HIDEWINDOW flag is set, the window cannot be moved or sized.但是我这样用为什么还是会修改大小的?
GetDlgItem(IDC_BUTTON_SAVE)->SetWindowPos(NULL, cTempRect.left, cTempRect.top, cTempRect.Width(), cTempRect.Height()*2, SWP_SHOWWINDOW);不是说不会改变大小吗?请指教,谢谢!
If the SWP_SHOWWINDOW or SWP_HIDEWINDOW flag is set, the window cannot be moved or sized.但是我这样用为什么还是会修改大小的?
GetDlgItem(IDC_BUTTON_SAVE)->SetWindowPos(NULL, cTempRect.left, cTempRect.top, cTempRect.Width(), cTempRect.Height()*2, SWP_SHOWWINDOW);不是说不会改变大小吗?请指教,谢谢!
[in] Specifies the window sizing and positioning flags. This parameter can be a combination of the following values.
......
SWP_NOSIZE
Retains the current size (ignores the cx and cy parameters).
SWP_NOZORDER
Retains the current Z order (ignores the hWndInsertAfter parameter).
SWP_SHOWWINDOW
Displays the window.
有可能是这样,我用代码试试。
* SetWindowPos Flags
*/
#define SWP_NOSIZE 0x0001
#define SWP_NOMOVE 0x0002
#define SWP_NOZORDER 0x0004
#define SWP_NOREDRAW 0x0008
#define SWP_NOACTIVATE 0x0010
#define SWP_FRAMECHANGED 0x0020 /* The frame changed: send WM_NCCALCSIZE */
#define SWP_SHOWWINDOW 0x0040
#define SWP_HIDEWINDOW 0x0080
从宏定义来看,SWP_SHOWWINDOW并没有包括SWP_NOSIZE和SWP_NOMOVE