Home > Software engineering >  Drawing on controls, are covered
Drawing on controls, are covered

Time:10-14

Use the caller transfer window handle, with hook function to get the window handle of the WM_PAINT message, drawing,
There is no any control reaction,
May be a dialog window to map covered my drawing, is to modify some attribute of the handle?

CodePudding user response:

Recommend active calls or subclass

 
Void CXXXWnd: : OnPaint ()
{
CPaintDC dc (this);//device context for painting

CRect rc;
GetClient (& amp; Rc);

Dc. FillSolidRect (rc, RGB (200, 200, 200));

Sub1. Paint (dc, & amp; Rc);//Paint (DC & amp; Dc, LPCRECT rc)
Sub2. Paint (dc, & amp; Rc);

}


Hook should be WH_CALLWNDPROC, finished processing returns 0 don't CallNextHookEx pass it on

CodePudding user response:

"With the hook function to get the window handle of the WM_PAINT message"
Code?

CodePudding user response:

reference 1st floor zgl7903 response:
recommended active calls or subclass

 
Void CXXXWnd: : OnPaint ()
{
CPaintDC dc (this);//device context for painting

CRect rc;
GetClient (& amp; Rc);

Dc. FillSolidRect (rc, RGB (200, 200, 200));

Sub1. Paint (dc, & amp; Rc);//Paint (DC & amp; Dc, LPCRECT rc)
Sub2. Paint (dc, & amp; Rc);

}


Hook should be WH_CALLWNDPROC, finished processing returns 0 don't pass down CallNextHookEx

Is I make a mistake, forget to draw rectangular assignment,
But sometimes, there are still invalid, is in addition to the WM_PAINT message, even in other messages is drawing a horse?

CodePudding user response:

The WM_DRAWITEM message is sent to the parent window of an owner - drawn button, combo box, list box, or menu when a visual aspect of the button, the combo box, list box, or menu has changed.

A window receives this message through its WindowProc function.

CodePudding user response:

The
reference 4 floor zgl7903 reply:
The WM_DRAWITEM message is sent to the parent window of an owner - drawn button, combo box, list box, or menu when a visual aspect of the button, the combo box, list box, or menu has changed.

A window receives this message through its WindowProc function.

Like in WH_CALLWNDPROC block less than WM_DRAWITEM messages
  • Related