Home > Software engineering >  The Create child window display problem?
The Create child window display problem?

Time:09-27

I, in the ocx control project in the main dialog box, has built A child window is used to draw A line (BMP) reproduction, but the size of A new child window has been more than the size of the ocx controls, is beyond the scope of the part also shows, could you tell me how to create the child window will not be shown beyond ocx?

 m_subwindow. CreateEx (WS_EX_LAYERED, 
AfxRegisterWndClass (CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW, : : LoadCursor (NULL, IDC_ARROW), (HBRUSH) : : CreateSolidBrush (RGB (100, 100, 100))),
NULL,
WS_POPUP,
0, 0, 200, 200,
GetSafeHwnd (),
NULL,
NULL);

CodePudding user response:

Access control size first, and then according to the size of the control to create the control

CodePudding user response:

General should be like this:
 
CRect re;
GetClientRect (& amp; Re)

M_subwindow. CreateEx (WS_EX_LAYERED,
AfxRegisterWndClass (CS_DBLCLKS | CS_HREDRAW | CS_VREDRAW, : : LoadCursor (NULL, IDC_ARROW), (HBRUSH) : : CreateSolidBrush (RGB (100, 100, 100))),
NULL,
WS_POPUP,
Re. Left, re. Top, re right, re. Bottom,
GetSafeHwnd (),
NULL,
NULL);

CodePudding user response:

If use the WS_POPUP to create A child window, the main program to move the position of A child window will not move, like this window can display A outside the main program, and I want to achieve is A child window display control within the scope of the ocx controls, beyond the part will be ocx tailoring, child window A can only mobile within the ocx controls, please comment ~

CodePudding user response:

The main program for mobile location to send messages to modify A size
  • Related