Hiya all.
I need to trap the ENTER key from any control on a dialog, I have
just searched for WM_CHAR in the forums and found a few ideas
but I am confused. It appears the most common reply is to
sub class a control.
The follwoing is from the win32 help file..
The WM_CHAR message is posted to the window with the keyboard
focus when a WM_KEYDOWN message is translated by the
TranslateMessage function. WM_CHAR contains the character code
of the key that was pressed.
This leads me to believe that that I should be able to
trap the WM_CHAR message in the dialogs callback with something
like
Select Case CBMSG
Case %WM_CHAR
If CBWPARAM = %VK_RETURN Then
SendMessage hDlg, %WM_CHAR,%VK_TAB,0
Function = 0 'stop the enter key going further
End IF
End Select
It was this easy in VB3, am I doing something wrong in PB. ?
I shouldnt have to subclass just to trap a key.
Please Help.
NJH.
------------------
I need to trap the ENTER key from any control on a dialog, I have
just searched for WM_CHAR in the forums and found a few ideas
but I am confused. It appears the most common reply is to
sub class a control.
The follwoing is from the win32 help file..
The WM_CHAR message is posted to the window with the keyboard
focus when a WM_KEYDOWN message is translated by the
TranslateMessage function. WM_CHAR contains the character code
of the key that was pressed.
This leads me to believe that that I should be able to
trap the WM_CHAR message in the dialogs callback with something
like
Select Case CBMSG
Case %WM_CHAR
If CBWPARAM = %VK_RETURN Then
SendMessage hDlg, %WM_CHAR,%VK_TAB,0
Function = 0 'stop the enter key going further
End IF
End Select
It was this easy in VB3, am I doing something wrong in PB. ?
I shouldnt have to subclass just to trap a key.
Please Help.
NJH.

------------------
Comment