====== Catching a Right Mouse Click, and other Windows Messages (Functions/Subroutines/Programs) ====== ====== ====== ==== Created at 13 JUN 1997 04:27PM ==== It s very simple to capture various Windows events and use them to trigger events.  All that is involved is qualifying the particular Windows message to capture, and then filling in the appropriate actions in a WINMSG event handler.  The general outline is as follows:              call a Send_Message with the  QUALIFY_EVENT  message parameter; generally this would be done on the CREATE event for the form            write the event code in the WINMSG event handler;  this event will be generated for each Windows message that is requested using  QUALIFY_EVENT      Following is an example of catching the right mouse click on a button and on the window.   *  On the CREATE event of the form Function CREATE (CtrlEntId, CtrlClassId, CreateParam) Declare Function Send_Message     Equ    True$   TO 1       rv = Send_Message(@WINDOW:  .BUTTON_1 ,  QUALIFY_EVENT ,  0x204 , True$)     rv = Send_Message(@WINDOW,  QUALIFY_EVENT ,  0x204 , True$)   /* *          The first Send_Message(..) call requests that the WINMSG event for *          the BUTTON_1 control  be generated if there is a right click on the button.  *          The second call to Send_Message(..) does the same for the window.  The *          hex value  0x204  is the number assigned to a right mouse click in the *          Windows API.  Other events may be captured by filling in the appropriate *          hex value in other calls to Send_Message(..).  These values are found in *          the  windows.h  file which comes with most C compilers.  */ RETURN 0     * on the WINMSG event of BUTTON_1   Function WINMSG ( CtrlEntId, CtrlClassId, hWnd, Message, wParam, lParam ) Declare Function Set_Property       rv = Set_Property ( @WINDOW:  .TEXT_1 ,  TEXT ,  Caught it on the button! )   RETURN 0     * on the WINMSG event of the window   Function WINMSG ( CtrlEntId, CtrlClassId, hWnd, Message, wParam, lParam ) Declare Function Set_Property      rv = Set_Property ( @WINDOW:  .TEXT_1 ,  TEXT ,  Caught it on the window! )   RETURN 0       It s very simple to capture various Windows events and use them to trigger events.  All that is involved is qualifying the particular Windows message to capture, and then filling in the appropriate actions in a WINMSG event handler.  The general outline is as follows:          call a Send_Message with the  QUALIFY_EVENT  message parameter; generally this would be done on the CREATE event for the form        write the event code in the WINMSG event handler; this event will be generated for each Windows message that is requested using  QUALIFY_EVENT ; every control has this event.  To see it on something like a Static Text or Bitmap control, double-click on the control with the key down   Following is an example of catching the right mouse click on a bitmap and on the window.   *  On the CREATE event of the form Function CREATE (CtrlEntId, CtrlClassId, CreateParam) Declare Function Send_Message     Equ    True$   TO 1       rv = Send_Message(@WINDOW:  .BITMAP_1 ,  QUALIFY_EVENT ,  0x204 , True$)     rv = Send_Message(@WINDOW,  QUALIFY_EVENT ,  0x204 , True$)   /* *          The first Send_Message(..) call requests that the WINMSG event for *          the BITMAP_1 control  be generated if there is a right click on the bitmap.  *          The second call to Send_Message(..) does the same for the window.  The *          hex value  0x204  is the number assigned to a right mouse click in the *          Windows API.  Other events may be captured by filling in the appropriate *          hex value in other calls to Send_Message(..).  These values are found in *          the  windows.h  file which comes with most C compilers.  */ RETURN 0     * on the WINMSG event of BITMAP_1   Function WINMSG ( CtrlEntId, CtrlClassId, hWnd, Message, wParam, lParam ) Declare Function Set_Property       rv = Set_Property ( @WINDOW:  .TEXT_1 ,  TEXT ,  Caught it on the bitmap! )   RETURN 0     * on the WINMSG event of the window   Function WINMSG ( CtrlEntId, CtrlClassId, hWnd, Message, wParam, lParam ) Declare Function Set_Property      rv = Set_Property ( @WINDOW:  .TEXT_1 ,  TEXT ,  Caught it on the window! )   RETURN 0