ON_USER_EVENT

ON_USER_EVENT L

EXECUTES THE PROGRAM FROM LABEL L WHEN A USER EVENT IS TRIGGERED

  • Type: Command
  • Parameter: 1
  • Group: Events

ACTION

The command ON_USER_EVENT L assigns a label (which must be defined in the program) from which the program will run every time a user event is triggered.

A user event is triggered when FORM0 receive a message numered WM_USER + 3000. In this case, the system variables USER_EVENT_WPARAM and USER_EVENT_LPARAM contents the parameters WParam and LParam of the message.

SYNTAX: ON_USER_EVENT L

  • L = label.

USE

  • The command ON_USER_EVENT is used to associate a user event to a program location defined by a label.
  • When the event occurs, the program named by the label is executed.

ERROR

  • If the label L does not exist.
  • If L is not a correct label name.

EXAMPLE

label event_handler

print handle(0)

on_user_event event_handler

dll_on "MyDLL.dll"

print dll_call1("USER_EVENT",handle(0))

dll_off

end

event_handler:

message "event triggered by USER_EVENT of DLL"

return

SEE ALSO

OFF_USER_EVENT

USER_EVENT_LPARAM

USER_EVENT_WPARAM