This code generates a "This program has performed an illegal function and will be shut down" message.
What is illegal about the function? If the first MsgBox is made active, it shows up, but the "illegal function" message comes up before the second MsgBox. Info obtained from Win32.Hlp.
CallBack Function TestKeyPress
Dim Acd(0 To 255) As Byte
Local Cid As Byte
%A = 65
If CbMsg=%WM_INITDIALOG Then Exit Function
If CbCtl=14 Then
GetKeyboardState(Acd(0))
'MsgBox("So far ...")
Cid=Acd(%A)
'MsgBox(Str$(%A))
Control Set Text qDlg&, 14, "Key pressed"
End If
End Function
What is illegal about the function? If the first MsgBox is made active, it shows up, but the "illegal function" message comes up before the second MsgBox. Info obtained from Win32.Hlp.
CallBack Function TestKeyPress
Dim Acd(0 To 255) As Byte
Local Cid As Byte
%A = 65
If CbMsg=%WM_INITDIALOG Then Exit Function
If CbCtl=14 Then
GetKeyboardState(Acd(0))
'MsgBox("So far ...")
Cid=Acd(%A)
'MsgBox(Str$(%A))
Control Set Text qDlg&, 14, "Key pressed"
End If
End Function
Comment