Please enable JavaScript to view this site.

ASQL Reference

Navigation: » No topics above this level «

Adding Custom Menu Items

Scroll Prev Top Next More

One way to quickly make your applications more "Windows-like" is to use the Windows menu bar system as an alternative to traditional text-style application menus. AUI_MENU provides the necessary capabilities to accomplish this, and is adequately documented. Here we will instead go over a detailed example of adding Windows menu selections to a "typical" accounting application.

Our example application uses two levels of main menus. The first level offers choices for the various accounting modules (GL, AR, AP) while the second level displays the individual programs or tasks within each module. Our plan is to add Windows menus for both levels to the menu bar of the top-level menu program so that the user can bypass the second level and go directly to any individual program/task. We will accomplish this by creating an MDF (Menu Definition File) listing all of the programs and organizing them into three drop-down menus.

So far, this is very straightforward. The only complexities are deciding which of the menu action mechanisms to use, and how to integrate these actions with the existing main menu program. Briefly, the choices for each menu action are:

Execute a Windows command line
Call a custom DLL
Force a string of characters into the keyboard buffer
Specify a document or URL and let Windows decide how to launch the appropriate application to open it.

Subtopics