本文整理汇总了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);
}