I have been working on some code that was originally written a long time ago in PBDLL version 6, and it has always ported to the newer compilers without any problem. Recently I compiled using PBWin 9.01 and have noticed something odd happening with the %EN_SetFocus message. I am using this message on a textbox control that is not a tabstop. Whenever a user clicks on the field one would expect to be able to process the %EN_SetFocus message. This is working, but I am getting 2 messages in the queue when compile with PBWin 9.01 rather than the 1 that I have always gotten in the past.
Below is a fully working piece of code to demonstrate what I am talking about. Compile this code with PBWin 8 and it works as expected. Compile with 9 and you get 2 messages instead of the expected 1.
compile the code and then click in the TextBox area. You should only get one message box for the code to be working as expected.
Any ideas??
Below is a fully working piece of code to demonstrate what I am talking about. Compile this code with PBWin 8 and it works as expected. Compile with 9 and you get 2 messages instead of the expected 1.
compile the code and then click in the TextBox area. You should only get one message box for the code to be working as expected.
Code:
#Compile Exe #Dim All %WM_Command = &H111 %EN_SetFocus = &H100 %ES_Left = &H0& %ES_Center = &H1& %ES_Right = &H2& %ES_MultiLine = &H4& %ES_Uppercase = &H8& %ES_Lowercase = &H10& %ES_Password = &H20& %ES_AutoVScroll = &H40& %ES_AutoHScroll = &H80& %ES_NoHideSel = &H100& %ES_OEMConvert = &H400& %ES_ReadOnly = &H800& %ES_WantReturn = &H1000& %ES_Number = &H2000& %WS_Ex_ClientEdge = &H00000200 CallBack Function DlgProc Static x As Dword Select Case CbMsg Case %WM_Command Select Case CbCtl Case 100 If CbCtlMsg = %EN_SetFocus Then If x < 10 Then ? "%EN_SetFocus msg recievd" Incr x End If Case 1, 2 Dialog End CbHndl, 0 End Select End Select End Function Function PBMain () As Long Local hDlg As Long Dialog New 0, "Test %EN_SetFocus Response",,,200, 60 To hDlg Control Add TextBox, hDlg, 100, "Click Here", 10, 10, 180, 12, %ES_AutoHScroll Or %ES_Left, %WS_Ex_ClientEdge ' NOT A TAB STOP Control Add Button, hDlg, 1, "Cancel", 20, 30, 50, 20 Control Add Button, hDlg, 2, "Ok", 130, 30, 50, 20 Dialog Show Modal hDlg, Call DlgProc End Function
Comment