funcs_any_win.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:petronia 作者: groboclown 项目源码 文件源码
def shell__register_window_hook(hwnd, message_id_callbacks=None, callback=None):
    """
    Registers the "shell hook" window message with the window, and inserts the
    callback into the message_id_callbacks dict for processing, because
    the message ID is dynamically created.

    :param hwnd:
    :param message_id_callbacks:
    :param callback:
    :return: the message ID for the shell hook message.
    """
    assert message_id_callbacks is None or isinstance(message_id_callbacks, dict)

    if not RegisterShellHookWindow(hwnd):
        raise WinError()
    message_id = RegisterWindowMessageW("SHELLHOOK")
    if message_id_callbacks:
        message_id_callbacks[message_id] = callback
    return message_id
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号