How can a window in a dialog receive keyboard message?
-
How can a window in a dialog receive keyboard message? I create a window in a dialog.This window can show 3D drawing including rotation and can receive mouse message,but it can not receive keyboard message. Please tell me why,Thank you for your answer.My code for create window is as follow.Maybe it need more parameter. My program for create window is as follow: R1=CRect(200, 7, 1000, 200); // TODO: Add extra initialization here m_pDisplay->Create( NULL, //CWnd default NULL, //has no name WS_CHILD|WS_CLIPSIBLINGS|WS_CLIPCHILDREN|WS_VISIBLE, R1, this, //this is the parent u1); sude
-
How can a window in a dialog receive keyboard message? I create a window in a dialog.This window can show 3D drawing including rotation and can receive mouse message,but it can not receive keyboard message. Please tell me why,Thank you for your answer.My code for create window is as follow.Maybe it need more parameter. My program for create window is as follow: R1=CRect(200, 7, 1000, 200); // TODO: Add extra initialization here m_pDisplay->Create( NULL, //CWnd default NULL, //has no name WS_CHILD|WS_CLIPSIBLINGS|WS_CLIPCHILDREN|WS_VISIBLE, R1, this, //this is the parent u1); sude
it can receive keyboard input if it gets focus (by SetFocus() function). the window may need TABSTOP style or something else. includeh10
-
How can a window in a dialog receive keyboard message? I create a window in a dialog.This window can show 3D drawing including rotation and can receive mouse message,but it can not receive keyboard message. Please tell me why,Thank you for your answer.My code for create window is as follow.Maybe it need more parameter. My program for create window is as follow: R1=CRect(200, 7, 1000, 200); // TODO: Add extra initialization here m_pDisplay->Create( NULL, //CWnd default NULL, //has no name WS_CHILD|WS_CLIPSIBLINGS|WS_CLIPCHILDREN|WS_VISIBLE, R1, this, //this is the parent u1); sude
The control probably doesn't handle WM_GETDLGCODE, which is used to determine what kind of keyboard messages it should receive. If you've derived from CWnd, then override the OnGetDlgCode function. -- Joel Lucsy