You are not logged in. You can browse in the PowerBASIC Community, but you must click Login (top right) before you can post. If this is your first visit, check out the FAQ or Sign Up.
I'm using Semen Matusovski's MODELESS dialog idea to trap
keyboard events. It works well for all the additional functions
I wanted to inplement, but it odesn't seem to allow the ability
to throw away keystrokes.
I can get the desired action with COMBOBOX's either with
%CBS_DROPDOWN or %CBS_DROPDOWNLIST styles. With the former I
also get the number keys being pressed appearing in the list
box. But alphabet (and all others) appear too and I want to
throw them away. Only numerics and ENTER are allowed. With a
%CBS_DROPDOWNLIST stype All works but you don't get the
intermediate keys appearing in the box.
What I'd like to do is throw away the mesaages for all other
keys. Would anyone have an opinion on things to try to
infrom GetMessage that sometimes we don't want the message to
be processed (e.g. FUNCTION=%TRUE in a CallBack Function).
------------------------------------------------------------
DIALOG SHOW MODELESS hDlg, CALL CB_Main
WHILE GetMessage(tMsg,%NULL,0,0)
IF IsDialogMessage(hDlg,tMsg)=%FALSE THEN
TranslateMessage tMsg
DispatchMessage tMsg
ELSE
SELECT CASE tMsg.message
CASE %WM_KEYUP
SELECT CASE tMsg.WParam
CASE 48 TO 57
'Process the numeric keys
CASE 13
' Process the ENTER Key
CASE ELSE
'********* Throw away all else ????
END SELECT
END SELECT
END IF
IF hDlg=0 THEN EXIT DO
LOOP
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Leave a comment: