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
Solved

Keystrokes in Listbox

Posted on 1997-04-28
7
346 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
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

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…
What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
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…

808 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