Strange Clarion Behaviour
Posted October 29th, 2009 by Andrew PopoffClarion 6.3.9058
I have a clarion window with two buttons. Each button have an ID. As I understand this ID’s starts from 16385 (4001H). You can see this ID’s using some Spy. Thus we have a buttons with ID 16385 and 16386.
I send the message WM_COMMAND for ID 16385 and the action is executed on the button 1.
I send the message WM_COMMAND for ID 16386 and the action is executed on the button 2.
I send the message WM_COMMAND for ID 16387 and no action is executed.
!!!!!
I send the message WM_COMMAND for ID 40000 and the action is executed on the button that has a focus!
!!!!!
I send the message WM_COMMAND for ID 60000 and no action is executed.
Why this happens?
I think that some condition exists. And this condition executes the action on the button with focus when the window receives WM_COMMAND for not existing control. What is the condition?
The test code:
PROGRAM
MAP
MODULE('WinAPI')
test_SendMessage(ULONG hWnd,ULONG inMsg,ULONG wParam,LONG
lParam),LONG,PASCAL,RAW,NAME('SendMessageA'),PROC
END
END
WM_COMMAND EQUATE(0111h)
Window WINDOW('Caption'),AT(,,274,83),FONT('MS Sans
Serif',8,,FONT:regular),TIMER(1000),SYSTEM,GRAY
BUTTON('Button 1'),AT(46,18,98,46),USE(?Button1)
BUTTON('SendMessage'),AT(186,26,66,26),USE(?Button2)
END
CODE
OPEN(WINDOW)
ACCEPT
IF ACCEPTED() = ?Button1
MESSAGE('Button1 Action')
END
IF ACCEPTED() = ?Button2
MESSAGE('Button2 Action')
!test_SendMessage(0{Prop:Handle},WM_COMMAND,16385,0) ! 1. it
works despite of lParam
!test_SendMessage(0{Prop:Handle},WM_COMMAND,16385,?Button1{Prop:Handle})
! 2. it works
!test_SendMessage(0{Prop:Handle},WM_COMMAND,16387,0) ! 3. it
not works - OK
END
IF EVENT() = EVENT:Timer
!0{Prop:Timer} = 0 ! stop the timer
test_SendMessage(0{Prop:Handle},WM_COMMAND,40000,0) ! 4. it
runs control with a focus
END
END
Tags: bug | No Comments »

Leave a Reply