In-depth introduction to CChart one lesson per day-Happy high 4 13th Lesson Liu ti on the monthly, Win32 standard control ChartCtrl hand in hand, cchartchartctrl
In the previous lesson, the new ChartCtrl control was introduced in the dialog box. This section briefly introduces another usage of this control.
First, follow the previous steps to create a Win32Application.
The following is a response routine for adding a WM_CREATE message.
Case WM_CREATE: HWND hW; hW = CreateWindow (_ T ("ChartCtrl"), _ T ("Cap"), WS_CHILD | WS_VISIBLE, 20, 20,600,400, hWnd, NULL, hInst, NULL); if (hW) {CChart * chart = GetChart (hW); for (int I =-10; I <= 10; I ++) {chart-> AddPoint2D (I, I * I);} ShowWindow (hWnd, SW_SHOW);} break;
Running effect.
Here we use CreateWindow to create a ChartCtrl control window, use the GetChart () function mentioned in the previous lesson to obtain the CChart pointer, and then operate on the pointer.
This lesson is very simple. It mainly shows that ChartCtrl is a registered window class and can be processed in the general Win32 API mode.
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.