本文整理汇总了C++中Label::WindowProc方法的典型用法代码示例。如果您正苦于以下问题:C++ Label::WindowProc方法的具体用法?C++ Label::WindowProc怎么用?C++ Label::WindowProc使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Label
的用法示例。
在下文中一共展示了Label::WindowProc方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WindowProcProxy
LRESULT Label::WindowProcProxy(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
// Get a 'this' pointer from the window data
Label *label = (Label *) GetWindowLongPtr(hWnd, GWLP_THIS);
if (message == WM_NCCREATE)
{
// WM_NCCREATE is our first chance to get our 'this' pointer, which
// was passed in to CreateWindowEx
label = (Label *) ((LPCREATESTRUCT) lParam)->lpCreateParams;
if (label)
{
// Create is still inside CreateWindowEx, so mWindow hasn't been
// assigned. Assign it here so we can use it in the WM_[NC]CREATE
// handler.
label->mWindow = hWnd;
// Put a 'this' pointer in the window data so we can get it later
SetWindowLongPtr(hWnd, GWLP_THIS, (LONG_PTR) label);
}
}
if (label)
{
// Relay the message
return label->WindowProc(message, wParam, lParam);
}
// Any messages sent before WM_NCCREATE wind up here
return DefWindowProc(hWnd, message, wParam, lParam);
}