int index;
static hmenu hmenu;
switch (umsg)
{
case wm_create:
// save the menu handle.
hmenu = getmenu(hwndmain);
// initialize structures with hook data. the menu-item
// identifiers are defined as 0 through 6 in the
// header file. they can be used to identify array
// elements both here and during the wm_command
// message.
myhookdata[idm_callwndproc].ntype = wh_callwndproc;
myhookdata[idm_callwndproc].hkprc = callwndproc;
myhookdata[idm_cbt].ntype = wh_cbt;
myhookdata[idm_cbt].hkprc = cbtproc;
myhookdata[idm_debug].ntype = wh_debug;