MFC初学,现在想用CHECKBOX控制PreTranslateMessage(MSG* pMsg)中的两段消息,结果不得,谁帮看看谢谢
CHECKBOX默认为非选中,我在程序运行中选中CHECKBOX后if(adjustwindow&&pMsg->hwnd==m_pic1.m_hWnd&&pMsg->me...
CHECKBOX默认为非选中,我在程序运行中选中CHECKBOX后if (adjustwindow &&pMsg->hwnd == m_pic1.m_hWnd && pMsg->message == WM_LBUTTONDOWN这句没作用,只能执行if (ROI &&pMsg->hwnd == m_pic1.m_hWnd && pMsg->message == WM_LBUTTONUP这句,我想通过CHECKBOX执行某句,怎么办 谢谢
BOOL CDicomView3DDlg::PreTranslateMessage(MSG* pMsg)
{
BOOL ROI;
BOOL adjustwindow;
BOOL ck = ((CButton*)GetDlgItem(IDC_CHECK1check))->GetCheck();//CHECKBOX状态
if (ck = 0)
{
adjustwindow = 1;
ROI = 0;
}
if (ck = 1)
{
adjustwindow = 0;
ROI = 1;
}
if (adjustwindow &&pMsg->hwnd == m_pic1.m_hWnd && pMsg->message == WM_LBUTTONDOWN
{
Downed = TRUE;
}
if (ROI &&pMsg->hwnd == m_pic1.m_hWnd && pMsg->message == WM_LBUTTONUP
{
Downed = FALSE;
} 展开
BOOL CDicomView3DDlg::PreTranslateMessage(MSG* pMsg)
{
BOOL ROI;
BOOL adjustwindow;
BOOL ck = ((CButton*)GetDlgItem(IDC_CHECK1check))->GetCheck();//CHECKBOX状态
if (ck = 0)
{
adjustwindow = 1;
ROI = 0;
}
if (ck = 1)
{
adjustwindow = 0;
ROI = 1;
}
if (adjustwindow &&pMsg->hwnd == m_pic1.m_hWnd && pMsg->message == WM_LBUTTONDOWN
{
Downed = TRUE;
}
if (ROI &&pMsg->hwnd == m_pic1.m_hWnd && pMsg->message == WM_LBUTTONUP
{
Downed = FALSE;
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询