当前位置: 首页>>代码示例>>C++>>正文


C++ AwtComponent::WindowProc方法代码示例

本文整理汇总了C++中AwtComponent::WindowProc方法的典型用法代码示例。如果您正苦于以下问题:C++ AwtComponent::WindowProc方法的具体用法?C++ AwtComponent::WindowProc怎么用?C++ AwtComponent::WindowProc使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AwtComponent的用法示例。


在下文中一共展示了AwtComponent::WindowProc方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1:

LRESULT CALLBACK
AwtScrollbar::MouseFilter(int nCode, WPARAM wParam, LPARAM lParam)
{
    if (((UINT)wParam == WM_LBUTTONUP || (UINT)wParam == WM_MOUSEMOVE) &&
        ms_isInsideMouseFilter != TRUE &&
        nCode >= 0)
    {
        HWND hwnd = ((PMOUSEHOOKSTRUCT)lParam)->hwnd;
        AwtComponent *comp = AwtComponent::GetComponent(hwnd);

        if (comp != NULL && comp->IsScrollbar()) {
            MSG msg;
            LPMSG lpMsg = (LPMSG)&msg;
            UINT msgID = (UINT)wParam;

            ms_isInsideMouseFilter = TRUE;

            // Peek the message to get wParam containing the message's flags.
            // <::PeekMessage> will call this hook again. To prevent recursive
            // processing the <ms_isInsideMouseFilter> flag is used.
            // Calling <::PeekMessage> is not so good desision but is the only one
            // found to get those flags (used further in Java event creation).
            // WARNING! If you are about to add new hook of WM_MOUSE type make
            // it ready for recursive call, otherwise modify this one.
            if (::PeekMessage(lpMsg, hwnd, msgID, msgID, PM_NOREMOVE)) {
                comp->WindowProc(msgID, lpMsg->wParam, lpMsg->lParam);
            }

            ms_isInsideMouseFilter = FALSE;
        }
    }
    return ::CallNextHookEx(AwtScrollbar::ms_hMouseFilter, nCode, wParam, lParam);
}
开发者ID:,项目名称:,代码行数:33,代码来源:


注:本文中的AwtComponent::WindowProc方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。