J
Oder etwas in der Art:
void EnableWindowGroup(HWND hwnd, int enable)
{
// Find first window of group
while (hwnd && !(::GetWindowLong(hwnd,GWL_STYLE) & WS_GROUP))
hwnd = ::GetWindow(hwnd, GW_HWNDPREV);
if (!hwnd) {
ASSERT(FALSE);
return;
}
// Perform operation for all windows of this group
do {
if (!enable) {
::EnableWindow(hwnd, FALSE); ::ShowWindow(hwnd, SW_SHOW);
}
else if (enable > 0) {
::EnableWindow(hwnd, TRUE); ::ShowWindow(hwnd, SW_SHOW);
}
else {
::ShowWindow(hwnd, SW_HIDE); ::EnableWindow(hwnd, FALSE);
}
// Cannot use GetNextDlgGroupItem() here,
// because hidden windows are skipped by Windows.
hwnd = ::GetWindow(hwnd,GW_HWNDNEXT);
} while (hwnd && !(::GetWindowLong(hwnd,GWL_STYLE) & WS_GROUP));
}
und an das HWND eines CWnd kommst Du ja über dessen Membervariable m_hWnd
P.S: Sorry, die Formatierung ist leider etwas aus dem Tritt geraten, da ich hier ne Tabsize von 4 eingestellt habe.
P.P.S: Sowas sollte man eigentlich in die FAQ packen!