C 语言 学习---回调、时间定时更新程序

VOID CALLBACK NyTimerProc (HWND hwnd, UINT message, UINT iTimerID, DWORD dwTime)
{
	//MessageBox(hwnd,TEXT("我被调用了"),TEXT("测试回调"),MB_OK);
	SYSTEMTIME stLocal;
	GetLocalTime(&stLocal);
	TCHAR strTime[256];
	wsprintf(strTime,"%i年%i月%i日 %i:%i:%i",stLocal.wYear,stLocal.wMonth,
		stLocal.wDay,stLocal.wHour,stLocal.wMinute,stLocal.wSecond);
	SetDlgItemText(hwnd,IDC_EDITTIME,strTime);
}

BOOL Main_OnInitDialog(HWND hwnd, HWND hwndFocus, LPARAM lParam)
{
    SetTimer(hwnd,0,3000,NyTimerProc);
	return TRUE;
}

 
C 语言 学习---回调、时间定时更新程序

 

你可能感兴趣的:(学习)