我想在 vc++ 窗口中更改标签。标签显示每 100 毫秒更新一次的实时数据。那么我怎么能在vc++窗口中做到这一点呢?任何人请帮助
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
HWND hRPMEx,hAvgTimeEx;
int wmId, wmEvent;
PAINTSTRUCT ps;
HDC hdc;
switch(message)
{
case WM_TIMER:
break;
case WM_CREATE:
hRPMEx = CreateWindowA("Static","",WS_CHILD | WS_VISIBLE | SS_LEFT,
20,100,220,25,
hWnd, (HMENU)IDC_RPM_EX, hInstance, NULL);
hAvgTimeEx = CreateWindowA("Static","",WS_CHILD | WS_VISIBLE | SS_LEFT,
20,150,220,25,
hWnd, (HMENU)IDC_AVGTIME_EX, hInstance, NULL);
break;
case WM_COMMAND:
wmId = LOWORD(wParam);
wmEvent = HIWORD(wParam);
// Parse the menu selections:
switch (wmId)
{
case IDC_BTN_CONNECT:
break;
case IDC_RPM_EX:
break;
case IDC_BTN_DISCONNECT:
break;
case IDM_ABOUT:
DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, About);
break;
case IDM_OPEN:
break;
case IDM_EXIT:
break;
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
break;
case WM_PAINT:
hdc = BeginPaint(hWnd, &ps);
EndPaint(hWnd, &ps);
break;
case WM_DESTROY:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hWnd, message, wParam, lParam);
}
return 0;
}
我应该在哪里调用更新标签的函数(静态文本)