OK.  Added that.  Thanks.  I then realised I had the let the method process
the message first so that I could access the correct data values afterwards.
So my method is now:

BOOL CCreateReportDlg::PreTranslateMessage(MSG* pMsg) 
{
        // TODO: Add your specialized code here and/or call the base class
        CCellID         idCell;
        BOOL            bUpdateStatus = FALSE;
        BOOL            bPTM = CDialog::PreTranslateMessage(pMsg);

        if (pMsg->hwnd == m_Grid.GetSafeHwnd())
        {
                if (pMsg->message == WM_KEYDOWN)
                {
                        if( pMsg->wParam == VK_END || pMsg->wParam ==
VK_HOME)
                        {
                                if(IsCTRLpressed())
                                        bUpdateStatus = TRUE;
                        }
                }
                else if (pMsg->message == WM_KEYUP)
                {
                        if(pMsg->wParam == VK_UP || pMsg->wParam == VK_DOWN
||
                                pMsg->wParam == VK_PAGE_UP || pMsg->wParam
== VK_PAGE_DOWN)
                        {
                                bUpdateStatus = TRUE;
                        }
                }

                if (bUpdateStatus)
                {
                        idCell = m_Grid.GetFocusCell();
                        UpdateMeetingStatus(idCell.row);
                }
        }
        
        return  bPTM;
}


But I am trying to add interception of page up and page down and I can't
find valid VK constants to use :(

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Carlos Cobas
> Sent: 22 April 2005 11:04
> To: [email protected]
> Subject: RE: [msvc] PreTranslateMessage
> 
> 
> Hi Andrew,
> 
> How about this:
> 
> #define IsSHIFTpressed() ( (GetKeyState(VK_SHIFT) & (1 <<
> (sizeof(SHORT)*8-1))) != 0   )
> 
> #define IsCTRLpressed()  ( (GetKeyState(VK_CONTROL) & (1 <<
> (sizeof(SHORT)*8-1))) != 0 )
> 
> Regards,
> Carlos 
> 
> 
> > -----Mensaje original-----
> > De: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] 
> > En nombre de Truckle, Andrew J Enviado el: viernes, 22 de abril de 
> > 2005 11:54
> > Para: '[email protected]'
> > Asunto: [msvc] PreTranslateMessage
> > 
> > I have this method:
> > 
> > BOOL CCreateReportDlg::PreTranslateMessage(MSG* pMsg)
> > {
> >     // TODO: Add your specialized code here and/or call the 
> base class
> >     CCellID         idCell;
> > 
> >     if (pMsg->hwnd == m_Grid.GetSafeHwnd() &&
> >             pMsg->message == WM_KEYUP &&
> >             (pMsg->wParam == VK_UP || pMsg->wParam == VK_DOWN) )
> >     {
> >             idCell = m_Grid.GetFocusCell();
> >             UpdateMeetingStatus(idCell.row);
> >     }
> > 
> >     return CDialog::PreTranslateMessage(pMsg);
> > }
> > 
> > I want to also trap when the user clicks CTRL and END.  How 
> do I know 
> > when CTRL are pressed?
> > 
> > Andrew Truckle
> > CAD Manager
> > Atkins Survey and Mapping
> > Avon Way, Langley Park, Chippenham, Wiltshire. SN15 1GG
> > Telephone:     01249 455032
> > Switchboard:  01249 455000
> > Fax:                 01249 455045
> > E-Mail: [EMAIL PROTECTED]
> > www.atkinsglobal.com <www.atkinsglobal.com>
> > 
> > 
> > 
> > This email and any attached files are confidential and copyright 
> > protected. If you are not the addressee, any dissemination of this 
> > communication is strictly prohibited. Unless otherwise expressly 
> > agreed in writing, nothing stated in this communication shall be 
> > legally binding.
> > 
> > _______________________________________________
> > msvc mailing list
> > [email protected]
> > See 
> http://beginthread.com/mailman/listinfo/msvc_beginthread.com for 
> > subscription changes, and list archive.
> 
> 
> _______________________________________________
> msvc mailing list
> [email protected]
> See 
> http://beginthread.com/mailman/listinfo/msvc_beginthread.com 
> for subscription changes, and list archive.
> 
> 
> This message has been scanned for viruses by MailControl - 
> (see http://bluepages.wsatkins.co.uk/?4318150)
> 

_______________________________________________
msvc mailing list
[email protected]
See http://beginthread.com/mailman/listinfo/msvc_beginthread.com for 
subscription changes, and list archive.

Reply via email to