The following code, in the CREATE event of the window, will capture the "right mouse button down" event, both at the window level, and for a button called BUTTON_1. Equates are provided for capturing other events (right mouse button up, right mouse button double click, as examples).

declare function Send_Message
Equ TRUE$ to 1
* Mouse movement
Equ WM_MOUSEMOVE$   TO   '0x200'
* left button down, up, double click
Equ WM_LBUTTONDOWN$ TO   '0x201'       
Equ WM_LBUTTONUP$ TO     '0x202'       
Equ WM_LBUTTONDBLCLK$ TO '0x203'
* right button down, up, double click
Equ WM_RBUTTONDOWN$ TO   '0x204'
Equ WM_RBUTTONUP$ TO     '0x205'
Equ WM_RBUTTONDBLCLK$ TO '0x206'
* middle button down, up, doubleclick
Equ WM_MBUTTONDOWN$ TO   '0x207'
Equ WM_MBUTTONUP$ TO     '0x208'
Equ WM_MBUTTONDBLCLK$ TO '0x209'
 
/* this catches right mouse button down.
   Change to another equated value to catch another mouse event
*/
event_code = WM_RBUTTONDOWN$
rv = Send_Message(@window :'.BUTTON_1','QUALIFY_EVENT', event_code ,TRUE$)
rv = Send_Message(@window             ,'QUALIFY_EVENT', event_code ,TRUE$)
  • No labels