Hello ASerge,
tried the workaround and it does fine what he is expected to do. Folders within the listview are handled correctly too, ie- the submenu "Grant access to" for a folder does reappear. It's nice encapsulated to easy to use
Probably it would not take much to make it work for the treeview too.
However i'd prefer to see the "traditional" way downward compatible work again, as there are needs to apply more stuff herein, namely to append to the system menu user defined items and functions (such customizing might be part of the ShowSystemPoupup coding though, but by that it won't be very generic any longer.
So for me it would be sufficient simply to know what's the future way to go.
Based on the workaround or will those messages triggered again later by Lazarus? What might be the decision?
For to have the full picture: this is the normal conditions embedding (i got it from a couple of readings years ago, so i don't remember each detail):
if ((Msg = WM_INITMENUPOPUP) or (Msg = WM_DRAWITEM) or (Msg = WM_MENUCHAR)
or (Msg = WM_MEASUREITEM)) and Assigned(ICM2) then
begin
ICM2.HandleMenuMsg(Msg, wParam, lParam);
Result := 0;
end;
About the messages i thought about if there is any trick to pickup the right message form the message loop.
I noticed that (in my mini example):
in Delphi 7 there are
71 message invocations in the phase were ICM2 is assigned.
Within those, there is one single occurance where Message.Msg is WM_INITMENUPOPUP.
That is:
wParam 106825913 lparam: 0 === ICM2 is assigned here; And Msg is WM_INITMENUPOPUP
In Lazarus there are *in total* only
3 messages where ICM2 is assigned. Those are:
wParam 7864940 lparam: 2 === ICM2 ist assigned here
wParam 0 lparam: 22456144 === ICM2 ist assigned here
wParam 0 lparam: 0 === ICM2 ist assigned here
Punctually calling HandleMenuMsg for each of them selectively does fail. Not much room to play.
Here are definitively messages missing that would be required for to meke the HandleMenuMsg work correctly.
What do you think is the right way to react?