Windows Mobile平台上重写Back健的行为
2010-08-22 12:56:00 来源:WEB开发网核心提示:// If back key is overriden, back button messages are sent in a WM_HOTKEY to the menu bar// with the id VK_TBACK in the LPARAM.if (VK_TBACK == HIWORD(lParam) &&
// If back key is overriden, back button messages are sent in a WM_HOTKEY to the menu bar
// with the id VK_TBACK in the LPARAM.
if (VK_TBACK == HIWORD(lParam) && (0 != (MOD_KEYUP & LOWORD(lParam))))
{
// Send a message to the check box to see if it's checked or not
HWND hwndCheck = GetDlgItem(hwnd, IDC_CHECKBACK);
if (BST_CHECKED == SendMessage(hwndCheck, BM_GETCHECK, 0, 0))
// check box is enabled, so we process the back key
SHSendBackToFocusWindow(Msg, wParam, lParam);
}
else
{
// not enabled, revert to default back behaviour
MessageBox(hwnd, tszBackText, tszBackCaption, MB_OK | MB_ICONINFORMATION);
SHNavigateBack();
}
}
break;
default:
bReturn = FALSE;
break;
}
return bReturn;
}
更多精彩
赞助商链接