Solved

Keystrokes in Listbox

Posted on 1997-04-28
7
342 Views
Last Modified: 2013-12-04
I want to handle all keystrokes while a TLISTBOX from
the Pascal-OWL (WIN3.11) has the focus myself.
I tried already wm_char, wm_keydown,
lbs_wantkeyboardinput, wm_vkeytoitem and so on, but
I got always the standard-key management from WIN .
Any Idea?

Mircea
0
Comment
Question by:nmm
  • 4
  • 3
7 Comments
 

Expert Comment

by:gurumike
ID: 1396954
I'm not familiar with Delphi (I use BC++), but did you write your own listbox control or are you using the windows-standard one?
0
 

Author Comment

by:nmm
ID: 1396955
Gurumike: The standard-one from OWL...
0
 

Accepted Solution

by:
gurumike earned 50 total points
ID: 1396956
This answer might suck, but:
Derive your own class from TListBox that responds to the WM_KEYDOWN (or WM_CHAR) message.  You can do your special processing there, or you can call the default processing for TListBox then forward the message to the parent window for extra processing.
It's kind of puzzling that LBS_WANTKEYBOARDINPUT didn't work.  The documentation I have with BC++ says that the message is sent to the application object - so if that's not where your special processing occurs, try moving/adding it there.
0
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 

Author Comment

by:nmm
ID: 1396957
Hm. I must say: all you recomend I tried already.
The listbox behaves every time in the standard-TListbox manner.
*After* doing so it tries to process my code, but this is to late. What I want is simple: if you press a sequence of keys I
want the listbox to move the selection to the entry starting with
this sequence. But it moves allways to the entry which starts with the *first character* of the sequence....

0
 

Expert Comment

by:gurumike
ID: 1396958
As I understand it, your code is being run, but it has no effect.  In which method is your special processing being run?  Actually, if you could send me the relevant source code at olsonmd@aureate.com, I'd like to take a look at it and see if I can spot the problem.
0
 

Author Comment

by:nmm
ID: 1396959
Thank you! But there are meanwhile several versions of the code
(none running well) and some of them are erased already.
I will try to make a ultimative one and send you in a few days...(unfortunately have to do other things before) Thanks again!

Mircea
0
 

Expert Comment

by:gurumike
ID: 1396960
Sounds good.
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

This article shows how to make a Windows 7 gadget that extends its U/I with a flyout panel -- a window that pops out next to the gadget.  The example gadget shows several additional techniques:  How to automatically resize a gadget or flyout panel t…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

785 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