Dave's Brain

Browse - programming tips - missing lbn selchange message

Date: 2009jan5
Platform: win32
Language: C/C++

Q.  Why am I not getting a LBN_SELCHANGE from my listbox?

A. Does the listbox have LBS_NOTIFY style?

Are you looking for it in the right place?
It's in a WM_COMMAND to the parent.

Example code that works:

static BOOL FAR PASCAL MyDlgProc(const HWND hDlg, UINT message, WPARAM wParam, LPARAM)
{
	switch (message)
	{
	case WM_COMMAND:
   		switch(LOWORD(wParam))
		{
   		case IDC_WEEKS:
			if (HIWORD(wParam) == LBN_SELCHANGE)
       			{
				// Do something
         		}
         		break;
		}
	}
}
What this info useful to you? You can donate to say thanks

Add a comment

Sign in to add a comment
Copyright © 2008-2012, dave - Code samples on Dave's Brain is licensed under the Creative Commons Attribution 2.5 License. However other material, including English text has all rights reserved.
Advertisements: