Click here to Skip to main content
15,902,636 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralMessage Reflection Pin
1-Apr-02 13:01
suss1-Apr-02 13:01 
GeneralMessage Relfection Pin
1-Apr-02 13:01
suss1-Apr-02 13:01 
GeneralRe: Message Relfection Pin
Shog91-Apr-02 13:08
sitebuilderShog91-Apr-02 13:08 
GeneralRe: Message Relfection Pin
1-Apr-02 13:11
suss1-Apr-02 13:11 
GeneralRe: Message Relfection Pin
Shog91-Apr-02 13:25
sitebuilderShog91-Apr-02 13:25 
GeneralRe: Message Relfection Pin
1-Apr-02 13:30
suss1-Apr-02 13:30 
GeneralRe: Message Relfection Pin
1-Apr-02 13:51
suss1-Apr-02 13:51 
GeneralRe: Message Relfection Pin
Shog91-Apr-02 17:57
sitebuilderShog91-Apr-02 17:57 
Reflection is used by MFC to allow handling messages sent from a control to be handled by the control itself. WM_DRAWITEM is sent by the button control to its parent; however it is cleaner for the code to exist within a class derived from CButton, rather than wherever the CButton-derived class is used. So there is ON_WM_DRAWITEM_REFLECT() which causes DrawItem() to be called.

WM_MOUSEMOVE (OnMouseMove()) and WM_TIMER (OnTimer()) both are sent to the control itself, so they do not need reflection to be handled by the CButton-derived class.

None of this helps with your immediate problem, however Frown | :(

There's nothing special about an Owner-drawn button that keeps it from getting WM_MOUSEMOVE. Double-check (wait, i guess it'd be triple-check) that your class looks something like this:
BEGIN_MESSAGE_MAP(CButtonDerivative, CButton)
   ON_WM_DRAWITEM_REFLECT()
   ON_WM_MOUSEMOVE()
   // ... possibly other entries
END_MESSAGE_MAP()

// ...

void CButtonDerivative::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
{
  // ... draw the button
}

void CButtonDerivative::OnMouseMove(UINT nFlags, CPoint point)
{
   // ... handle mouse movement
}


Sometimes i only remember, The days when i was young
Nowadays no one remembers when they were young and stupid...

ADEMA, The Way You Like It


Generalpassword protect folder Pin
Steven Richardson1-Apr-02 11:03
Steven Richardson1-Apr-02 11:03 
GeneralRe: password protect folder Pin
dazinith1-Apr-02 11:23
dazinith1-Apr-02 11:23 
GeneralRe: password protect folder Pin
Steven Richardson1-Apr-02 11:27
Steven Richardson1-Apr-02 11:27 
GeneralRe: password protect folder Pin
dazinith1-Apr-02 11:33
dazinith1-Apr-02 11:33 
GeneralRe: password protect folder Pin
alex.barylski1-Apr-02 15:52
alex.barylski1-Apr-02 15:52 
GeneralRe: password protect folder Pin
Mukkie2-Apr-02 5:54
Mukkie2-Apr-02 5:54 
GeneralMultithreading Pin
RK_20001-Apr-02 10:10
RK_20001-Apr-02 10:10 
GeneralRe: Multithreading Pin
Tim Smith1-Apr-02 10:20
Tim Smith1-Apr-02 10:20 
GeneralRe: Multithreading Pin
Paul M Watt1-Apr-02 10:33
mentorPaul M Watt1-Apr-02 10:33 
GeneralRe: Multithreading Pin
lucy9-Apr-02 9:29
lucy9-Apr-02 9:29 
GeneralRe: Multithreading Pin
Bill Wilson1-Apr-02 12:47
Bill Wilson1-Apr-02 12:47 
GeneralTFTP Server and Windows Sockets Pin
1-Apr-02 9:53
suss1-Apr-02 9:53 
GeneralRe: TFTP Server and Windows Sockets Pin
Joaquín M López Muñoz1-Apr-02 10:13
Joaquín M López Muñoz1-Apr-02 10:13 
GeneralRe: TFTP Server and Windows Sockets Pin
1-Apr-02 10:20
suss1-Apr-02 10:20 
GeneralRe: TFTP Server and Windows Sockets Pin
Dave_1-Apr-02 13:48
Dave_1-Apr-02 13:48 
GeneralFtp Upload Pin
Nnamdi Onyeyiri1-Apr-02 9:46
Nnamdi Onyeyiri1-Apr-02 9:46 
GeneralRe: Ftp Upload Pin
dazinith1-Apr-02 9:51
dazinith1-Apr-02 9:51 

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.