See "Example: Writing Code for Messages" for a discussion of how to connect a message to the function that causes it to be displayed, with examples. In particular, read that section to see how to attach a modal (blocking) message to a function.
Display the Connections Editor by clicking Connections in the Message Editor or by choosing Connections from the Editors menu of the App Builder primary window.
If you select a message in the Message Editor and click Connections, the selected message will be selected in the Source list of the Connections Editor. You can skip the next two steps.
Display messages in the Source list by choosing Message from the Source menu.
Select a message in the Source list.
Choose Call Function as the Action Type.
This activates the When menu on the Source side of the Connections Editor.
Choose a When item (Action1, Action2, Action3, or Cancel Activated, depending on which buttons were checked in the Message Editor).
Type the name of the Function to be called when the selected button is selected.
When code is generated, this function is created in <module_name>_stubs.c. You will have to substitute appropriate code before running make.
Click Connect to create the connection.
The connection will be displayed in the View list at the bottom of the Connections Editor.
Repeat the previous three steps for each button except Help.
Click Cancel to dismiss the Connections Editor.