Well so why this dosen't work? It compiles and starts but the dialog dosen't show up...
Code:
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include "clock.h"
SYSTEMTIME time;
char strtime[20];
BOOL CALLBACK DlgProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
{
switch(Message)
{
case WM_INITDIALOG:
while(1)
{
GetLocalTime(&time);
sprintf(strtime, "%d:%d:%d", time.wHour, time.wMinute, time.wSecond);
SetDlgItemText(hwnd, IDC_TIME, strtime);
}
break;
case WM_COMMAND:
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_MAIN), NULL, DlgProc);
}