I'm writing a plugin for windows media player in visual c++. I'm trying to work within the framework created by the wizard. I have a PropertyDialog that I wanted to add spin controls to but I'm having a difficult time trying to figure out how to work with the message and change the associated edit box controls.
So I have been able to catch messages from the spin control via the following message map:
MESSAGE_HANDLER( WM_VSCROLL, OnVScroll )
However, I have multiple spin controls and need to take different actions depending on which control the event is coming from. So far I have the following function for the handler.
LRESULT CPropertyDialog::OnVScroll
(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& fHandled)
{
int nScrollCode = (int)LOWORD(wParam);
int nPos = (short int)HIWORD(wParam);
SCROLLINFO si = {sizeof(SCROLLINFO),
SIF_PAGE|SIF_POS|SIF_RANGE
|SIF_TRACK
POS, 0, 0, 0, 0,
0};
if (nScrollCode == SB_ENDSCROLL) {
return 0; // Reject spurious messages
}
}
I would like to add something like this to get the control id:
if (lParam->GetDlogCtrlID() == IDC_SPIN1)
suggestions?
Thanks,
Jason
Start Free Trial