Click here to Skip to main content
15,913,854 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
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 
rp_suman wrote:
What is happening if you are not calling SetFocus() in OnInitDialog()?


According to the docs, the default handler for WM_SETFOCUS is the one that sets the focus
to the correct control (it tracks which control internally).
WM_SETFOCUS is a notification so there should be no huge harm in not passing it to the default
handler.

It will effect the user interface - you may want to set the focus to a specific control at
some point. Users expect dialogs to act a certain way. With this method, when the user switches
to another app and then switches back, the focus will be set to the dialog but the default control
for the dialog may/will be set as well. A solution should probably be a bit more robust and
track which control should have focus when nevessary.

My 2 cents,
Mark


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

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 
QuestionPassing a class function pointer as an argument Pin
Cyrilix9-Jun-07 14:30
Cyrilix9-Jun-07 14:30 
AnswerRe: Passing a class function pointer as an argument Pin
Nemanja Trifunovic9-Jun-07 14:48
Nemanja Trifunovic9-Jun-07 14:48 

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.