16,473
社区成员
发帖
与我相关
我的任务
分享
void OnWindowPosChanged(WINDOWPOS* lpwndpos)里面可以这样写,
BOOL bSWP_DRAWFRAME = ((lpwndpos->flags & SWP_DRAWFRAME ) == SWP_DRAWFRAME );
BOOL bSWP_FRAMECHANGED = ((lpwndpos->flags & SWP_FRAMECHANGED ) == SWP_FRAMECHANGED );
BOOL bSWP_HIDEWINDOW = ((lpwndpos->flags & SWP_HIDEWINDOW ) == SWP_HIDEWINDOW );
BOOL bSWP_NOACTIVATE = ((lpwndpos->flags & SWP_NOACTIVATE ) == SWP_NOACTIVATE );
BOOL bSWP_NOCOPYBITS = ((lpwndpos->flags & SWP_NOCOPYBITS ) == SWP_NOCOPYBITS );
BOOL bSWP_NOMOVE = ((lpwndpos->flags & SWP_NOMOVE ) == SWP_NOMOVE );
BOOL bSWP_NOOWNERZORDER = ((lpwndpos->flags & SWP_NOOWNERZORDER ) == SWP_NOOWNERZORDER );
BOOL bSWP_NOREDRAW = ((lpwndpos->flags & SWP_NOREDRAW ) == SWP_NOREDRAW );
BOOL bSWP_NOREPOSITION = ((lpwndpos->flags & SWP_NOREPOSITION ) == SWP_NOREPOSITION );
BOOL bSWP_NOSENDCHANGING = ((lpwndpos->flags & SWP_NOSENDCHANGING) == SWP_NOSENDCHANGING);
BOOL bSWP_NOSIZE = ((lpwndpos->flags & SWP_NOSIZE ) == SWP_NOSIZE );
BOOL bSWP_NOZORDER = ((lpwndpos->flags & SWP_NOZORDER ) == SWP_NOZORDER );
BOOL bSWP_SHOWWINDOW = ((lpwndpos->flags & SWP_SHOWWINDOW ) == SWP_SHOWWINDOW );
BOOL bTop = (
bSWP_DRAWFRAME == FALSE &&
bSWP_FRAMECHANGED == FALSE &&
bSWP_HIDEWINDOW == FALSE &&
bSWP_NOACTIVATE == FALSE &&
bSWP_NOCOPYBITS == FALSE &&
bSWP_NOMOVE == TRUE &&
bSWP_NOOWNERZORDER == FALSE &&
bSWP_NOREDRAW == FALSE &&
bSWP_NOREPOSITION == FALSE &&
bSWP_NOSENDCHANGING == FALSE &&
bSWP_NOSIZE == TRUE &&
bSWP_NOZORDER == FALSE &&
bSWP_SHOWWINDOW == FALSE);
if (bTop == TRUE)
{
// 感觉这个方法有些不是很优美,不知道有没有啥缺陷或者更好的方法
}