Intercept a Right-Click

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
Red2
Posts: 281
Joined: Sat May 18, 2019 2:11 pm
DBs Used: Visual FoxPro, FoxPro
Location: United States of America

Intercept a Right-Click

Post 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.
User avatar
AUGE_OHR
Posts: 2096
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: Intercept a Right-Click

Post 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
have fun
Jimmy
Post Reply