Page 1 of 1

Intercept a Right-Click

Posted: Sun Dec 17, 2023 11:42 pm
by Red2
For the combination of the following three conditions:
1) A RIGHT-Click
2) Brings up a CONTEXT MENU
3) In a BROWSE/GRID Header

What:
In the above a CONTEXT MENU appears in/above the Header row even though NO DATA ROW is, in fact, selected by the click.
The VALUE property shows the last row selected. The VALUE does NOT indicate Header focus.

Problem:
Here interception and cancellation of the MENUITEM ONCLICK code via events OnChange() and OnHeadClick() fails.
Specifically, the BROWSE/GRID OnChange() and OnHeadClick() do NOT fire.

Question:
How can this Header "CONTEXT MENU" Right-Click be programmatically be intercepted and then stopped?

Thank you for your suggestions.

Re: Intercept a Right-Click

Posted: Mon Dec 18, 2023 8:21 am
by AUGE_OHR
hu Red,

there is HB_FUNC ( LISTVIEW_HITTEST ) to find out where you have click in GRID

have a look into \SOURCE\h_windows.PRG for

Code: Select all

  CASE nMsg == WM_CONTEXTMENU
this is the Place where right-Menu is called