Solved

Keyboard Insert / Overwrite Mode

Posted on 2002-04-30
2
662 Views
Last Modified: 2013-12-03
How can I programmatically detect whether the keyboard is in insert mode or in overwrite mode?

I know that one way of doing this is to have an ActiveX StatusBar control with a Panel with Style = sbrIns. The Panel is Enabled if the keyboard is in insert mode, but only if the StatusBar is Enabled and physically visible. I do not want a StatusBar on the Form. So I would like to know how to do this with the Win32 API.
0
Comment
Question by:SimonORorke
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 3

Expert Comment

by:GGRUNDY
ID: 6982702
BOOL isInsert =  ::GetKeyState(VK_INSERT)&1;
0
 
LVL 5

Accepted Solution

by:
robpitt earned 200 total points
ID: 6984416
Insert/overwrite are application specific concepts, hence every app must keep track of this itself.

Whilst using GetKeyState(VK_INSERT)&1 might appear to work, this isn't advisable because this state toggles for all presses of Insert not just the ones you want to listen to.

A better solution is to have your editing window (where you type the text to) handle the WM_KEYDOWN message and toggle a variable.
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As more and more people are shifting to the latest .Net frameworks, the windows presentation framework is gaining importance by the day. Many people are now turning to WPF controls to provide a rich user experience. I have been using WPF controls fo…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question