I am working on a Win32 console application that uses a keylogger to determine when a specific key sequence is pressed and then opens a console window when it is. When the window is made visible, it prompts the user to enter a string of text. Unfortunately, everything the user has typed since the program started running is already there.
For example, if I opened the program, typed "ABC" in a notepad application, and then performed the key sequence, the window would open up and the cursor would be pre-filled with "ABC."
How can I stop this from happening? I have tried using cin.clear() and similar methods, but to no avail.
A basic outline of the code is below: