How to disable standard windows popup menu when right click on a TEXTBOX

Started by Jean-pierre Leroy, August 22, 2010, 11:26:22 AM

Previous topic - Next topic

Jean-pierre Leroy

Dear FireFly users,

For an application, I created a specific popup menu with the new CONTEXTMENU handler provided by FF when the user right-click on an TEXTBOX; then I managed the option choosen by the user in the WM_COMMAND handler.

Everything works fine, except the fact that at the end, the standard windows popup menu also appears on the screen; it is the default popup menu provided by Microsoft with these options (undo, cut,copy,paste, delete and select all).

Is there any way to disable this standard windows popup menu for a specific TEXTBOX of a form ?

Thanks,
Jean-Pierre

Marc van Cauwenberghe

Hi Jean-Pierre,

Maybe this will help:
http://support.microsoft.com/kb/224302

What I just did was:
Function FORM1_TEXT1_WM_CONTEXTMENU ( _
                                    ControlIndex  As Long,  _  ' index in Control Array
                                    hWndForm      As Dword, _  ' handle of Form
                                    hWndControl   As Dword, _  ' handle of Control
                                    xPos          As Long,  _  ' x-coordinate of cursor
                                    yPos          As Long   _  ' y-coordinate of cursor
                                    ) As Long
   Function = %TRUE
End Function


Hope this helps.

Marc

Jean-pierre Leroy

Hi Marc,

Thanks a lot, it works exactly as expected.

Regards,
Jean-Pierre