Consultor Eletrônico



Kbase P8359: ACTIVEX - How to Get Popup Menus to Work
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   17/09/2004
Status: Verified

GOAL:

ACTIVEX - How to Get Popup Menus to Work

FACT(s) (Environment):

Windows

FIX:

The following details the code needed to have a Progress popup menu display when you right click on an OCX control.

Step by step details:

1) Define the popup menu itself (either via hand written code or
   by defining it for another widget).

2) Assign the menu handle of the popup menu to the OCX's control
  frame:

   CtrlFrame:POPUP-MENU = MENU SomePopupMenu:HANDLE.

3) Assuming that the OCX you are using has an event that handles
   mouse events, place code *similar* to the following in the
   trigger:

   IF *TheRightMouseButtonWasPressed* THEN
      RUN SendMessageA (SELF:HWND, 517, 0, 0).

4) Put the following external procedure definition in either the
  Definitions section or wherever you put your external procedure
  definition code:

   PROCEDURE SendMessageA EXTERNAL "USER32.DLL":
      DEFINE INPUT PARAMETER win-handle AS LONG NO-UNDO.
      DEFINE INPUT PARAMETER win-msg    AS LONG NO-UNDO.
      DEFINE INPUT PARAMETER win-param1 AS LONG NO-UNDO.
      DEFINE INPUT PARAMETER win-param2 AS LONG NO-UNDO.
   END PROCEDURE.