Re: WM_PAINT NON-STOP IN CUSTOM CONTROL
No, my solution works fine..
As for Beep function: It was just "discovery" for me, as I didn't know that
WM_PAINT is non-stop..
I was programming different language, and there were only one message
WM_UPDATE..
And it was fine having just one..
Still can't find a situation when I need it non-stop..
I've done it different.. though I was looking for some solution like yours,
but I didn't try CreateWindow, as I though that Do.Modal do it for me..
I've done different..
I decided to create a C++ class with just "do nothing" WINPROC, redirecting
messages to DefWinproc.. and Windows native "button" name..
Because besides WM_PAINT I had another problem with mouse and keyboard
events..
With "button" class I have all of messages..
******************************************
static CImageControl just_to_be_sure_its_created;
LRESULT APIENTRY CImage_callback( HWND hwnd, UINT uMsg, WPARAM wParam,
LPARAM lParam)
{
return ::DefWindowProc(hwnd, uMsg, wParam, lParam);
}
CImageControl::CImageControl(void)
{
WNDCLASS CWinButton;
GetClassInfo(NULL, _T("button"), &CWinButton);
wc.lpfnWndProc = (WNDPROC) CImage_callback;
wc.lpszClassName = _T("image_control"); // my custom control window
m_bInitialized = AfxRegisterClass(&CWinButton);
}
}
******************************************
And another MFC CWnd class, where I can add any Event automatically from VS
environment during editing, and easy to use other MFC classes.
And Subclassing Custom Control window to that C++ class, that redirects it
to that MFC CWnd class..
Now if I want to catch native event I can, but others unnecessary events are
processing by MFC dispatcher..