Not sure if this is unique to VB6 or for all uses of ReadConsole. However, here's what I've discovered. In my test, you have a command button that calls ReadConsole. There are 3 ways of using it, but one has a bug.
In the first way, you click the command button, and then type some text into the console. As you type it, it appears. Then press Enter to complete the action, and the ReadConsole will place what you typed in the readout buffer.
In the second way, you type what you want and then hit the Enter key in the console, before clicking the command button. The text will be invisible until you click the command button. The moment you click it, the text will appear in the console, and be sent to the readout buffer.
In the third way, you type what you want in the console, but don't hit the Enter key yet. Now click the command button. You now will see the text appear in the console, and also anything else you type will be immediately displayed in the console. So at this point, hit the Enter key. The readout buffer will now hold the text you typed, but there's a glitch. The first character will NOT be what you typed. Instead, it will be replaced with either a "P" or a "V". One is if you use the program while in the VB6 IDE. The other is if you use the program from a compiled EXE file (assuming it is compiled in Native code mode, not P-code mode).
Something funny is going on with the bytes stored in memory, but I'm not sure what. Is this a well known bug?
In the first way, you click the command button, and then type some text into the console. As you type it, it appears. Then press Enter to complete the action, and the ReadConsole will place what you typed in the readout buffer.
In the second way, you type what you want and then hit the Enter key in the console, before clicking the command button. The text will be invisible until you click the command button. The moment you click it, the text will appear in the console, and be sent to the readout buffer.
In the third way, you type what you want in the console, but don't hit the Enter key yet. Now click the command button. You now will see the text appear in the console, and also anything else you type will be immediately displayed in the console. So at this point, hit the Enter key. The readout buffer will now hold the text you typed, but there's a glitch. The first character will NOT be what you typed. Instead, it will be replaced with either a "P" or a "V". One is if you use the program while in the VB6 IDE. The other is if you use the program from a compiled EXE file (assuming it is compiled in Native code mode, not P-code mode).
Something funny is going on with the bytes stored in memory, but I'm not sure what. Is this a well known bug?