Hi,

It is not so much an issue, I am rather wondering if the program work correctly...

Code:
int iTickCount = 0;
int iTickTriger = 0;

while(TRUE)
	{
		if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
		{
		      TranslateMessage(&msg);
		      DispatchMessage(&msg);
		}
		else
		{
			iTickCount = GetTickCount();
			if(iTickCount > iTickTriger)
			{
				iTickTriger = iTickCount + 50; // set the frame rate (20fps)
				ProgCycle(hWnd, hDC); // Function of the main program run
			}
		}
	}
(The code is supposed to create an infinite loop of the programme which runs at 20 fps)
[This code is copied from a learners book of some little games and application and obviously works well]

The thing I am refering to is that this loop makes the CPU run on 100%... It does not slow down the computer, all other applications run at ussual speed but the CPU usage is about 100% all the time while running this app...

I am wondering if it is correct sollution. And if not what else shall I try istead???

Thank you in advance