Click here to Skip to main content
15,906,329 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Tracking a mouse movement inside a dialog without Tab controls [modified] Pin
Nelek5-Nov-07 20:30
protectorNelek5-Nov-07 20:30 
AnswerRe: Tracking a mouse movement inside a dialog without Tab controls Pin
Mark Salsbery5-Nov-07 5:54
Mark Salsbery5-Nov-07 5:54 
GeneralRe: Tracking a mouse movement inside a dialog without Tab controls Pin
Larry Mills Sr5-Nov-07 6:03
Larry Mills Sr5-Nov-07 6:03 
GeneralRe: Tracking a mouse movement inside a dialog without Tab controls Pin
Mark Salsbery5-Nov-07 6:34
Mark Salsbery5-Nov-07 6:34 
GeneralRe: Tracking a mouse movement inside a dialog without Tab controls [modified] Pin
Larry Mills Sr5-Nov-07 9:10
Larry Mills Sr5-Nov-07 9:10 
GeneralRe: Tracking a mouse movement inside a dialog without Tab controls Pin
Mark Salsbery5-Nov-07 10:48
Mark Salsbery5-Nov-07 10:48 
GeneralRe: Tracking a mouse movement inside a dialog without Tab controls Pin
Larry Mills Sr5-Nov-07 11:25
Larry Mills Sr5-Nov-07 11:25 
GeneralRe: Tracking a mouse movement inside a dialog without Tab controls Pin
Mark Salsbery5-Nov-07 11:45
Mark Salsbery5-Nov-07 11:45 
Kind of.  The thing about OnCommand() is that it's the handler for WM_COMMAND
messages which are sent/posted to the window.  That means it gets EVERY WM_COMMAND,
not just certain ones.  If you go that route, you need to filter out the ones you're interested in
and pass the others on, otherwise the dialog may not function correctly (especially since OnCommand()
is where CWnd dispatches command messages through the message map!).

For control notifications, you might do something like this:
BOOL CMyDialog::OnCommand(WPARAM wParam, LPARAM lParam)
{
   WORD wNotifyCode = HIWORD(wParam);
   WORD wControlID = LOWORD(wParam);
   HWND hwndControl = (HWND)lParam;

   if (EN_SETFOCUS == wNotifyCode)
   {
      // An edit control got focus

      //   do something

      return TRUE; // indicates no further processing is necessary
   }

   // We didn't process the message - pass it on
   return CDialog::OnCommand(wParam, lParam);
}
Make sense?

Mark



Mark Salsbery
Microsoft MVP - Visual C++

Java | [Coffee]

GeneralRe: Tracking a mouse movement inside a dialog without Tab controls Pin
Larry Mills Sr6-Nov-07 2:59
Larry Mills Sr6-Nov-07 2:59 
GeneralRe: Tracking a mouse movement inside a dialog without Tab controls Pin
Mark Salsbery6-Nov-07 4:43
Mark Salsbery6-Nov-07 4:43 
GeneralRe: Tracking a mouse movement inside a dialog without Tab controls Pin
Larry Mills Sr6-Nov-07 5:45
Larry Mills Sr6-Nov-07 5:45 
GeneralRe: Tracking a mouse movement inside a dialog without Tab controls Pin
Mark Salsbery6-Nov-07 8:03
Mark Salsbery6-Nov-07 8:03 
GeneralRe: Tracking a mouse movement inside a dialog without Tab controls Pin
Larry Mills Sr6-Nov-07 10:05
Larry Mills Sr6-Nov-07 10:05 
GeneralRe: Tracking a mouse movement inside a dialog without Tab controls Pin
Mark Salsbery6-Nov-07 10:15
Mark Salsbery6-Nov-07 10:15 
GeneralRe: Tracking a mouse movement inside a dialog without Tab controls Pin
Nelek6-Nov-07 21:06
protectorNelek6-Nov-07 21:06 
GeneralRe: Tracking a mouse movement inside a dialog without Tab controls [modified] Pin
Larry Mills Sr7-Nov-07 4:00
Larry Mills Sr7-Nov-07 4:00 
GeneralRe: Tracking a mouse movement inside a dialog without Tab controls Pin
Nelek14-Nov-07 3:35
protectorNelek14-Nov-07 3:35 
Questionfolder constants (for opening) Pin
shpid3r3-Nov-07 12:59
shpid3r3-Nov-07 12:59 
AnswerRe: folder constants (for opening) Pin
Peter Weyzen3-Nov-07 19:01
Peter Weyzen3-Nov-07 19:01 
QuestionGetOpenFileName hangs Pin
andrew_dk3-Nov-07 12:31
andrew_dk3-Nov-07 12:31 
AnswerRe: GetOpenFileName hangs [modified] Pin
Peter Weyzen3-Nov-07 18:44
Peter Weyzen3-Nov-07 18:44 
GeneralRe: GetOpenFileName hangs Pin
andrew_dk3-Nov-07 19:57
andrew_dk3-Nov-07 19:57 
QuestionHeader files #include problem Pin
Oliver1233-Nov-07 11:10
Oliver1233-Nov-07 11:10 
AnswerRe: Header files #include problem Pin
David Crow3-Nov-07 11:56
David Crow3-Nov-07 11:56 
AnswerRe: Header files #include problem Pin
Bram van Kampen3-Nov-07 12:39
Bram van Kampen3-Nov-07 12:39 

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.