I think you have to use SetWindow API . Search for some example ...