http://M.TangGaowei.com

捕捉手机 Home 键

作者 传说一梦 写于 2008-05-08  | 7,911 次浏览 | 分类 » 手机开发 |

(虽然能捕捉到,但是好像最后还是执行了返回桌面操作)

1. 注册热键

BOOL CMyProjectDlg::OnInitDialog()
{
    …

    // 处理 VK_HOME
    BYTE appkey = SHGetAppKeyAssoc(_T(“MiniBlogClient.exe”));
    ::RegisterHotKey ( m_hWnd, appkey, MOD_WIN, VK_THOME);

    …
}

2. 重写 PreTranslateMessage 函数

BOOL CMyProjectDlg::PreTranslateMessage(MSG* pMsg)
{
    // TODO: 在此添加专用代码和/或调用基类
    if( pMsg->message == WM_HOTKEY )
    {
        SetForegroundWindow();

        return TRUE;
    }

    return CDialog::PreTranslateMessage(pMsg);
}

[ 标签: HOME键 ]
[ 固定链接:http://m.tanggaowei.com/2008/05/08/73.html ]


Fatal error: Call to undefined function wp23_related_posts() in /home/tanggaow/public_html/m/wp-content/themes/bobv2/single.php on line 38