Click here to Skip to main content
15,916,378 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Detect user's language for user interface Pin
Nemanja Trifunovic14-Apr-08 8:31
Nemanja Trifunovic14-Apr-08 8:31 
GeneralRe: Detect user's language for user interface Pin
Randor 14-Apr-08 9:00
professional Randor 14-Apr-08 9:00 
GeneralRe: Detect user's language for user interface Pin
Randor 14-Apr-08 9:02
professional Randor 14-Apr-08 9:02 
GeneralProblem customizing tree control [modified] Pin
Jim Crafton14-Apr-08 4:31
Jim Crafton14-Apr-08 4:31 
GeneralRe: Problem customizing tree control Pin
enhzflep14-Apr-08 5:02
enhzflep14-Apr-08 5:02 
GeneralRe: Problem customizing tree control Pin
Jim Crafton14-Apr-08 5:08
Jim Crafton14-Apr-08 5:08 
GeneralRe: Problem customizing tree control Pin
Jim Crafton14-Apr-08 5:11
Jim Crafton14-Apr-08 5:11 
GeneralRe: Problem customizing tree control [modified] Pin
enhzflep14-Apr-08 5:49
enhzflep14-Apr-08 5:49 
Well this code is written using win32++ as I don't have access to a mfc enabled copy of VS, but I'd (foolishly?) assume that it would work just the same in either case.

The code I posted will decrease the size(height) of the window, while increasing the size(height) of the non-client area.

The header will respond in just the same way as the non-client area for a tree control normally will. The window proc for this control only handles WM_NCCALCSIZE and WM_NCPAINT messages, passing any others to the original wind proc.

Here's what the wind proc for the class looks like in it's entirety:
LRESULT CLeftView::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
	switch (uMsg)
	{	
	case WM_NCCALCSIZE:
		return OnNcCalcSize(wParam, lParam);

	case WM_NCPAINT:
		return OnNcPaint(wParam, lParam);
	}
	
	// Pass unhandled messages on to parent WndProc
	return WndProcDefault(hWnd, uMsg, wParam, lParam);
}


I'm afraid I have no recollection of where I picked this trick up, though it seems to work just fine. If I've left things unexplained, or you like the class source, I'd be happy to expand on what I've said, or mail you a copy of the class.

Simon.

[EDIT: Oops, looks like I misread that first post. Sorry 'bout that Jim. I've not used the functions you mention before, I'll see if I cant come up with something that achieves this affect using them.]

modified on Monday, April 14, 2008 12:25 PM

GeneralFind All Window Pin
john563214-Apr-08 3:52
john563214-Apr-08 3:52 
GeneralRe: Find All Window Pin
JudyL_MD14-Apr-08 4:10
JudyL_MD14-Apr-08 4:10 
GeneralRe: Find All Window Pin
john563214-Apr-08 4:14
john563214-Apr-08 4:14 
GeneralRe: Find All Window Pin
JudyL_MD14-Apr-08 4:28
JudyL_MD14-Apr-08 4:28 
QuestionRe: Find All Window Pin
David Crow14-Apr-08 4:13
David Crow14-Apr-08 4:13 
QuestionFont/FontSize Pin
C++NewBe14-Apr-08 2:34
C++NewBe14-Apr-08 2:34 
GeneralRe: Font/FontSize Pin
Cedric Moonen14-Apr-08 2:38
Cedric Moonen14-Apr-08 2:38 
GeneralRe: Font/FontSize Pin
CPallini14-Apr-08 3:27
mveCPallini14-Apr-08 3:27 
QuestionRe: Font/FontSize Pin
David Crow14-Apr-08 3:44
David Crow14-Apr-08 3:44 
GeneralRe: Font/FontSize Pin
C++NewBe14-Apr-08 3:52
C++NewBe14-Apr-08 3:52 
QuestionRe: Font/FontSize Pin
David Crow14-Apr-08 3:56
David Crow14-Apr-08 3:56 
GeneralRe: Font/FontSize Pin
C++NewBe14-Apr-08 4:04
C++NewBe14-Apr-08 4:04 
QuestionRe: Font/FontSize Pin
David Crow14-Apr-08 4:15
David Crow14-Apr-08 4:15 
GeneralRe: Font/FontSize Pin
C++NewBe14-Apr-08 4:21
C++NewBe14-Apr-08 4:21 
GeneralRe: Font/FontSize Pin
David Crow14-Apr-08 4:26
David Crow14-Apr-08 4:26 
GeneralQuery regarding ListBox Pin
Rahul Vaishnav14-Apr-08 2:29
Rahul Vaishnav14-Apr-08 2:29 
AnswerRe: Query regarding ListBox Pin
Rajesh R Subramanian14-Apr-08 2:36
professionalRajesh R Subramanian14-Apr-08 2:36 

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.