now i'm stuck with a few enoying problems..
hopefully anyone here can help me or show me where to look.
1) i want to have more then one column in listbox. possible?
2) after a value have been entered in a editbox someone mayuse the "enter"-key on the virtual keyboard. but if you hit the "enter"-key the dialog (the app itself) closes down. how to prevent this??
3) i want to capture the event where two buttons have been pushed down (on the hardware). is it possible ???
many thanx,
/mago
1: If your talking about a ListView control, then you can. If you are really talking about a drop ListBox, then it would take some serious customization to add that capability. In that case I surmise the simplest thing would probably be to catch the drop-down event, and display a "popup" ListView control for the user to make their selection. Also try searching CodeGuru.com. If you are using MFC then they have a ton of hybrid controls.
2: That is the default behavior of a dialog box. Capture the WM_KEYDOWN message for VK_RETURN and do not call the framework / default WndProc implementation (instead you can set focus to the next control just as Tab does, etc). If you have a multiline edit box and want to allow the user to enter multiple lines of text with carriage returns, then you have to set the ES_WANTRETURN style for the edit control.
3: Certainly. You receive key events in pairs; Key Down and Key Up. Obviously if you receive Key Down events for two different keys, without a correspondig Key Up, then both keys are down at once.
Dan East
Not to be critical or anything, but just fyi Mago, enoying is spelt "annoying". Nothing more to add since Dan did such a fantastic job of answering your questions.
many thanx for the advices.. and for the correction of my spelling.. =^)
/mago
en·oy:
v. en·oyed, en·oy·ing, en·oys
To receive pleasure from irritation
well, I learned something today.