Windows programming

Moderators: None (Apply to moderate this forum)
Number of threads: 3711
Number of posts: 9173

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Combobox on toolbar Posted by oxygenium on 13 Oct 2003 at 9:31 AM
I want to create a toolbar with a combobox on it. But in MSDN there's only a TBSTYLE_DROPDOWN button style. I suppose that it could be done with owner drawn button, but I didn't found out how can I create it.

Oxygenium
Report
Re: Combobox on toolbar Posted by chick80 on 15 Oct 2003 at 11:43 AM
Why don't you use a rebar that contains the combobox and the toolbar? It's an easiest way to do it (owner drawn buttons give lots of problems...).

nICO



How beautiful, if Sorrow had not made sorrow more beautiful than Beauty itself.
JOHN KEATS


Report
Re: Combobox on toolbar Posted by oxygenium on 16 Oct 2003 at 9:17 AM
: Why don't you use a rebar that contains the combobox and the toolbar? It's an easiest way to do it (owner drawn buttons give lots of problems...).
:
: nICO
:
:

: How beautiful, if Sorrow had not made sorrow more beautiful than Beauty itself.
: JOHN KEATS
:
:
:

Yeah... I decided to do so too. But I'm having problems with creating theese bars in rebar. I'm doing it just like in the example in the documentation, but it doesn't work!

/*
	fce:						createToolbars

	popis:						Vytvori rebar s toolbarem a comboboxem
*/
HWND createToolbars (HWND hWnd) 
{
	//vytvorim rebar
	HWND rebar = CreateWindowEx (
		WS_EX_TOOLWINDOW,
		TOOLBARCLASSNAME,
		NULL,
		WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN
			| RBS_VARHEIGHT,
		0, 0, 0, 0,
		hWnd,
		(HMENU)IDC_REBAR, 
		hInstance, 
		NULL
	);

	REBARINFO ri;
	ri.cbSize	= sizeof (ri);
	ri.fMask	= 0;
	ri.himl		= NULL;

	SendMessage (rebar, RB_SETBARINFO, 0, (LPARAM)&ri);

	//pridam toolbar a combobox
	REBARBANDINFO rbi;	

	rbi.cbSize	= sizeof (rbi);
	rbi.fMask	= RBBIM_STYLE | RBBIM_CHILD;

	//toolbar
	rbi.hwndChild	= createTopToolbar (rebar);
	rbi.cyMaxChild	= 500;	
	rbi.cyMinChild	= 100;
	rbi.cyChild	= 200;
	rbi.cx		= 200;

	if (!SendMessage (rebar, RB_INSERTBAND, (WPARAM)-1, (LPARAM)&rbi))
		MessageBeep (0);
	return rebar;
}


I don't have even an idea what's wrong (of course that you'll look at it and see a huge mistake :). At least I hope so...).

Oxygenium
Report
Re: Combobox on toolbar Posted by chick80 on 16 Oct 2003 at 11:14 AM
The code seems right, but I doubt you could create a rebar if you specify TOOLBARCLASSNAME as the window class... ;) REBARCLASSNAME should work!

nICO



How beautiful, if Sorrow had not made sorrow more beautiful than Beauty itself.
JOHN KEATS


Report
Re: Combobox on toolbar Posted by oxygenium on 17 Oct 2003 at 8:57 AM
: The code seems right, but I doubt you could create a rebar if you specify TOOLBARCLASSNAME as the window class... ;) REBARCLASSNAME should work!
:
: nICO
:
:

: How beautiful, if Sorrow had not made sorrow more beautiful than Beauty itself.
: JOHN KEATS
:
:
:

Oopps.. o_O I had to be very tired yesterday... Thanks...

Oxygenium



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.