Click here to Skip to main content
15,900,511 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Win32 control compositing Pin
Ryan Binns9-Sep-04 18:46
Ryan Binns9-Sep-04 18:46 
GeneralRe: Win32 control compositing Pin
Jim Crafton10-Sep-04 5:25
Jim Crafton10-Sep-04 5:25 
GeneralRe: Win32 control compositing Pin
Ryan Binns10-Sep-04 22:29
Ryan Binns10-Sep-04 22:29 
GeneralRe: Win32 control compositing Pin
Blake Miller13-Sep-04 6:32
Blake Miller13-Sep-04 6:32 
GeneralRe: Win32 control compositing Pin
Ryan Binns13-Sep-04 20:42
Ryan Binns13-Sep-04 20:42 
GeneralList Control : Can't change focus w/ tab key Pin
Wes Jones9-Sep-04 7:37
Wes Jones9-Sep-04 7:37 
GeneralRe: List Control : Can't change focus w/ tab key Pin
David Crow9-Sep-04 11:02
David Crow9-Sep-04 11:02 
GeneralRe: List Control : Can't change focus w/ tab key Pin
Wes Jones9-Sep-04 12:55
Wes Jones9-Sep-04 12:55 
Thanks for the reply! It was happening in every instance where my List Control was using my CListCtrl derived class that returned DLGC_WANTALLKEYS from OnGetDlgCode().

I came up a fix for it tho, which was to manually set the focus to the next window in the z-order (z-order == tab order).

Here's what my fix looked like:
BOOL CListCtrlEx::PreTranslateMessage(MSG* pMsg) 
{
	//
	//  Capture the Key press for the TAB key & manually set the focus to the 
	//  next control
	//
	if( pMsg->message == WM_KEYDOWN	&& pMsg->wParam == VK_TAB )
	{
		CWnd * pNext = GetWindow(GW_HWNDNEXT);
		CWnd * pFirst = pNext ? NULL : ( pNext = GetWindow(GW_HWNDFIRST) );//if there is no 'next' window, start from the first one...
		while(pNext)
		{
			DWORD dwStyle = pNext->GetStyle();
			if( dwStyle & WS_TABSTOP 
			&&  pNext->IsWindowVisible() 
			&&  pNext->IsWindowEnabled() 
			&&  pNext->GetSafeHwnd() != m_hWnd )
			{
				pNext->SetFocus();
				return FALSE;
			}
			pNext = pNext->GetWindow(GW_HWNDNEXT);

			if( pNext == NULL && pFirst == NULL )
			{
				//if we reach this, it means that this ctrl
				//was the last ctrl in the tab order w/ the right style/status, 
				//so start from the first window.
				pNext = pFirst = GetWindow(GW_HWNDFIRST);
			}
		}//end while(pNext)
	}
	
	return CListCtrl::PreTranslateMessage(pMsg);
}

Generalctabctrl Pin
prateekkathuria9-Sep-04 7:29
prateekkathuria9-Sep-04 7:29 
GeneralRe: ctabctrl Pin
prateekkathuria9-Sep-04 9:50
prateekkathuria9-Sep-04 9:50 
QuestionDisplaying a monochrome uchar array - formatting problem? Pin
towd9-Sep-04 5:23
towd9-Sep-04 5:23 
AnswerRe: Displaying a monochrome uchar array - formatting problem? Pin
Chris Losinger9-Sep-04 7:22
professionalChris Losinger9-Sep-04 7:22 
GeneralSetting EXACT Button Size Pin
_BaRNi_9-Sep-04 4:37
_BaRNi_9-Sep-04 4:37 
GeneralRe: Setting EXACT Button Size Pin
alex.barylski9-Sep-04 5:09
alex.barylski9-Sep-04 5:09 
GeneralRe: Setting EXACT Button Size Pin
_BaRNi_9-Sep-04 5:19
_BaRNi_9-Sep-04 5:19 
GeneralRe: Setting EXACT Button Size Pin
Maximilien9-Sep-04 6:47
Maximilien9-Sep-04 6:47 
GeneralRe: Setting EXACT Button Size Pin
David Crow9-Sep-04 8:24
David Crow9-Sep-04 8:24 
GeneralCInternetFile class to read from the server Pin
Cris9-Sep-04 4:18
Cris9-Sep-04 4:18 
GeneralRe: CInternetFile class to read from the server Pin
David Crow9-Sep-04 8:25
David Crow9-Sep-04 8:25 
GeneralAdding an ActiveX control in ActiveX control project Pin
Muhammad Azam9-Sep-04 4:10
Muhammad Azam9-Sep-04 4:10 
GeneralRe: Adding an ActiveX control in ActiveX control project Pin
jmkhael9-Sep-04 4:35
jmkhael9-Sep-04 4:35 
GeneralRe: Adding an ActiveX control in ActiveX control project Pin
Muhammad Azam9-Sep-04 19:25
Muhammad Azam9-Sep-04 19:25 
Generalinheritance,searching and recursion Pin
Member 13550639-Sep-04 3:48
Member 13550639-Sep-04 3:48 
GeneralRe: inheritance,searching and recursion Pin
David Crow9-Sep-04 8:29
David Crow9-Sep-04 8:29 
GeneralDinamic Menus Pin
ivax9-Sep-04 2:33
ivax9-Sep-04 2:33 

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.