Click here to Skip to main content
15,897,226 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: pragma once Pin
Taka Muraoka18-Apr-03 23:19
Taka Muraoka18-Apr-03 23:19 
GeneralRe: pragma once Pin
peterchen19-Apr-03 0:25
peterchen19-Apr-03 0:25 
GeneralDeriving my own base dialog Pin
socceroli18-Apr-03 22:54
socceroli18-Apr-03 22:54 
GeneralRe: Deriving my own base dialog Pin
Bartosz Bien19-Apr-03 1:43
Bartosz Bien19-Apr-03 1:43 
GeneralGetDecryptionExponent in Crypto++ Pin
DREVET Olivier18-Apr-03 22:52
DREVET Olivier18-Apr-03 22:52 
GeneralRe: GetDecryptionExponent in Crypto++ Pin
Neville Franks19-Apr-03 1:33
Neville Franks19-Apr-03 1:33 
Questionwho can answer my question? Pin
liuty200618-Apr-03 22:45
liuty200618-Apr-03 22:45 
Generalproblem with a ToolBar Pin
cleathley@iinet18-Apr-03 20:21
cleathley@iinet18-Apr-03 20:21 
Hi All.

I am having with a toolbar rendering it'self when its created. It doesn't display the buttons except when I run my mouse over them. they all work as far as letting the application know its working..

here is the code I am using.. as you can see Its all in win32..

Hope somebody can help.. I can supply more code if needed..

Cheers

Chris



void JumpmanEditor::CreateSideBar()<br />
{<br />
	RECT rc;<br />
	GetWindowRect(m_hWnd, &rc);<br />
<br />
	m_hWndTopBar = ::CreateWindowEx(0,<br />
									 "JumpmanStaticChild",<br />
									 "",<br />
									 WS_VISIBLE | WS_CHILD,<br />
									 0,									// x<br />
									 0,									// y<br />
									 rc.right - rc.left,				// width<br />
									 TOOLBAR_HEIGHT,					// height<br />
									 m_hWnd,<br />
									 NULL,								// menu<br />
									 g_hInst,<br />
									 0);<br />
<br />
	m_hWndTopBarScroll = ::CreateWindowEx(0,<br />
										   "JumpmanStaticChild",<br />
										   "",<br />
										   WS_VISIBLE | WS_CHILD | WS_HSCROLL,<br />
										   (TOOLBAR_BUTTON_SIZE + 2) * (TBCOUNTMAIN-1),<br />
										   0,<br />
										   rc.right - rc.left,<br />
										   TOOLBAR_PALETTE_HEIGHT + SCROLL_HEIGHT,<br />
										   m_hWndTopBar,<br />
										   NULL,<br />
										   g_hInst,<br />
										   0);<br />
<br />
	m_hWndToolbarMain = CreateToolbar((TBBUTTON *)g_tbbuttonMain, TBCOUNTMAIN, m_hWndTopBar, TOOLBAR_BUTTON_SIZE, TRUE);<br />
	m_hWndToolbarPalette = CreateToolbar((TBBUTTON *)g_tbbuttonPalette, TBCOUNTPALETTE, m_hWndTopBarScroll, TOOLBAR_PALETTE_BUTTON_SIZE, FALSE);<br />
<br />
	palettescroll = 0;<br />
	SetScrollPos(m_hWndToolbarPalette, SB_HORZ, palettescroll, TRUE);<br />
<br />
	ShowWindow(m_hWndToolbarPalette, SW_SHOWNORMAL);<br />
	ShowWindow(m_hWndToolbarMain, SW_SHOWNORMAL);<br />
}<br />
<br />
<br />
<br />
HWND JumpmanEditor::CreateToolbar(TBBUTTON *p_tbbutton, int count, HWND hwndParent, int size, BOOL text)<br />
{<br />
#define MAXRESLEN 128<br />
<br />
	int i;<br />
	HWND hwnd;<br />
<br />
	hwnd = CreateToolbarEx( hwndParent,<br />
							WS_CHILD | TBSTYLE_FLAT, // | WS_VISIBLE,<br />
							1,<br />
							count,<br />
							g_hInst,<br />
							IDB_TOOLBAR,<br />
							p_tbbutton,<br />
							count,<br />
							24,			// size of the button bitmap<br />
							24,<br />
							24,<br />
							24,<br />
							sizeof(TBBUTTON));<br />
<br />
	SendMessage(hwnd, TB_SETEXTENDEDSTYLE, 0, TBSTYLE_EX_DRAWDDARROWS);<br />
<br />
	int foo;<br />
<br />
	if (text == TRUE)<br />
	{<br />
		char szBuf[MAXRESLEN];<br />
<br />
		for (i=0;i<count;i++)<br />
		{<br />
			LoadString(g_hInst, p_tbbutton[i].dwData, szBuf, MAXRESLEN-1);<br />
			szBuf[lstrlen(szBuf) + 1] = 0;  //Double-null terminate.<br />
			foo = SendMessage(hwnd, TB_ADDSTRING, 0, (LPARAM) szBuf);<br />
		}<br />
	}<br />
<br />
	SendMessage(hwnd, TB_SETBUTTONWIDTH, 0, (LPARAM)(DWORD)MAKELONG(size,size));<br />
<br />
	for (i=0;i<count;i++)<br />
	{<br />
		TBBUTTONINFO tbbi;<br />
		tbbi.cbSize = sizeof(tbbi);<br />
		tbbi.dwMask = TBIF_SIZE | TBIF_COMMAND | TBIF_STATE | TBIF_STYLE;<br />
		foo = SendMessage(hwnd, TB_GETBUTTONINFO, p_tbbutton[i].idCommand, (LPARAM)&tbbi);<br />
		// ensure all icons are the same size<br />
//		tbbi.cx = size;<br />
		foo = SendMessage(hwnd, TB_SETBUTTONINFO, p_tbbutton[i].idCommand, (LPARAM)&tbbi);<br />
	}<br />
<br />
	SendMessage(hwnd, TB_AUTOSIZE, 0, 0);<br />
<br />
	return hwnd;<br />
	}<br />

GeneralQuestion about friend function. Pin
George218-Apr-03 18:52
George218-Apr-03 18:52 
GeneralHomework alert!!! Pin
Taka Muraoka18-Apr-03 19:21
Taka Muraoka18-Apr-03 19:21 
GeneralRe: Homework alert!!! Pin
George218-Apr-03 19:26
George218-Apr-03 19:26 
GeneralRe: Homework alert!!! Pin
Taka Muraoka18-Apr-03 19:41
Taka Muraoka18-Apr-03 19:41 
GeneralRe: Homework alert!!! Pin
George218-Apr-03 20:29
George218-Apr-03 20:29 
GeneralRe: Homework alert!!! Pin
Taka Muraoka18-Apr-03 20:35
Taka Muraoka18-Apr-03 20:35 
GeneralRe: Homework alert!!! Pin
George218-Apr-03 20:43
George218-Apr-03 20:43 
GeneralRe: Homework alert!!! Pin
Nish Nishant18-Apr-03 21:46
sitebuilderNish Nishant18-Apr-03 21:46 
GeneralRe: Homework alert!!! Pin
George218-Apr-03 21:56
George218-Apr-03 21:56 
GeneralRe: Homework alert!!! Pin
Nish Nishant19-Apr-03 6:34
sitebuilderNish Nishant19-Apr-03 6:34 
GeneralRe: Homework alert!!! Pin
George219-Apr-03 18:54
George219-Apr-03 18:54 
GeneralQuestion about type conversion operator. Pin
George218-Apr-03 18:48
George218-Apr-03 18:48 
GeneralRe: Question about type conversion operator. Pin
Michael Dunn18-Apr-03 19:47
sitebuilderMichael Dunn18-Apr-03 19:47 
GeneralRe: Question about type conversion operator. Pin
George218-Apr-03 20:25
George218-Apr-03 20:25 
GeneralFTP and P2P Pin
alex.barylski18-Apr-03 13:23
alex.barylski18-Apr-03 13:23 
QuestionProgrammatically creating resource dlls? Pin
IGx8918-Apr-03 12:13
IGx8918-Apr-03 12:13 
AnswerRe: Programmatically creating resource dlls? Pin
Joe Woodbury18-Apr-03 12:44
professionalJoe Woodbury18-Apr-03 12:44 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.