PHP Code:
void CALLBACK TimerProc(HWND hwnd, UINT uMsg, UINT idEvent, DWORD dwTime)
{
RECT rc;
GetClientRect(hWnd, &rc);
int width = 100;
int height = 50;
char szBuffer[50];
int counter = 0;
j--;
//printf("Cool!\n");
_stprintf_s(szBuffer,"Test: %i", counter);
myTimer = CreateWindowEx(0, "STATIC", szBuffer, WS_CHILD | WS_VISIBLE, ((rc.right - rc.left - 50) / 2), 0, width, height, hWnd, (HMENU)IDS_MYTIMER, hInst, NULL);
ShowWindow(myTimer, SW_SHOW);
UpdateWindow(myTimer);
counter ++;
}
void drawTimer()
{
RECT rc;
GetClientRect(hWnd, &rc);
int width = 100;
int height = 50;
char szBuffer[50];
UINT id;
int counter = 0;
MSG msg;
id = SetTimer(myTimer, 0, 3000, (TIMERPROC) TimerProc);
while(j)
{
GetMessage(&msg, NULL, 0, 0);
DispatchMessage(&msg);
}
KillTimer(NULL, id);
/*
do
{
_stprintf_s(szBuffer,"Test: %i", i);
myTimer = CreateWindowEx(0, "STATIC", szBuffer, WS_CHILD | WS_VISIBLE, ((rc.right - rc.left - 50) / 2), 0, width, height, hWnd, (HMENU)IDS_MYTIMER, hInst, NULL);
ShowWindow(myTimer, SW_SHOW);
UpdateWindow(myTimer);
counter ++;
}while(counter <= (5));
*/
/*
time_t today;
struct tm *tm;
today = time(0);
tm = localtime(&today);
tm->tm_sec = 5;
tm->tm_hour = 0;
tm->tm_min = 0;
int total = 5;
mktime(tm);
_stprintf_s(szBuffer,"Time: %02d:%02d %i", tm->tm_min, tm->tm_sec, total);
myTimer = CreateWindowEx(0, "STATIC", szBuffer, WS_CHILD | WS_VISIBLE, ((rc.right - rc.left - 50) / 2), 0, width, height, hWnd, (HMENU)IDS_MYTIMER, hInst, NULL);
ShowWindow(myTimer, SW_SHOW);
UpdateWindow(myTimer);
total = (tm->tm_sec) - 1;
*/
}