Code:
#include <windows.h>
#include <math.h>
#include <cmath>
#include <cstdio>
#include "resource.h"
BOOL CALLBACK ToolDlgProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
{
switch(Message)
{
case WM_INITDIALOG:
SetTimer(hwnd, IDT_TIMERCLOCK, 500, NULL);
return TRUE;
break;
case WM_COMMAND:
switch(LOWORD(wParam))
{
}
break;
case WM_TIMER:
{
Get the time and date, display.
break; }
case WM_CLOSE:
EndDialog(hwnd, 0);
break;
default:
return FALSE;
}
return TRUE;
}
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow)
{
return DialogBox(hInstance, MAKEINTRESOURCE(IDD_CLOCK), NULL, ToolDlgProc);
}
Thanks a lot for that guys, the above code works beautifully.