Click here to Skip to main content
15,914,109 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: OnKeyDown and OnPreTranslateMsg() problem... Pin
eli150219799-Jun-07 20:51
eli150219799-Jun-07 20:51 
GeneralRe: OnKeyDown and OnPreTranslateMsg() problem... Pin
Perspx10-Jun-07 0:25
Perspx10-Jun-07 0:25 
AnswerRe: OnKeyDown and OnPreTranslateMsg() problem... Pin
rp_suman9-Jun-07 22:43
rp_suman9-Jun-07 22:43 
GeneralRe: OnKeyDown and OnPreTranslateMsg() problem... Pin
eli1502197910-Jun-07 1:36
eli1502197910-Jun-07 1:36 
GeneralRe: OnKeyDown and OnPreTranslateMsg() problem... Pin
rp_suman10-Jun-07 5:49
rp_suman10-Jun-07 5:49 
AnswerRe: OnKeyDown and OnPreTranslateMsg() problem... Pin
Mark Salsbery10-Jun-07 6:17
Mark Salsbery10-Jun-07 6:17 
GeneralRe: OnKeyDown and OnPreTranslateMsg() problem... Pin
rp_suman10-Jun-07 16:10
rp_suman10-Jun-07 16:10 
GeneralRe: OnKeyDown and OnPreTranslateMsg() problem... Pin
Mark Salsbery10-Jun-07 17:01
Mark Salsbery10-Jun-07 17:01 
hmmm Yes I tested that and I couldn't get it to work. The dialog wants the keyboard focus on a
control no matter what.

Trying to remove the focus was fruitless as well. I tried both SetFocus() and WM_NEXTDLGCTL.

*trying some more stuff...*

This looks promising ...

add a ON_WM_SETFOCUS() entry to the dialog's message map

Add an empty OnSetFocus() handler method:
void CMYDlg::OnSetFocus(CWnd*)
{
}

At the end of the dialog's OnInitDialog() override (instead of returning TRUE), add:
SetFocus();
return FALSE;

See if that works for you...

Mark




"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder

GeneralRe: OnKeyDown and OnPreTranslateMsg() problem... Pin
rp_suman10-Jun-07 23:03
rp_suman10-Jun-07 23:03 
GeneralRe: OnKeyDown and OnPreTranslateMsg() problem... Pin
Mark Salsbery11-Jun-07 6:23
Mark Salsbery11-Jun-07 6:23 
AnswerRe: OnKeyDown and OnPreTranslateMsg() problem... Pin
MANISH RASTOGI10-Jun-07 19:00
MANISH RASTOGI10-Jun-07 19:00 
Questionpls help me Pin
saisp9-Jun-07 18:58
saisp9-Jun-07 18:58 
AnswerRe: pls help me Pin
Iain Clarke, Warrior Programmer10-Jun-07 3:15
Iain Clarke, Warrior Programmer10-Jun-07 3:15 
QuestionAbout popupMenu Pin
kcynic9-Jun-07 18:32
kcynic9-Jun-07 18:32 
AnswerRe: About popupMenu Pin
Mark Salsbery9-Jun-07 18:47
Mark Salsbery9-Jun-07 18:47 
Questionadding to char arrays together for one arg Pin
NZSmartie9-Jun-07 17:59
NZSmartie9-Jun-07 17:59 
AnswerRe: adding to char arrays together for one arg Pin
Mark Salsbery9-Jun-07 18:23
Mark Salsbery9-Jun-07 18:23 
AnswerRe: adding to char arrays together for one arg Pin
Iain Clarke, Warrior Programmer10-Jun-07 3:20
Iain Clarke, Warrior Programmer10-Jun-07 3:20 
QuestionHelp , why WSAGetLastError( ) return 2? Pin
danscort yu9-Jun-07 16:42
danscort yu9-Jun-07 16:42 
AnswerRe: Help , why WSAGetLastError( ) return 2? Pin
danscort yu9-Jun-07 17:12
danscort yu9-Jun-07 17:12 
AnswerRe: Help , why WSAGetLastError( ) return 2? Pin
Mark Salsbery9-Jun-07 18:17
Mark Salsbery9-Jun-07 18:17 
GeneralRe: Help , why WSAGetLastError( ) return 2? Pin
danscort yu9-Jun-07 21:13
danscort yu9-Jun-07 21:13 
GeneralRe: Help , why WSAGetLastError( ) return 2? Pin
Mark Salsbery10-Jun-07 5:44
Mark Salsbery10-Jun-07 5:44 
GeneralRe: Help , why WSAGetLastError( ) return 2? Pin
danscort yu11-Jun-07 1:02
danscort yu11-Jun-07 1:02 
QuestionRe: Help , why WSAGetLastError( ) return 2? Pin
Mark Salsbery11-Jun-07 6:25
Mark Salsbery11-Jun-07 6:25 

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.