c++ - Best way to create a timer on screen -


I had this idea of ​​counting the timer (full size) on screen 01:02. One thing is that I do not really have any clue about how to get started.

I know basic C / C +, Win32 API and a bit of GDI.

Anyone have any indication of how to start this? My program will be like making a big stopwatch for the computer (but with the extra features)

is not asking for the code, just a few thoughts about how to start it / primers

< P> Thanks

Note: I think I have to do this with speed due to the speed C / C ++ My Stopwatch program will run in a very slow PC, like some P3 800 MHz, so Speed ​​is really important.

If you have experience with some Windows message processing and Win32 API, then you should start it .

  LRESULT WndProc (hwnh hwd, uint message, varm vaporam, lapram alpiram) {HDC HDC; Painting ps; RECT R; Four esizferfer [200]; Static int calculation = 120; Int seconds = 0; Int minute = 0; Integer = 0; Switch (Message) {WM_CREATE: // Create a 1 second Timer Settimer (HWD, ID_TIMER, 1000, NULL); Return 0; Case WM_PAINT: If (calculation> 0) {hdc = initial paints (HWD, and PS); GetClientRect (hwnd, & amp; r); Hours = count / 3600; Min = (count / 60)% 60; Seconds = count% 60; Wsprintf (szBuffer, "hours:% d minutes:% d seconds:% d", hours, minutes, seconds); Draw text (HDC, Szfuffer, -1, and R, DTEEFT); AndPent (Hwd & amp; nbsp;, PS); } Other {SendMessage (HWD, WMCACAC, 0, 0L)} 0 Return; Case WM_TIMER: count--; Invalid note (hwnd, null, tru); Return 0; Case WM_DESTROY: KillTimer (hwnd, ID_TIMER); Postquote message (0); Return 0; } 


Comments