// 函数声明如下:
void SetAllChildCtrlToClipSiblingStyle(HWND hwndParent);
BOOL CALLBACK ProcChildFunc(HWND hwndChild,LPARAM lParam);
// 函数实现如下:
void CUsefulDlg::SetAllChildCtrlToClipSiblingStyle(HWND hwndParent)
{
EnumChildWindows(hwndParent,ProcChildFunc,0);
}
BOOL CALLBACK ProcChildFunc(HWND hwndChild,LPARAM lParam)
{
LONG oldStyle = GetWindowLong(hwndChild,GWL_STYLE);
oldStyle |= WS_CLIPSIBLINGS;
SetWindowLong(hwndChild,GWL_STYLE,oldStyle);
return TRUE;
}
// 注意 ProcChildFunc为回调函数,应该声明为全局函数或者类的静态成员函数.