471,582 Members | 1,412 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,582 software developers and data experts.

RichTextBox code to change the Insert/Overwrite mode does not work

I have a RichTextBox and I want to programmatically change the
Insert/Overwrite mode.

I tried the following but it doesn't appear to change the mode.

Pressing the Insert or Ins key does change the mode.

Any suggestions or verification?

Thanks

[DllImport("user32", CharSet=CharSet.Auto,EntryPoint="SendMessage")] public
static extern uint SendMessagezz (IntPtr hWnd , uint msg ,uint wParam , uint
lParam );

[DllImport("user32", CharSet=CharSet.Auto)] public static extern uint
MapVirtualKey (uint uCode , uint uMapType );

public static void FlipInsert(IntPtr Handle)

{

// uint WM_KEYDOWN = 0x100;

// uint WM_KEYUP = 0x101;

// uint VK_INSERT = 0x2D;

uint zz0 = MapVirtualKey(VK_INSERT, 0) * 0x10000;

uint zz1 = 1 | zz0;

uint zz2 = 0xC0000001 | zz0;

SendMessagezz(Handle, WM_KEYDOWN, VK_INSERT, zz1);

SendMessagezz(Handle, WM_KEYUP, VK_INSERT, zz2);

}
Nov 17 '05 #1
0 1631

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Bertrand P. | last post: by
reply views Thread by DMD | last post: by
8 posts views Thread by Dennis | last post: by
3 posts views Thread by josh.kuo | last post: by
1 post views Thread by farrukhqadri786 | last post: by
7 posts views Thread by paul_0403 | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by lumer26 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.