From: Nhat Dung on 20 Sep 2009 11:49 Thanks, but that's not the problem, I try call return to check only HWND CreateSimpleToolbar(HWND hWndParent) { ................ } HWND CreateComboBox(HWND hWndParent) { ............ } HWND WINAPI CreateRebar(HWND hwndOwner, HWND hwndToolbar, HWND hwndCombo) { // Check parameters. if ((hwndToolbar == NULL) || (hwndCombo == NULL)) { return NULL; } // Initialize common controls. INITCOMMONCONTROLSEX icex; icex.dwSize = sizeof(INITCOMMONCONTROLSEX); icex.dwICC = ICC_COOL_CLASSES | ICC_BAR_CLASSES; InitCommonControlsEx(&icex); // Create the rebar. //WS_EX_TOOLWINDOW HWND hwndRebar = CreateWindowEx(0, REBARCLASSNAME, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | RBS_VARHEIGHT | CCS_NODIVIDER | RBS_BANDBORDERS, 0,0,100,100, hwndOwner, NULL, g_hInst, NULL); if(!hwndRebar) { return NULL; } // Initialize band info used by both bands. REBARBANDINFO rbBand = { sizeof(REBARBANDINFO) }; rbBand.fMask = RBBIM_STYLE // fStyle is valid. | RBBIM_TEXT // lpText is valid. | RBBIM_CHILD // hwndChild is valid. | RBBIM_CHILDSIZE // child size members are valid. | RBBIM_SIZE; // cx is valid rbBand.fStyle = RBBS_CHILDEDGE | RBBS_GRIPPERALWAYS; //RBBS_FIXEDSIZE | // Get the height of the toolbar. DWORD dwBtnSize = (DWORD)SendMessage(hwndToolbar, TB_GETBUTTONSIZE, 0,0); // Set values unique to the band with the toolbar. rbBand.lpText = TEXT(""); rbBand.hwndChild = hwndToolbar; rbBand.cyChild = LOWORD(dwBtnSize); rbBand.cxMinChild = 3 * HIWORD(dwBtnSize); rbBand.cyMinChild = LOWORD(dwBtnSize); // The default width is the width of the buttons. rbBand.cx = 0; // Add the band that has the toolbar. SendMessage(hwndRebar, RB_INSERTBAND, (WPARAM)-1, (LPARAM)&rbBand); // Set values unique to the band with the combo box. RECT rc; GetWindowRect(hwndCombo, &rc); rbBand.lpText = TEXT("Font"); rbBand.hwndChild = hwndCombo; rbBand.cxMinChild = 0; rbBand.cyMinChild = rc.bottom - rc.top; // The default width should be set to some value wider than the text. The combo // box itself will expand to fill the band. rbBand.cx = 100; // Add the band that has the combo box. SendMessage(hwndRebar, RB_INSERTBAND, (WPARAM)-1, (LPARAM)&rbBand); return (hwndRebar); }
From: Christian ASTOR on 20 Sep 2009 15:10 On 20 sep, 14:23, "Nhat Dung" <nhatd...(a)hotmail.com> wrote: > I can't see anything when run the Rebar example of MS-SDK (just see the menu > only and nothing else) > > can someone tell me what wrong ? The result is a toolbar & a combobox with > no rebar rbBand.cbSize is nor filled...
From: Christian ASTOR on 20 Sep 2009 18:26 On 20 sep, 21:10, Christian ASTOR <casto...(a)club-internet.fr> wrote: > rbBand.cbSize is nor filled... (...with REBARBANDINFO_V6_SIZE)
From: claus.kick on 21 Sep 2009 08:39 On 21 Sep., 12:28, Friedel Jantzen <nospam_...(a)freenet.de> wrote: > Am Mon, 21 Sep 2009 07:56:09 +0700 schrieb Nhat Dung: Another very useful hint is to use winspector, to check what you have created. Also, as a side note, I think you have to fill an imagelist first, before you set it for any control.
From: Nhat Dung on 21 Sep 2009 09:54 Thanks you all for help me :) I had compile my code in VC6 + XP and everything work ... fine Still can't understand why ???
First
|
Prev
|
Next
|
Last
Pages: 1 2 3 4 5 Prev: Get a HANDLE on Internet Explorer Next: Using IMAPI2 from Visual Basic 6 |