Real time display
-
Hi, The codes below used to create a window to display something. Could some of you tell me that how can I display the real time clock (H:M:S) inside this window... Thanks! hwnd = CreateWindow( szWinName, /* name of window class */ "Capture Testing", /* title */ WS_OVERLAPPEDWINDOW, /* window style - normal */ CW_USEDEFAULT, /* X coordinate - let Windows decide */ CW_USEDEFAULT, /* Y coordinate - let Windows decide */ 480, /* width - let Windows decide */ 320, /* height - let Windows decide */ HWND_DESKTOP, /* no parent window */ NULL, /* no menu */ hThisInst, /* handle of this instance of the program */ NULL /* no additional arguments */ ); g_inst=hThisInst; /* Display the window. */ ShowWindow(hwnd, nWinMode); UpdateWindow(hwnd); hWndG=hwnd; SetTimer(hWndG,1,100,NULL);
-
Hi, The codes below used to create a window to display something. Could some of you tell me that how can I display the real time clock (H:M:S) inside this window... Thanks! hwnd = CreateWindow( szWinName, /* name of window class */ "Capture Testing", /* title */ WS_OVERLAPPEDWINDOW, /* window style - normal */ CW_USEDEFAULT, /* X coordinate - let Windows decide */ CW_USEDEFAULT, /* Y coordinate - let Windows decide */ 480, /* width - let Windows decide */ 320, /* height - let Windows decide */ HWND_DESKTOP, /* no parent window */ NULL, /* no menu */ hThisInst, /* handle of this instance of the program */ NULL /* no additional arguments */ ); g_inst=hThisInst; /* Display the window. */ ShowWindow(hwnd, nWinMode); UpdateWindow(hwnd); hWndG=hwnd; SetTimer(hWndG,1,100,NULL);
You need to create a control that shows the time, and then set a timer in that control that keeps calling Invalidate, so that a paint message is recieved. Do you need to use Win32 ? If you can use MFC, it will make life a lot easier for you. Christian Graus - Microsoft MVP - C++
-
Hi, The codes below used to create a window to display something. Could some of you tell me that how can I display the real time clock (H:M:S) inside this window... Thanks! hwnd = CreateWindow( szWinName, /* name of window class */ "Capture Testing", /* title */ WS_OVERLAPPEDWINDOW, /* window style - normal */ CW_USEDEFAULT, /* X coordinate - let Windows decide */ CW_USEDEFAULT, /* Y coordinate - let Windows decide */ 480, /* width - let Windows decide */ 320, /* height - let Windows decide */ HWND_DESKTOP, /* no parent window */ NULL, /* no menu */ hThisInst, /* handle of this instance of the program */ NULL /* no additional arguments */ ); g_inst=hThisInst; /* Display the window. */ ShowWindow(hwnd, nWinMode); UpdateWindow(hwnd); hWndG=hwnd; SetTimer(hWndG,1,100,NULL);