Всё я понял что мне нужно! Я хочу создать CoolBar на WinApi, как и Visual Studio С++ хотябы? Чтобы это окно докировалось к главному окну...И ещё хочу узнать как размещать кнопочки и прочие в этом окне. Нашёл исходники но они для старого Буилдера...| Код | /******************************************************* BuildRebar
*******************************************************/
HWND BuildRebar(HWND hwndParent) { HWND hwndRebar = NULL; LRESULT lResult;
hwndRebar = CreateWindowEx( WS_EX_TOOLWINDOW, REBARCLASSNAME, NULL, WS_VISIBLE | WS_BORDER | WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | RBS_VARHEIGHT | RBS_BANDBORDERS | CCS_NODIVIDER | CCS_NOPARENTALIGN | ((g_wSide & 0x01) ? CCS_VERT : 0) | //g_wSide is odd if this is a vertical bar 0, 0, 0, 200, 100, hwndParent, (HMENU)ID_REBAR, g_hInst, NULL);
if(hwndRebar) { REBARINFO rbi; HIMAGELIST himlRebar; HICON hIcon; REBARBANDINFO rbbi; HWND hwndChild; RECT rc; TCHAR szString[64];
//set up the ReBar himlRebar = ImageList_Create(32, 32, ILC_COLORDDB | ILC_MASK, 1, 0); hIcon = LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_ICON1));
ImageList_AddIcon(himlRebar, hIcon);
rbi.cbSize = sizeof(rbi); rbi.fMask = RBIM_IMAGELIST; rbi.himl = himlRebar; lResult = SendMessage(hwndRebar, RB_SETBARINFO, 0, (LPARAM)&rbi);
//add a band that contains a combobox hwndChild = CreateWindowEx( 0, TEXT("combobox"), NULL, WS_VISIBLE | WS_CHILD | WS_TABSTOP | WS_VSCROLL | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | CBS_AUTOHSCROLL | CBS_DROPDOWN | 0, 0, 0, 100, 200, hwndRebar, (HMENU)ID_COMBOBOX, g_hInst, NULL);
//add some stuff to the combobox { int i;
SendMessage(hwndChild, WM_SETFONT, (WPARAM)GetStockObject(DEFAULT_GUI_FONT), MAKELPARAM(TRUE, 0)); for(i = 0; i < 25; i++) { wsprintf(szString, TEXT("Item %d"), i + 1); SendMessage(hwndChild, CB_ADDSTRING, 0, (LPARAM)szString); } } GetWindowRect(hwndChild, &rc); ZeroMemory(&rbbi, sizeof(rbbi)); rbbi.cbSize = sizeof(REBARBANDINFO); rbbi.fMask = RBBIM_SIZE | RBBIM_CHILD | RBBIM_CHILDSIZE | RBBIM_ID | RBBIM_STYLE | RBBIM_TEXT | RBBIM_BACKGROUND | RBBIM_IMAGE | 0; rbbi.cxMinChild = rc.right - rc.left; rbbi.cyMinChild = rc.bottom - rc.top; rbbi.cx = 100; rbbi.fStyle = RBBS_CHILDEDGE | RBBS_FIXEDBMP | RBBS_GRIPPERALWAYS | 0; rbbi.wID = ID_COMBOBOX; rbbi.hwndChild = hwndChild; rbbi.lpText = TEXT("ComboBox"); rbbi.cch = 2; rbbi.hbmBack = LoadBitmap(g_hInst, MAKEINTRESOURCE(IDB_BACKGROUND)); rbbi.iImage = 0;
lResult = SendMessage(hwndRebar, RB_INSERTBAND, (WPARAM)-1, (LPARAM)(LPREBARBANDINFO)&rbbi);
//add a band that contains a button hwndChild = CreateWindowEx( 0, TEXT("button"), TEXT("Button"), WS_CHILD | BS_PUSHBUTTON | 0, 0, 0, 100, 50, hwndRebar, (HMENU)ID_BUTTON, g_hInst, NULL); GetWindowRect(hwndChild, &rc); ZeroMemory(&rbbi, sizeof(rbbi)); rbbi.cbSize = sizeof(REBARBANDINFO); rbbi.fMask = RBBIM_SIZE | RBBIM_CHILD | RBBIM_CHILDSIZE | RBBIM_ID | RBBIM_STYLE | RBBIM_TEXT | RBBIM_BACKGROUND | 0; rbbi.cxMinChild = rc.right - rc.left; rbbi.cyMinChild = rc.bottom - rc.top; rbbi.cx = 100; rbbi.fStyle = RBBS_CHILDEDGE | RBBS_FIXEDBMP | RBBS_GRIPPERALWAYS | 0; rbbi.wID = ID_BUTTON; rbbi.hwndChild = hwndChild; rbbi.lpText = TEXT("Button"); rbbi.hbmBack = LoadBitmap(g_hInst, MAKEINTRESOURCE(IDB_BACKGROUND));
lResult = SendMessage(hwndRebar, RB_INSERTBAND, (WPARAM)-1, (LPARAM)(LPREBARBANDINFO)&rbbi); }
MoveRebar(hwndParent);
return hwndRebar; } /******************************************************
MoveRebar() ******************************************************/
void MoveRebar(HWND hWnd) { RECT rc, rcRebar; int x, y, cx, cy;
GetClientRect(hWnd, &rc); GetWindowRect(GetDlgItem(hWnd, ID_REBAR), &rcRebar);
switch(g_wSide) { default: case TOP: //align the rebar along the top of the window x = 0; y = 0; cx = rc.right - rc.left; cy = rc.bottom - rc.top; break;
case LEFT: //align the rebar along the left side of the window x = 0; y = 0; cx = rcRebar.right - rcRebar.left; cy = rc.bottom - rc.top; break;
case BOTTOM: //align the rebar along the bottom of the window x = 0; y = rc.bottom - (rcRebar.bottom - rcRebar.top); cx = rc.right - rc.left; cy = rcRebar.bottom - rcRebar.top; break;
case RIGHT: //align the coolbar along the right side of the window x = rc.right - (rcRebar.right - rcRebar.left); y = 0; cx = rcRebar.right - rcRebar.left; cy = rc.bottom - rc.top; break; }
MoveWindow( GetDlgItem(hWnd, ID_REBAR), x, y, cx, cy, TRUE); } |
Появился ли в С++ .NET какой-то специальный класс или свойство, которой позволяет сделать такое докирующееся окошко? Только просьба если хоть что-нибудь знаете то скажите! Плиз! Хелп! Ахтунг! Хильфен мир зи битте! |