Exemplo n.º 1
0
///////////////////////////////////////////////////////////////////////////////
// Enumeration aller aktuellen Recherchefenster
BOOL CORWndStatistics::EnumORWnds(HWND hWnd, BOOL, UINT_PTR *pData)
{
// Namen des RechercheFensters besorgen
DWORD dwBmp = IMG_STATFUNC_ORWND_NODE;
char cbBuffer[_MAX_PATH];
CWindow Wnd(hWnd);

    Wnd.GetWindowText(cbBuffer, sizeof(cbBuffer));

char *left_paren = strrchr(cbBuffer, '(');

    if (NULL != left_paren)
        *left_paren = '\0';

// Item in Baum einhängen und mit dummy [+] versehen
HTREEITEM hRoot = *reinterpret_cast<HTREEITEM *>(pData);
HTREEITEM hItem = InsertItem(cbBuffer, IMG_STATFUNC_ORWND_NODE, 
    IMG_STATFUNC_ORWND_NODE, hRoot, TVI_LAST);
TV_ITEM tvi;

	tvi.mask = TVIF_HANDLE|TVIF_CHILDREN|TVIF_PARAM;
	tvi.hItem = hItem;
	tvi.cChildren = 1;
	tvi.lParam = reinterpret_cast<LPARAM>(new CORWndItemCallback(hWnd, hItem));
	SetItem(&tvi);
	return TRUE;
}
Exemplo n.º 2
0
void Window::CenterVerticallyBetweenTwoWindows(Window topWnd, Window bottomWnd)
{ // assuming all windows are in the same parent
	
	// - find the yposition to place the window
	// - find the distance between the two windows
	// - compute the center based on the distance and 
	//   the height of the window to be centered.
	UINT distance = bottomWnd.TopWindow() - topWnd.BottomWindow(),
		 y = midpoint<UINT>(distance, ClientHeight());

	SetWindowPos(Wnd(), NULL, 5, y, 0, 0, SWP_NOSIZE);
}