Click to See Complete Forum and Search --> : Insert key to be pressed programmatically


vsaravana
February 18th, 2001, 10:33 AM
Does anybody know on what should I check to find if the user is in Insert mode or replace mode( wether the insert key is pressed or not)

And is there an way by which I can have the insert key pressed programmatically

Ellen
November 14th, 2001, 12:08 PM
Hi,
now I have the same problem in VB.
Have you found a solution for this problem? Maybe API?
Pleeeeease let me know :-)
Thanks
Ellen

vsaravana
November 16th, 2001, 09:03 AM
There were couple of things. First are u using Richeditcontrol or regular edit control. If you are using RicheditControl it has an specific Insert/Replace mode.
Ok now to find if the user is in Insert or replace Mode you can do the following there should be an message handler for Onchar in your control place the following within that function

if (nChar == VK_INSERT)
{
BOOL bShift = GetKeyState(VK_SHIFT) < 0;
BOOL bCtrl = GetKeyState(VK_CONTROL) < 0;
if (!bShift && !bCtrl)
{
//do what u need
}


Saravana