/** Determine if the specified rebar band is visible. The rebar band is identified by the ID of the band or by the zero based index of the band. This method will first translate the nID parameter to the corresponding band index. If there is no corresponding band index, the method will assume that nID is a band index. This function uses VWindow::IsVisible() to determine if the band is visible. Please note that at this point, this method will only work for bands that contain child windows. We haven't found a way yet to determine visibility of a band when a child window is not available (e.g. this may become a problem when InsertBand() is used without specifying REBARBANDINFO.hwndChild). If VWindow::IsVisibleEx() should be used to determine visibility, pass VTRUE for bUseVisibleEx, or use the IsBandVisibleEx() function.*/ VBOOL IsBandVisible( VUINT nID, VBOOL bUseVisibleEx = VFALSE) const { HWND hWnd = NULL; VINT nIndex = BandIDToIndex(nID); /* Is the specified ID is an index, retrieve the associated HWND?*/ if ( nIndex == -1 ) hWnd = IndexToHWND(nID); /* Translate ID to window handle?*/ else hWnd = ::GetDlgItem(m_hWindow, nID); /* Is the band containing the child window visible?*/ if ( hWnd ) { VTempWindow tempWindow(hWnd); if ( bUseVisibleEx ) return tempWindow.IsVisibleEx(); else return tempWindow.IsVisible(); } return VFALSE; }
static LRESULT CALLBACK WindowProcedure(HWND aHWND, UINT message, WPARAM wParam, LPARAM lParam) { CWindow tempWindow(aHWND); if (message == MY_START_WM_CREATE) tempWindow.SetUserDataLongPtr((LONG_PTR)(((LPCREATESTRUCT)lParam)->lpCreateParams)); CWindow2 *window = (CWindow2 *)(tempWindow.GetUserDataLongPtr()); if (window != NULL && message == MY_START_WM_CREATE) window->Attach(aHWND); if (window == 0) { #ifndef _UNICODE if (g_IsNT) return DefWindowProcW(aHWND, message, wParam, lParam); else #endif return DefWindowProc(aHWND, message, wParam, lParam); } return window->OnMessage(message, wParam, lParam); }