Kbase P101409: How to programmatically drop down a combo box
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  21/02/2005 |
|
Status: Unverified
GOAL:
How to programmatically drop down a combo box
GOAL:
How to call WIN32 API function SendMessage to signal a combo box to drop down
FIX:
The following sample code shows how to call the Win32 API function called SendMessage. This function sends a message to another window (widget) and waits for a response. The message bypasses the message queue and is acted upon immediately.
&GLOBAL-DEFINE CB_SHOWDROPDOWN 335 /* Cause Combo-Box to Drop Down */
DEFINE VARIABLE intResult AS INTEGER NO-UNDO.
PROCEDURE SendMessageA EXTERNAL "USER32.DLL":
DEFINE INPUT PARAMETER hwnd AS LONG NO-UNDO.
DEFINE INPUT PARAMETER wmsg AS LONG NO-UNDO.
DEFINE INPUT PARAMETER wparam AS LONG NO-UNDO.
DEFINE INPUT PARAMETER lparam AS LONG NO-UNDO.
DEFINE RETURN PARAMETER rc AS LONG NO-UNDO.
END PROCEDURE.
/* The following statement assumes that you have a combo-box */
/* defined called combo-box-1. */
RUN SendMessageA (INPUT COMBO-BOX-1:HWND,
INPUT {&CB_SHOWDROPDOWN},
INPUT 1,
INPUT 0,
OUTPUT intResult).