Type: Posts; User: Alex31
See the well-known sample from Petzold which does exatly that, posted many times on usenet..