Right Mouse Menu Down - Anywhere | Else Event

balta

Member
Hello,

I am trying to force default behavior of right-mouse-click when the click is not in a browse.

It is possible?

Bellow Code.

Code:
ON 'right-mouse-down':U anywhere DO:
    
    /* só dispara a 1º vez */
    if focus:type = "BROWSE" then do: /* só "reage" se tiver ENABLED */
        
        ghDataBrowse = focus:handle.
        run POP-UP-MENU.
        
    end.
    else do:
    
        /* THIS code DON´T work */
        apply "mouse-menu-down":U to self.
        return no-apply.
        
    end.

end.
 
Not quite sure what you want to achieve, but I use below code to enforce right click when the user presses the left button.
Maybe this can get you on track:

Code:
PROCEDURE SendMessageA EXTERNAL "user32.dll":
  DEFINE INPUT  PARAMETER hwnd   AS long NO-UNDO.
  DEFINE INPUT  PARAMETER wmsg   AS long NO-UNDO.
  DEFINE INPUT  PARAMETER wparam AS long NO-UNDO.
  DEFINE INPUT  PARAMETER lparam AS long NO-UNDO.
  DEFINE RETURN PARAMETER rc     AS long NO-UNDO.
END PROCEDURE.

ON 'choose' OF some-button PERSISTENT
  RUN forceRightClick IN THIS-PROCEDURE (some-button:HANDLE).

PROCEDURE forceRightClick:
  DEFINE INPUT PARAMETER phButton AS HANDLE NO-UNDO.

  DEFINE VARIABLE iReturn AS INTEGER NO-UNDO.

  &GLOBAL-DEFINE WM_RBUTTONDOWN 516
  &GLOBAL-DEFINE MK_RBUTTON       2
  &GLOBAL-DEFINE WM_RBUTTONUP   517

  RUN SendMessageA (phButton:HWND, {&WM_RBUTTONDOWN}, {&MK_RBUTTON}, 0, OUTPUT iReturn).
  RUN SendMessageA (phButton:HWND, {&WM_RBUTTONUP}  , 0            , 0, OUTPUT iReturn).

END PROCEDURE.
 
Will try to explain

Without
the block "mouse-menu-down" this appears

1748868580132.png

With the block this menu don´t appear

Objetive: Appear this menu WITH the block defined.
 
Ok, try this. If you right-click outside the browse, but on the frame itself (not on buttons or anything else on the frame) then the popup for the browse will appear

1748961154954.png
 
Back
Top