Hi, i'm using VC++ 6.0. I'm having some activity in my program(e.g. moving object in a timer). If this object gets to the end of the screen and i press a key(doesn't matter which) a message shows up - MessageBox("You won"); or something like that. But if i do not press the key if the object gets to the end of the screen i want to make it give me a message "You lose".

I make the check in a function about if i press the key and it works.
But i dont know how to make it if the object gets by the end and i don't press the key. If i press the key it calls me the function and checks the coordinates. But if i don't press the key it doesn't call the function and it doesn't check the coordinates. I'm sorry about this stupid question but i'm a begginer in programming. THanks in advance.