to complete the peekmessage and getmessage emulation